From 27ecafc2a2bf80e429ab0eb2c7e0a07022dc82a8 Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Sun, 21 Aug 2022 12:56:39 +0100 Subject: [PATCH] Move over tinywm as the base boilerplate --- .pre-commit-config.yaml | 2 +- src/compositor.c | 8 ++++---- src/feynman.c | 17 ++++++++++------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 304454c..109ff6e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: hooks: - id: clang-format - id: cppcheck - args: ['--project=compile_commands.json'] + args: ['--project=compile_commands.json', '--std=c99', '--inline-suppr'] - repo: https://github.com/detailyang/pre-commit-shell rev: 1.0.5 hooks: diff --git a/src/compositor.c b/src/compositor.c index 0ccc94b..245fac7 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -27,6 +27,7 @@ #include static void +/* cppcheck-suppress constParameter */ focus_view (struct feynman_view *view, struct wlr_surface *surface) { /* Note: this function only deals with keyboard focus. */ @@ -288,7 +289,7 @@ desktop_view_at (struct feynman_server *server, double lx, double ly, { node = node->parent; } - // cppcheck-suppress nullPointerRedundantCheck + /* cppcheck-suppress nullPointerRedundantCheck */ return node->data; } @@ -853,7 +854,7 @@ start_feynman (emacs_env *env, struct feynman_server *server) wl_list_init (&server->keyboards); server->new_input.notify = server_new_input; wl_signal_add (&server->backend->events.new_input, &server->new_input); - server->seat = wlr_seat_create (server->wl_display, "seat0"); + server->seat = wlr_seat_create (server->wl_display, "seat0"); server->request_cursor.notify = seat_request_cursor; wl_signal_add (&server->seat->events.request_set_cursor, &server->request_cursor); @@ -887,8 +888,7 @@ start_feynman (emacs_env *env, struct feynman_server *server) * compositor. Starting the backend rigged up all of the necessary event * loop configuration to listen to libinput events, DRM events, generate * frame events at the refresh rate, and so on. */ - em_message (env, "Running Wayland compositor on WAYLAND_DISPLAY=%s", - socket); + em_message (env, "Running Wayland compositor on WAYLAND_DISPLAY=%s", socket); wlr_log (WLR_INFO, "Running Wayland compositor on WAYLAND_DISPLAY=%s", socket); diff --git a/src/feynman.c b/src/feynman.c index 4e78937..83dee3e 100644 --- a/src/feynman.c +++ b/src/feynman.c @@ -26,7 +26,7 @@ /* Declare mandatory GPL symbol. */ FEYNMAN_EXPORT int plugin_is_GPL_compatible = 0; -//static queue_t *feynman_events_q; +// static queue_t *feynman_events_q; // This value will hold a global reference to a `feynman_server` struct emacs_value server_state; @@ -53,14 +53,16 @@ feynman_start (emacs_env *env, ptrdiff_t nargs, emacs_value args[], void *data) (void)nargs; (void)args; (void)data; - emacs_value nil = env->intern (env, "nil"); + emacs_value nil = env->intern (env, "nil"); struct feynman_server *server = malloc (sizeof (struct feynman_server)); - int err = start_feynman(env, server); - if (err != 0) { - em_error(env, "Start process failed.Received none zero error code: %d", err); - return nil; - } + int err = start_feynman (env, server); + if (err != 0) + { + em_error (env, "Start process failed.Received none zero error code: %d", + err); + return nil; + } // feynman_events_q = (queue_t *)init_queue(100); /* pthread_create (&server->server_thread_id, NULL, start_event_loop, */ @@ -72,6 +74,7 @@ feynman_start (emacs_env *env, ptrdiff_t nargs, emacs_value args[], void *data) } static emacs_value +/* cppcheck-suppress constParameter */ feynman_stop (emacs_env *env, ptrdiff_t nargs, emacs_value args[], void *data) { (void)nargs;