From 16d025d04d65074acf284f2c13b30ce680ca2f1b Mon Sep 17 00:00:00 2001
From: Andreas Mohr <and@gmx.li>
Date: Sun, 13 Dec 2015 16:52:24 +0000
Subject: [PATCH] treestore.c cleanup bit fields warnings
treestore.c:89:16: warning: conversion to 'unsigned char:1' from 'int' may alter its value [-Wconversion]
treestore.c:288:42: warning: conversion to 'unsigned char:1' from 'int' may alter its value [-Wconversion]
treestore.c:302:34: warning: conversion to 'unsigned char:1' from 'int' may alter its value [-Wconversion]
what more preferred? using bit fields and saving bytes or using gboolean for FALSE/TRUE state values
Signed-off-by: Andreas Mohr <and@gmx.li>
---
src/filemanager/treestore.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/filemanager/treestore.c b/src/filemanager/treestore.c
index 093c99f..21445e4 100644
a
|
b
|
static tree_entry *tree_store_add_entry (const vfs_path_t * name); |
84 | 84 | /* --------------------------------------------------------------------------------------------- */ |
85 | 85 | |
86 | 86 | static void |
87 | | tree_store_dirty (int state) |
| 87 | tree_store_dirty (unsigned int state) |
88 | 88 | { |
89 | | ts.dirty = state; |
| 89 | ts.dirty = state & (1 << 0); |
90 | 90 | } |
91 | 91 | |
92 | 92 | /* --------------------------------------------------------------------------------------------- */ |
… |
… |
tree_store_load_from (char *name) |
247 | 247 | while (fgets (buffer, MC_MAXPATHLEN, file)) |
248 | 248 | { |
249 | 249 | tree_entry *e; |
250 | | int scanned; |
| 250 | unsigned int scanned; |
251 | 251 | char *lc_name; |
252 | 252 | |
253 | 253 | /* Skip invalid records */ |
… |
… |
tree_store_load_from (char *name) |
285 | 285 | tmp_vpath = vfs_path_from_str (oldname); |
286 | 286 | e = tree_store_add_entry (tmp_vpath); |
287 | 287 | vfs_path_free (tmp_vpath); |
288 | | e->scanned = scanned; |
| 288 | e->scanned = scanned & (1 << 0); |
289 | 289 | } |
290 | 290 | vfs_path_free (vpath); |
291 | 291 | } |
… |
… |
tree_store_load_from (char *name) |
299 | 299 | if (vfs_file_is_local (vpath)) |
300 | 300 | { |
301 | 301 | e = tree_store_add_entry (vpath); |
302 | | e->scanned = scanned; |
| 302 | e->scanned = scanned & (1 << 0); |
303 | 303 | } |
304 | 304 | vfs_path_free (vpath); |
305 | 305 | strcpy (oldname, lc_name); |