diff --git a/source/helper.c b/source/helper.c index d85fc14d..5de0c82f 100644 --- a/source/helper.c +++ b/source/helper.c @@ -1092,12 +1092,13 @@ char *helper_get_theme_path(const char *file, const char *ext) { } } - const gchar * const * system_data_dirs = g_get_system_data_dirs (); - if ( system_data_dirs ) { - for ( uint_fast32_t i = 0; system_data_dirs[i] != NULL; i++ ){ - const char * const datadir = system_data_dirs[i]; - g_debug("Opening theme directory: %s", datadir ); - char *theme_path = g_build_filename(datadir, "rofi", "themes", filename, NULL); + const gchar *const *system_data_dirs = g_get_system_data_dirs(); + if (system_data_dirs) { + for (uint_fast32_t i = 0; system_data_dirs[i] != NULL; i++) { + const char *const sdatadir = system_data_dirs[i]; + g_debug("Opening theme directory: %s", sdatadir); + char *theme_path = + g_build_filename(sdatadir, "rofi", "themes", filename, NULL); if (theme_path) { g_debug("Opening theme, testing: %s", theme_path); if (g_file_test(theme_path, G_FILE_TEST_EXISTS)) { diff --git a/source/modes/dmenu.c b/source/modes/dmenu.c index 39dd48af..7e83edd7 100644 --- a/source/modes/dmenu.c +++ b/source/modes/dmenu.c @@ -60,13 +60,14 @@ static cairo_surface_t *dmenu_get_icon(const Mode *sw, unsigned int selected_line, int height); static char *dmenu_get_message(const Mode *sw); -static inline unsigned int bitget(uint32_t *array, unsigned int index) { +static inline unsigned int bitget(uint32_t const *const array, + unsigned int index) { uint32_t bit = index % 32; uint32_t val = array[index / 32]; return (val >> bit) & 1; } -static inline void bittoggle(uint32_t *array, unsigned int index) { +static inline void bittoggle(uint32_t *const array, unsigned int index) { uint32_t bit = index % 32; uint32_t *v = &array[index / 32]; *v ^= 1 << bit; @@ -215,7 +216,7 @@ static gboolean dmenu_async_read_proc(gint fd, GIOCondition condition, } static void read_input_sync(DmenuModePrivateData *pd, unsigned int pre_read) { - size_t nread = 0; + ssize_t nread = 0; size_t len = 0; char *line = NULL; while (pre_read > 0 && diff --git a/source/modes/window.c b/source/modes/window.c index 2d001418..e1cbd189 100644 --- a/source/modes/window.c +++ b/source/modes/window.c @@ -932,7 +932,7 @@ static cairo_user_data_key_t data_key; * \param data The image's data in ARGB format, will be copied by this function. */ static cairo_surface_t *draw_surface_from_data(int width, int height, - uint32_t *data) { + uint32_t const *const data) { unsigned long int len = width * height; unsigned long int i; uint32_t *buffer = g_new0(uint32_t, len);