[Dmenu] use ssize_t instead of size_t.

This commit is contained in:
Dave Davenport 2022-05-17 23:37:02 +02:00
parent c0feb2eb0d
commit e9af427b4a
3 changed files with 12 additions and 10 deletions

View File

@ -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)) {

View File

@ -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 &&

View File

@ -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);