From ef9e16c2e4578c9c8cd664b91a4a489f92919da4 Mon Sep 17 00:00:00 2001 From: "builds.sr.ht" Date: Mon, 15 May 2023 10:18:57 +0000 Subject: [PATCH] Squashed 'subprojects/d2tk/' changes from 857f7fd..55c66de 55c66de release-0.2.0 b425650 Fix typo in ci recipe scan-build options b01076c Fix clang warninngs c2b59fd Add libinput event types from >=1.19 c9371e1 Fix analyzer warning 1fdb0ba Add support for scan_build options in ci recipe cf64bb9 Disable building of examples in ci recipe 8d3a930 Merge commit 'e634e0d900f02c2f74603c807870c50e60e021bf' e634e0d Squashed 'linenoise/' changes from 9dfa3862c..f4b607038 7bf38d7 Make clone callbacks always inline f2f69ba Fixes for clang compiler 3c1e023 Add memcheck and static analyzer to ci recipe 7a7caf5 Fix clang compiler warnings 6696a4e Add deploy stage to ci recipe 7047c8d Fix settermprop return value and mouse mode git-subtree-dir: subprojects/d2tk git-subtree-split: 55c66deb503a728b4c3636ca7af819908a2ab881 --- .builds/alpine-latest.yml | 78 +++++++++++++++++++---- d2tk/base.h | 2 +- d2tk/config.h.in | 1 + d2tk/frontend.h | 2 +- example/d2tk_fbdev.c | 1 + example/example.c | 4 +- example/example.h | 2 +- linenoise/encodings/utf8.c | 6 +- meson.build | 42 ++++++++----- meson_options.txt | 7 ++- src/backend_nanovg.c | 8 +-- src/base.c | 2 +- src/base_pty.c | 17 ++--- src/base_wave.c | 2 +- src/frontend_fbdev.c | 56 ++++++++++++++--- src/frontend_glfw.c | 2 +- src/frontend_pugl.c | 2 +- src/util_spawn.c | 2 +- test/base.c | 126 ++++++++++++++++++------------------- test/core.c | 62 +++++++++--------- 20 files changed, 268 insertions(+), 156 deletions(-) diff --git a/.builds/alpine-latest.yml b/.builds/alpine-latest.yml index 6b41135..37b1711 100644 --- a/.builds/alpine-latest.yml +++ b/.builds/alpine-latest.yml @@ -6,8 +6,15 @@ image: alpine/latest packages: + - clang15-analyzer + - llvm15 - reuse - meson + - git-subtree + - hut + - jq + - valgrind + - cairo-dev - libinput-dev - eudev-dev @@ -15,31 +22,78 @@ packages: - glu-dev - glfw-dev - libvterm-dev - # - fontconfig-dev environment: project: d2tk + CI_SCAN_BUILD_OPTS: -disable-checker security.insecureAPI.vfork -disable-checker unix.Vfork --exclude nanovg --exclude pugl + +secrets: + - 0545580c-42ac-4700-b322-4e9df924eb07 # runner-ssh + - 5fe806cd-3af4-4588-9898-8115d9262144 # hut-config + - d6d10b2a-542a-4b45-b1be-6ef30a8ab558 # git-config + +sources: + - https://git.open-music-kontrollers.ch/~hp/ci tasks: - - setup: | - cd "${project}" - meson setup build \ + - gcc: | + . ~/ci/activate + + ci-meson gcc setup \ + -Dbuild-examples=true \ + -Duse-backend-cairo=enabled \ + -Duse-backend-nanovg=enabled \ + -Duse-frontend-fbdev=enabled \ + -Duse-frontend-pugl=enabled \ + -Duse-frontend-glfw=enabled \ + -Duse-fontconfig=disabled \ + -Duse-evdev=enabled + ci-meson gcc build + ci-meson gcc test + ci-meson gcc memcheck + + - clang: | + . ~/ci/activate + + ci-meson clang setup \ + -Dbuild-examples=true \ -Duse-backend-cairo=enabled \ -Duse-backend-nanovg=enabled \ -Duse-frontend-fbdev=enabled \ -Duse-frontend-pugl=enabled \ -Duse-frontend-glfw=enabled \ -Duse-fontconfig=disabled \ - -Duse-evdev=enabled \ - - build: | - cd "${project}" - ninja -C build - - test: | - cd "${project}" - ninja -C build test + -Duse-evdev=enabled + ci-meson clang build + ci-meson clang test + ci-meson clang memcheck + + - analyzer: | + . ~/ci/activate + + ci-meson analyzer setup \ + -Dbuild-examples=true \ + -Duse-backend-cairo=enabled \ + -Duse-backend-nanovg=enabled \ + -Duse-frontend-fbdev=enabled \ + -Duse-frontend-pugl=enabled \ + -Duse-frontend-glfw=enabled \ + -Duse-fontconfig=disabled \ + -Duse-evdev=enabled + ci-meson analyzer build + ci-meson analyzer test + + - deploy: | + . ~/ci/activate + + if ! ci-isrelease; then + complete-build + fi + + ci-subtreemerge triggers: - action: email - condition: failure + condition: failure to: "" ... diff --git a/d2tk/base.h b/d2tk/base.h index e9b4344..f8be9aa 100644 --- a/d2tk/base.h +++ b/d2tk/base.h @@ -401,7 +401,7 @@ d2tk_base_button_image(d2tk_base_t *base, d2tk_id_t id, ssize_t path_len, d2tk_state_is_changed(d2tk_base_button_image(__VA_ARGS__)) D2TK_API const d2tk_style_t * -d2tk_base_get_default_style(); +d2tk_base_get_default_style(void); D2TK_API const d2tk_style_t * d2tk_base_get_style(d2tk_base_t *base); diff --git a/d2tk/config.h.in b/d2tk/config.h.in index fca007a..da0ad91 100644 --- a/d2tk/config.h.in +++ b/d2tk/config.h.in @@ -5,6 +5,7 @@ #define D2TK_EVDEV @D2TK_EVDEV@ #define D2TK_INPUT_1_15 @D2TK_INPUT_1_15@ +#define D2TK_INPUT_1_19 @D2TK_INPUT_1_19@ #define D2TK_FONTCONFIG @D2TK_FONTCONFIG@ #define D2TK_DEBUG @D2TK_DEBUG@ #define D2TK_GLES_VERSION @D2TK_GLES_VERSION@ diff --git a/d2tk/frontend.h b/d2tk/frontend.h index 5cd1faf..3fd52ec 100644 --- a/d2tk/frontend.h +++ b/d2tk/frontend.h @@ -53,7 +53,7 @@ d2tk_frontend_get_clipboard(d2tk_frontend_t *dpugl, const char **type, size_t *buf_len); D2TK_API float -d2tk_frontend_get_scale(); +d2tk_frontend_get_scale(void); #ifdef __cplusplus } diff --git a/example/d2tk_fbdev.c b/example/d2tk_fbdev.c index 4303ca1..6930c9f 100644 --- a/example/d2tk_fbdev.c +++ b/example/d2tk_fbdev.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include "example/example.h" diff --git a/example/example.c b/example/example.c index 5a99549..e218bc0 100644 --- a/example/example.c +++ b/example/example.c @@ -1100,7 +1100,7 @@ _render_c_pty(d2tk_base_t *base, const d2tk_rect_t *rect) case 0: { D2TK_BASE_PTY(base, D2TK_ID, NULL, argv, HEIGHT, hrect, - D2TK_FLAG_PTY_NOMOUSE, pty) + D2TK_FLAG_NONE, pty) { const uint32_t max_red = d2tk_pty_get_max_red(pty); const uint32_t max_green = d2tk_pty_get_max_green(pty); @@ -1126,7 +1126,7 @@ _render_c_pty(d2tk_base_t *base, const d2tk_rect_t *rect) case 1: { D2TK_BASE_PTY(base, D2TK_ID, NULL, argv, HEIGHT, hrect, - D2TK_FLAG_PTY_NOMOUSE, pty) + D2TK_FLAG_NONE, pty) { // nothing to do } diff --git a/example/example.h b/example/example.h index 2c5383c..935c9af 100644 --- a/example/example.h +++ b/example/example.h @@ -17,7 +17,7 @@ D2TK_API int d2tk_example_init(void); D2TK_API void -d2tk_example_deinit(); +d2tk_example_deinit(void); D2TK_API void d2tk_example_run(d2tk_frontend_t *frontend, d2tk_base_t *base, diff --git a/linenoise/encodings/utf8.c b/linenoise/encodings/utf8.c index 5cd7767..568aa35 100755 --- a/linenoise/encodings/utf8.c +++ b/linenoise/encodings/utf8.c @@ -469,7 +469,7 @@ static size_t utf8BytesToCodePoint(const char* buf, size_t len, int* cp) { */ size_t linenoiseUtf8NextCharLen(const char* buf, size_t buf_len, size_t pos, size_t *col_len) { size_t beg = pos; - int cp; + int cp=0; size_t len = utf8BytesToCodePoint(buf + pos, buf_len - pos, &cp); if (isCombiningChar(cp)) { /* NOTREACHED */ @@ -478,7 +478,7 @@ size_t linenoiseUtf8NextCharLen(const char* buf, size_t buf_len, size_t pos, siz if (col_len != NULL) *col_len = isWideChar(cp) ? 2 : 1; pos += len; while (pos < buf_len) { - int cp; + int cp=0; len = utf8BytesToCodePoint(buf + pos, buf_len - pos, &cp); if (!isCombiningChar(cp)) return pos - beg; pos += len; @@ -494,7 +494,7 @@ size_t linenoiseUtf8PrevCharLen(const char* buf, size_t buf_len, size_t pos, siz while (pos > 0) { size_t len = prevUtf8CharLen(buf, pos); pos -= len; - int cp; + int cp=0; utf8BytesToCodePoint(buf + pos, len, &cp); if (!isCombiningChar(cp)) { if (col_len != NULL) *col_len = isWideChar(cp) ? 2 : 1; diff --git a/meson.build b/meson.build index ca11755..53d1284 100644 --- a/meson.build +++ b/meson.build @@ -176,10 +176,16 @@ else conf_data.set('D2TK_EVDEV', 0) endif -if input_dep.found() and input_dep.version().version_compare('>=1.15.0') - conf_data.set('D2TK_INPUT_1_15', 1) -else - conf_data.set('D2TK_INPUT_1_15', 0) +conf_data.set('D2TK_INPUT_1_15', 0) +conf_data.set('D2TK_INPUT_1_19', 0) +if input_dep.found() + if input_dep.version().version_compare('>=1.19.0') + conf_data.set('D2TK_INPUT_1_19', 1) + endif + + if input_dep.version().version_compare('>=1.15.0') + conf_data.set('D2TK_INPUT_1_15', 1) + endif endif if use_fontconfig.enabled() @@ -248,8 +254,14 @@ test_base_srcs = [ join_paths('test', 'mock.c') ] -c_args = ['-fvisibility=hidden', - '-ffast-math'] +c_args = [ + '-fvisibility=hidden', + '-ffast-math', + '-Wno-gnu-zero-variadic-macro-arguments', + '-Wno-unknown-attributes', + '-Wno-ignored-attributes', + '-Wno-unknown-warning-option' +] if host_machine.system() == 'windows' deps += cc.find_library('opengl32', required : use_frontend_pugl) @@ -416,8 +428,10 @@ if build_tests include_directories : inc_dir, install : false) - test('Test core', test_core) - test('Test base', test_base) + test('Test core', test_core, + suite : ['memcheck']) + test('Test base', test_base, + suite : ['memcheck']) if fc_list.found() and grep.found() and check_for_font.found() test('FiraSans-Bold.ttf', check_for_font, args : ['FiraSans-Bold.ttf']) @@ -426,13 +440,13 @@ if build_tests test('FiraCode-Medium.ttf', check_for_font, args : ['FiraCode-Medium.ttf']) test('FiraCode-Bold.ttf', check_for_font, args : ['FiraCode-Bold.ttf']) endif -endif -if reuse.found() - test('REUSE', reuse, args : [ - '--root', meson.current_source_dir(), - 'lint' - ]) + if reuse.found() + test('REUSE', reuse, args : [ + '--root', meson.current_source_dir(), + 'lint' + ]) + endif endif if build_doc diff --git a/meson_options.txt b/meson_options.txt index 6238c71..f278866 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -28,8 +28,8 @@ option('use-backend-nanovg', yield : true) option('use-gles-version', type : 'integer', - min : 2, - max : 3, + min : 2, + max : 3, value : 3, yield : true) @@ -54,4 +54,5 @@ option('use-fontconfig', type : 'feature', value : 'disabled', yield : true) -option('version', type : 'string', value : '0.1.1309') + +option('version', type : 'string', value : '0.2.0') diff --git a/src/backend_nanovg.c b/src/backend_nanovg.c index d5203cb..70653b9 100644 --- a/src/backend_nanovg.c +++ b/src/backend_nanovg.c @@ -371,20 +371,18 @@ _d2tk_nanovg_surf_draw(NVGcontext *ctx, int img, d2tk_coord_t xo, d2tk_coord_t w = W; d2tk_coord_t h = H; - float scale = 1.f; if(h != rect->h) { - scale = (float)rect->h / h; + const float scale = (float)rect->h / h; w *= scale; h = rect->h; } if(w > rect->w) { - const float scale_t = (float)rect->w / w; - scale *= scale_t; - h *= scale_t; + const float scale = (float)rect->w / w; + h *= scale; w = rect->w; } diff --git a/src/base.c b/src/base.c index 545b913..30ccc33 100644 --- a/src/base.c +++ b/src/base.c @@ -688,7 +688,7 @@ d2tk_base_is_active_hot(d2tk_base_t *base, d2tk_id_t id, #define FONT_SANS_BOLD "FiraSans:bold" D2TK_API const d2tk_style_t * -d2tk_base_get_default_style() +d2tk_base_get_default_style(void) { static const d2tk_style_t style = { .font_face = FONT_SANS_BOLD, diff --git a/src/base_pty.c b/src/base_pty.c index 4dddb3d..0fcb832 100644 --- a/src/base_pty.c +++ b/src/base_pty.c @@ -79,7 +79,6 @@ struct _d2tk_atom_body_pty_t { d2tk_coord_t ncols; d2tk_coord_t nrows; unsigned bell; - bool hasmouse; int fd; ptrdiff_t kid; @@ -96,6 +95,7 @@ struct _d2tk_atom_body_pty_t { bool cursor_visible; int cursor_shape; + int mouse; col_t max_red; col_t max_green; @@ -171,7 +171,7 @@ _term_done_thread(d2tk_atom_body_pty_t *vpty) return 0; } - pthread_join(vpty->kid, NULL); + pthread_join((pthread_t)vpty->kid, NULL); #if D2TK_DEBUG == 1 fprintf(stderr, "[%s] child with pid %ld has exited\n", @@ -266,7 +266,7 @@ _screen_settermprop(VTermProp prop, VTermValue *val, void *data) } break; case VTERM_PROP_MOUSE: { - vpty->hasmouse = true; + vpty->mouse = val->number; } break; default: @@ -275,7 +275,7 @@ _screen_settermprop(VTermProp prop, VTermValue *val, void *data) } break; } - return 0; + return 1; } static int @@ -323,7 +323,7 @@ static const VTermScreenCallbacks screen_callbacks = { .resize = _screen_resize }; -static int +static inline __attribute__((always_inline)) int _clone(void *data) { clone_data_t *clone_data = data; @@ -420,7 +420,7 @@ _threadpty(int *amaster, const struct termios *termp, const struct winsize *winp *amaster = thread_data_master; - return thread; + return (ptrdiff_t)thread; } static ptrdiff_t @@ -575,7 +575,7 @@ _term_deinit_thread(d2tk_atom_body_pty_t *vpty) // send CTRL-C vterm_keyboard_unichar(vpty->vterm, 0x3, VTERM_MOD_NONE); - pthread_join(vpty->kid, NULL); + pthread_join((pthread_t)vpty->kid, NULL); #if D2TK_DEBUG == 1 fprintf(stderr, "[%s] child with pid %ld has exited\n", @@ -1018,7 +1018,8 @@ _term_behave(d2tk_base_t *base, d2tk_atom_body_pty_t *vpty, vterm_state_focus_out(vpty->state); } - if( !vpty->hasmouse || (flags & D2TK_FLAG_PTY_NOMOUSE) ) + if( (vpty->mouse == VTERM_PROP_MOUSE_NONE) + || (flags & D2TK_FLAG_PTY_NOMOUSE) ) { return state; } diff --git a/src/base_wave.c b/src/base_wave.c index 66230cf..9b4f705 100644 --- a/src/base_wave.c +++ b/src/base_wave.c @@ -65,7 +65,7 @@ _d2tk_base_draw_wave(d2tk_core_t *core, const d2tk_rect_t *rect, d2tk_core_color(core, style->fill_color[triple_active]); - if(nelem > bnd_inner.w) + if( (nelem > bnd_inner.w) && (bnd_inner.w > 1) ) { for(int32_t i = 0; i < bnd_inner.w; i++) { diff --git a/src/frontend_fbdev.c b/src/frontend_fbdev.c index 2768aaa..4b88d3b 100644 --- a/src/frontend_fbdev.c +++ b/src/frontend_fbdev.c @@ -170,12 +170,6 @@ handle_allocate_error: exit(1); } -static inline void -_d2tk_frontend_close(d2tk_frontend_t *fbdev) -{ - fbdev->done = true; -} - static inline void _d2tk_frontend_expose(d2tk_frontend_t *fbdev) { @@ -454,7 +448,55 @@ d2tk_frontend_step(d2tk_frontend_t *fbdev) } break; } } break; + +#if D2TK_INPUT_1_19 + case LIBINPUT_EVENT_GESTURE_HOLD_BEGIN: + { + //FIXME + } break; + case LIBINPUT_EVENT_GESTURE_HOLD_END: + { + //FIXME + } break; + case LIBINPUT_EVENT_POINTER_SCROLL_WHEEL: + // fall-through + case LIBINPUT_EVENT_POINTER_SCROLL_FINGER: + // fall-through + case LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS: + { + struct libinput_event_pointer *evp = + libinput_event_get_pointer_event(ev); + + int32_t dx = 0; + int32_t dy = 0; + + if(libinput_event_get_type(ev) == LIBINPUT_EVENT_POINTER_SCROLL_WHEEL) + { + dx = libinput_event_pointer_get_scroll_value_v120(evp, + LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL); + dy = libinput_event_pointer_get_scroll_value_v120(evp, + LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL); + } + else + { + dx = libinput_event_pointer_get_scroll_value(evp, + LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL); + dy = libinput_event_pointer_get_scroll_value(evp, + LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL); + + dx /= 100.f; //FIXME + dy /= 100.f; //FIXME + } + + d2tk_base_add_mouse_scroll(fbdev->base, -dx, -dy); + } break; case LIBINPUT_EVENT_POINTER_AXIS: + { + // nothing to do + } break; +#else + case LIBINPUT_EVENT_POINTER_AXIS: +#endif { struct libinput_event_pointer *evp = libinput_event_get_pointer_event(ev); @@ -764,7 +806,7 @@ d2tk_frontend_get_base(d2tk_frontend_t *fbdev) } D2TK_API float -d2tk_frontend_get_scale() +d2tk_frontend_get_scale(void) { return 1.f; } diff --git a/src/frontend_glfw.c b/src/frontend_glfw.c index ab56c08..f738bc1 100644 --- a/src/frontend_glfw.c +++ b/src/frontend_glfw.c @@ -136,7 +136,7 @@ d2tk_frontend_free(d2tk_frontend_t *dglfw) } D2TK_API float -d2tk_frontend_get_scale() +d2tk_frontend_get_scale(void) { #if 0 float xscale; diff --git a/src/frontend_pugl.c b/src/frontend_pugl.c index 01e93cc..f697cb6 100644 --- a/src/frontend_pugl.c +++ b/src/frontend_pugl.c @@ -534,7 +534,7 @@ d2tk_frontend_free(d2tk_frontend_t *dpugl) } D2TK_API float -d2tk_frontend_get_scale() +d2tk_frontend_get_scale(void) { const char *D2TK_SCALE = getenv("D2TK_SCALE"); const float scale = D2TK_SCALE ? atof(D2TK_SCALE) : 1.f; diff --git a/src/util_spawn.c b/src/util_spawn.c index 2146c62..2094dab 100644 --- a/src/util_spawn.c +++ b/src/util_spawn.c @@ -22,7 +22,7 @@ struct _clone_data_t { char **argv; }; -static int +static inline __attribute__((always_inline)) int _clone(void *data) { clone_data_t *clone_data = data; diff --git a/test/base.c b/test/base.c index c76a7f3..d3ac667 100644 --- a/test/base.c +++ b/test/base.c @@ -50,7 +50,7 @@ _expose_hot(d2tk_base_t *base, const d2tk_rect_t *rect, unsigned n, unsigned p) } static void -_test_hot() +_test_hot(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -165,7 +165,7 @@ _expose_mouse_fwd_focus(d2tk_base_t *base, const d2tk_rect_t *rect, unsigned n, } static void -_test_mouse_fwd_focus() +_test_mouse_fwd_focus(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -293,7 +293,7 @@ _expose_mouse_bwd_focus(d2tk_base_t *base, const d2tk_rect_t *rect, unsigned n, } static void -_test_mouse_bwd_focus() +_test_mouse_bwd_focus(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -410,7 +410,7 @@ _expose_key_fwd_focus(d2tk_base_t *base, const d2tk_rect_t *rect, unsigned n, } static void -_test_key_fwd_focus() +_test_key_fwd_focus(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -516,7 +516,7 @@ _expose_key_bwd_focus(d2tk_base_t *base, const d2tk_rect_t *rect, unsigned n, } static void -_test_key_bwd_focus() +_test_key_bwd_focus(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -568,7 +568,7 @@ _test_key_bwd_focus() #undef N static void -_test_get_set() +_test_get_set(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -811,7 +811,7 @@ _test_get_set() } static void -_test_state_dump() +_test_state_dump(void) { assert(strcmp(d2tk_state_dump(D2TK_STATE_NONE), "................") == 0); @@ -848,7 +848,7 @@ _test_state_dump() } static void -_test_table_rel() +_test_table_rel(void) { #define N 12 #define M 8 @@ -881,7 +881,7 @@ _test_table_rel() } static void -_test_table_rel_empty() +_test_table_rel_empty(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -914,7 +914,7 @@ _test_table_rel_empty() } static void -_test_table_abs() +_test_table_abs(void) { #define N 12 #define M 8 @@ -947,7 +947,7 @@ _test_table_abs() } static void -_test_table_abs_empty() +_test_table_abs_empty(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -982,7 +982,7 @@ _test_table_abs_empty() } static void -_test_frame_with_label() +_test_frame_with_label(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -1007,7 +1007,7 @@ _test_frame_with_label() } static void -_test_frame_wo_label() +_test_frame_wo_label(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -1032,7 +1032,7 @@ _test_frame_wo_label() } static void -_test_layout_relative_x() +_test_layout_relative_x(void) { #define N 4 d2tk_mock_ctx_t ctx = { @@ -1062,7 +1062,7 @@ _test_layout_relative_x() } static void -_test_layout_relative_zero_x() +_test_layout_relative_zero_x(void) { #define N 4 d2tk_mock_ctx_t ctx = { @@ -1092,7 +1092,7 @@ _test_layout_relative_zero_x() } static void -_test_layout_relative_all_x() +_test_layout_relative_all_x(void) { #define N 4 d2tk_mock_ctx_t ctx = { @@ -1122,7 +1122,7 @@ _test_layout_relative_all_x() } static void -_test_layout_relative_y() +_test_layout_relative_y(void) { #define N 4 d2tk_mock_ctx_t ctx = { @@ -1152,7 +1152,7 @@ _test_layout_relative_y() } static void -_test_layout_relative_zero_y() +_test_layout_relative_zero_y(void) { #define N 4 d2tk_mock_ctx_t ctx = { @@ -1182,7 +1182,7 @@ _test_layout_relative_zero_y() } static void -_test_layout_relative_all_y() +_test_layout_relative_all_y(void) { #define N 4 d2tk_mock_ctx_t ctx = { @@ -1212,7 +1212,7 @@ _test_layout_relative_all_y() } static void -_test_layout_absolute_x() +_test_layout_absolute_x(void) { #define N 4 d2tk_mock_ctx_t ctx = { @@ -1242,7 +1242,7 @@ _test_layout_absolute_x() } static void -_test_layout_absolute_y() +_test_layout_absolute_y(void) { #define N 4 d2tk_mock_ctx_t ctx = { @@ -1272,7 +1272,7 @@ _test_layout_absolute_y() } static void -_test_clip() +_test_clip(void) { { const int32_t imin = 2; @@ -1376,7 +1376,7 @@ _test_clip() } static void -_test_state() +_test_state(void) { assert(d2tk_state_is_down(D2TK_STATE_DOWN)); assert(!d2tk_state_is_down(D2TK_STATE_NONE)); @@ -1431,7 +1431,7 @@ _test_state() } static void -_test_hit() +_test_hit(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -1470,7 +1470,7 @@ _test_hit() } static void -_test_default_style() +_test_default_style(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -1503,7 +1503,7 @@ _test_default_style() } static void -_test_scrollbar_x() +_test_scrollbar_x(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -1535,7 +1535,7 @@ _test_scrollbar_x() } static void -_test_scrollbar_y() +_test_scrollbar_y(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -1567,7 +1567,7 @@ _test_scrollbar_y() } static void -_test_pane_x() +_test_pane_x(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -1608,7 +1608,7 @@ _test_pane_x() } static void -_test_pane_y() +_test_pane_y(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -1649,7 +1649,7 @@ _test_pane_y() } static void -_test_cursor() +_test_cursor(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -1665,7 +1665,7 @@ _test_cursor() } static void -_test_button_label_image() +_test_button_label_image(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -1684,7 +1684,7 @@ _test_button_label_image() } static void -_test_button_label() +_test_button_label(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -1703,7 +1703,7 @@ _test_button_label() } static void -_test_button_image() +_test_button_image(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -1722,7 +1722,7 @@ _test_button_image() } static void -_test_button() +_test_button(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -1740,7 +1740,7 @@ _test_button() } static void -_test_toggle_label() +_test_toggle_label(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -1761,7 +1761,7 @@ _test_toggle_label() } static void -_test_toggle() +_test_toggle(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -1783,7 +1783,7 @@ _test_toggle() } static void -_test_image() +_test_image(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -1799,7 +1799,7 @@ _test_image() } static void -_test_bitmap() +_test_bitmap(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -1836,7 +1836,7 @@ _custom(void *ctx, const d2tk_rect_t *rect, const void *data) } static void -_test_custom() +_test_custom(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -1854,7 +1854,7 @@ _test_custom() } static void -_test_meter() +_test_meter(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -1873,7 +1873,7 @@ _test_meter() } static void -_test_meter_down() +_test_meter_down(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -1894,7 +1894,7 @@ _test_meter_down() } static void -_test_combo() +_test_combo(void) { #define nitms 4 d2tk_mock_ctx_t ctx = { @@ -1920,7 +1920,7 @@ _test_combo() } static void -_test_combo_scroll_up() +_test_combo_scroll_up(void) { #define nitms 4 d2tk_mock_ctx_t ctx = { @@ -1948,7 +1948,7 @@ _test_combo_scroll_up() } static void -_test_combo_scroll_right() +_test_combo_scroll_right(void) { #define nitms 4 d2tk_mock_ctx_t ctx = { @@ -1976,7 +1976,7 @@ _test_combo_scroll_right() } static void -_test_combo_scroll_down() +_test_combo_scroll_down(void) { #define nitms 4 d2tk_mock_ctx_t ctx = { @@ -2004,7 +2004,7 @@ _test_combo_scroll_down() } static void -_test_combo_scroll_left() +_test_combo_scroll_left(void) { #define nitms 4 d2tk_mock_ctx_t ctx = { @@ -2032,7 +2032,7 @@ _test_combo_scroll_left() } static void -_test_combo_mouse_down_dec() +_test_combo_mouse_down_dec(void) { #define nitms 4 d2tk_mock_ctx_t ctx = { @@ -2062,7 +2062,7 @@ _test_combo_mouse_down_dec() } static void -_test_combo_mouse_down_inc() +_test_combo_mouse_down_inc(void) { #define nitms 4 d2tk_mock_ctx_t ctx = { @@ -2092,7 +2092,7 @@ _test_combo_mouse_down_inc() } static void -_test_combo_mouse_down_equ() +_test_combo_mouse_down_equ(void) { #define nitms 4 d2tk_mock_ctx_t ctx = { @@ -2121,7 +2121,7 @@ _test_combo_mouse_down_equ() } static void -_test_text_field() +_test_text_field(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -2148,7 +2148,7 @@ _test_text_field() } static void -_test_label() +_test_label(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -2167,7 +2167,7 @@ _test_label() } static void -_test_label_null() +_test_label_null(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -2186,7 +2186,7 @@ _test_label_null() } static void -_test_label_filled() +_test_label_filled(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -2209,7 +2209,7 @@ _test_label_filled() } static void -_test_link() +_test_link(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -2239,7 +2239,7 @@ _test_link() } static void -_test_link_down() +_test_link_down(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -2262,7 +2262,7 @@ _test_link_down() } static void -_test_dial_bool() +_test_dial_bool(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -2284,7 +2284,7 @@ _test_dial_bool() } static void -_test_dial_int32() +_test_dial_int32(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -2306,7 +2306,7 @@ _test_dial_int32() } static void -_test_dial_int64() +_test_dial_int64(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -2328,7 +2328,7 @@ _test_dial_int64() } static void -_test_dial_float() +_test_dial_float(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -2350,7 +2350,7 @@ _test_dial_float() } static void -_test_dial_double() +_test_dial_double(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -2372,7 +2372,7 @@ _test_dial_double() } static void -_test_prop_int32() +_test_prop_int32(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -2394,7 +2394,7 @@ _test_prop_int32() } static void -_test_prop_float() +_test_prop_float(void) { d2tk_mock_ctx_t ctx = { .check = NULL @@ -2416,7 +2416,7 @@ _test_prop_float() } static void -_test_flowmatrix() +_test_flowmatrix(void) { #define N 4 d2tk_mock_ctx_t ctx = { diff --git a/test/core.c b/test/core.c index efa54e5..cfce6e2 100644 --- a/test/core.c +++ b/test/core.c @@ -13,7 +13,7 @@ #include "mock.h" static void -_test_hash() +_test_hash(void) { const uint32_t bar = 12; const char *foo = "barbarbarbar"; @@ -25,7 +25,7 @@ _test_hash() } static void -_test_hash_foreach() +_test_hash_foreach(void) { const uint32_t bar = 12; const char *foo = "foofoofoofoo"; @@ -46,7 +46,7 @@ _test_hash_foreach() } static void -_test_rect_shrink() +_test_rect_shrink(void) { d2tk_rect_t dst; @@ -83,7 +83,7 @@ _test_rect_shrink() } static void -_test_point() +_test_point(void) { // initialization const d2tk_point_t src = D2TK_POINT(11, 22); @@ -92,7 +92,7 @@ _test_point() } static void -_test_dimensions() +_test_dimensions(void) { d2tk_coord_t w; d2tk_coord_t h; @@ -120,7 +120,7 @@ _test_dimensions() #define BG_COLOR 0x222222ff static void -_test_bg_color() +_test_bg_color(void) { d2tk_core_t *core = d2tk_core_new(&d2tk_mock_driver, NULL); assert(core); @@ -155,7 +155,7 @@ _check_move_to(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_move_to() +_test_move_to(void) { d2tk_mock_ctx_t ctx = { .check = _check_move_to @@ -209,7 +209,7 @@ _check_line_to(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_line_to() +_test_line_to(void) { d2tk_mock_ctx_t ctx = { .check = _check_line_to @@ -259,7 +259,7 @@ _check_rect(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_rect() +_test_rect(void) { d2tk_mock_ctx_t ctx = { .check = _check_rect @@ -313,7 +313,7 @@ _check_rounded_rect(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_rounded_rect() +_test_rounded_rect(void) { d2tk_mock_ctx_t ctx = { .check = _check_rounded_rect @@ -372,7 +372,7 @@ _check_arc(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_arc() +_test_arc(void) { d2tk_mock_ctx_t ctx = { .check = _check_arc @@ -430,7 +430,7 @@ _check_curve_to(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_curve_to() +_test_curve_to(void) { d2tk_mock_ctx_t ctx = { .check = _check_curve_to @@ -479,7 +479,7 @@ _check_color(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_color() +_test_color(void) { d2tk_mock_ctx_t ctx = { .check = _check_color @@ -532,7 +532,7 @@ _check_linear_gradient(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_linear_gradient() +_test_linear_gradient(void) { d2tk_mock_ctx_t ctx = { .check = _check_linear_gradient @@ -585,7 +585,7 @@ _check_stroke(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_stroke() +_test_stroke(void) { d2tk_mock_ctx_t ctx = { .check = _check_stroke @@ -623,7 +623,7 @@ _check_fill(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_fill() +_test_fill(void) { d2tk_mock_ctx_t ctx = { .check = _check_fill @@ -661,7 +661,7 @@ _check_save(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_save() +_test_save(void) { d2tk_mock_ctx_t ctx = { .check = _check_save @@ -699,7 +699,7 @@ _check_restore(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_restore() +_test_restore(void) { d2tk_mock_ctx_t ctx = { .check = _check_restore @@ -740,7 +740,7 @@ _check_rotate(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_rotate() +_test_rotate(void) { d2tk_mock_ctx_t ctx = { .check = _check_rotate @@ -780,7 +780,7 @@ _check_begin_path(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_begin_path() +_test_begin_path(void) { d2tk_mock_ctx_t ctx = { .check = _check_begin_path @@ -818,7 +818,7 @@ _check_close_path(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_close_path() +_test_close_path(void) { d2tk_mock_ctx_t ctx = { .check = _check_close_path @@ -865,7 +865,7 @@ _check_scissor(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_scissor() +_test_scissor(void) { d2tk_mock_ctx_t ctx = { .check = _check_scissor @@ -908,7 +908,7 @@ _check_reset_scissor(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_reset_scissor() +_test_reset_scissor(void) { d2tk_mock_ctx_t ctx = { .check = _check_reset_scissor @@ -949,7 +949,7 @@ _check_font_size(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_font_size() +_test_font_size(void) { d2tk_mock_ctx_t ctx = { .check = _check_font_size @@ -992,7 +992,7 @@ _check_font_face(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_font_face() +_test_font_face(void) { d2tk_mock_ctx_t ctx = { .check = _check_font_face @@ -1045,7 +1045,7 @@ _check_text(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_text() +_test_text(void) { d2tk_mock_ctx_t ctx = { .check = _check_text @@ -1104,7 +1104,7 @@ _check_image(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_image() +_test_image(void) { d2tk_mock_ctx_t ctx = { .check = _check_image @@ -1178,7 +1178,7 @@ _check_bitmap(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_bitmap() +_test_bitmap(void) { d2tk_mock_ctx_t ctx = { .check = _check_bitmap @@ -1269,7 +1269,7 @@ _check_custom(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_custom() +_test_custom(void) { d2tk_mock_ctx_t ctx = { .check = _check_custom @@ -1320,7 +1320,7 @@ _check_stroke_width(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_stroke_width() +_test_stroke_width(void) { d2tk_mock_ctx_t ctx = { .check = _check_stroke_width @@ -1359,7 +1359,7 @@ _check_triple(const d2tk_com_t *com, const d2tk_clip_t *clip) } static void -_test_triple() +_test_triple(void) { d2tk_mock_ctx_t ctx = { .check = _check_triple -- 2.38.5