Skip to content

Commit

Permalink
Since READ_*() macros are now exported, do not hide
Browse files Browse the repository at this point in the history
the if() continue; statement in them.
Wrap WRITE_STRING() instructions in a safer do {} while (0).
  • Loading branch information
Laurent Monin committed Feb 24, 2009
1 parent 1bef8f7 commit a8df536
Show file tree
Hide file tree
Showing 8 changed files with 168 additions and 168 deletions.
8 changes: 4 additions & 4 deletions src/bar_comment.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,10 @@ GtkWidget *bar_pane_comment_new_from_config(const gchar **attribute_names, const
const gchar *option = *attribute_names++;
const gchar *value = *attribute_values++;

READ_CHAR_FULL("pane.title", title);
READ_CHAR_FULL("key", key);
READ_BOOL_FULL("pane.expanded", expanded);
READ_INT_FULL("height", height);
if (READ_CHAR_FULL("pane.title", title)) continue;
if (READ_CHAR_FULL("key", key)) continue;
if (READ_BOOL_FULL("pane.expanded", expanded)) continue;
if (READ_INT_FULL("height", height)) continue;


DEBUG_1("unknown attribute %s = %s", option, value);
Expand Down
4 changes: 2 additions & 2 deletions src/bar_exif.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,8 @@ GtkWidget *bar_pane_exif_new_from_config(const gchar **attribute_names, const gc
const gchar *option = *attribute_names++;
const gchar *value = *attribute_values++;

READ_CHAR_FULL("pane.title", title);
READ_BOOL_FULL("pane.expanded", expanded);
if (READ_CHAR_FULL("pane.title", title)) continue;
if (READ_BOOL_FULL("pane.expanded", expanded)) continue;


DEBUG_1("unknown attribute %s = %s", option, value);
Expand Down
4 changes: 2 additions & 2 deletions src/bar_histogram.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ GtkWidget *bar_pane_histogram_new_from_config(const gchar **attribute_names, con
const gchar *option = *attribute_names++;
const gchar *value = *attribute_values++;

READ_CHAR_FULL("pane.title", title);
READ_BOOL_FULL("pane.expanded", expanded);
if (READ_CHAR_FULL("pane.title", title)) continue;
if (READ_BOOL_FULL("pane.expanded", expanded)) continue;


DEBUG_1("unknown attribute %s = %s", option, value);
Expand Down
6 changes: 3 additions & 3 deletions src/bar_keywords.c
Original file line number Diff line number Diff line change
Expand Up @@ -838,9 +838,9 @@ GtkWidget *bar_pane_keywords_new_from_config(const gchar **attribute_names, cons
const gchar *option = *attribute_names++;
const gchar *value = *attribute_values++;

READ_CHAR_FULL("pane.title", title);
READ_CHAR_FULL("key", key);
READ_BOOL_FULL("pane.expanded", expanded);
if (READ_CHAR_FULL("pane.title", title)) continue;
if (READ_CHAR_FULL("key", key)) continue;
if (READ_BOOL_FULL("pane.expanded", expanded)) continue;


DEBUG_1("unknown attribute %s = %s", option, value);
Expand Down
14 changes: 7 additions & 7 deletions src/filefilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,13 @@ void filter_load_file_type(const gchar **attribute_names, const gchar **attribut
const gchar *option = *attribute_names++;
const gchar *value = *attribute_values++;

READ_CHAR(fe, key);
READ_BOOL(fe, enabled);
READ_CHAR(fe, extensions);
READ_CHAR(fe, description);
READ_UINT(fe, file_class);
READ_BOOL(fe, writable);
READ_BOOL(fe, allow_sidecar);
if (READ_CHAR(fe, key)) continue;
if (READ_BOOL(fe, enabled)) continue;
if (READ_CHAR(fe, extensions)) continue;
if (READ_CHAR(fe, description)) continue;
if (READ_UINT(fe, file_class)) continue;
if (READ_BOOL(fe, writable)) continue;
if (READ_BOOL(fe, allow_sidecar)) continue;

printf("unknown attribute %s = %s\n", option, value);
}
Expand Down
76 changes: 38 additions & 38 deletions src/layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -2193,52 +2193,52 @@ void layout_load_attributes(LayoutOptions *layout, const gchar **attribute_names

/* layout options */

READ_INT(*layout, style);
READ_CHAR(*layout, order);
if (READ_INT(*layout, style)) continue;
if (READ_CHAR(*layout, order)) continue;

READ_UINT(*layout, dir_view_type);
READ_UINT(*layout, file_view_type);
READ_BOOL(*layout, show_marks);
READ_BOOL(*layout, show_thumbnails);
READ_BOOL(*layout, show_directory_date);
READ_CHAR(*layout, home_path);
if (READ_UINT(*layout, dir_view_type)) continue;
if (READ_UINT(*layout, file_view_type)) continue;
if (READ_BOOL(*layout, show_marks)) continue;
if (READ_BOOL(*layout, show_thumbnails)) continue;
if (READ_BOOL(*layout, show_directory_date)) continue;
if (READ_CHAR(*layout, home_path)) continue;

/* window positions */

READ_BOOL(*layout, save_window_positions);

READ_INT(*layout, main_window.x);
READ_INT(*layout, main_window.y);
READ_INT(*layout, main_window.w);
READ_INT(*layout, main_window.h);
READ_BOOL(*layout, main_window.maximized);
READ_INT(*layout, main_window.hdivider_pos);
READ_INT(*layout, main_window.vdivider_pos);

READ_INT(*layout, float_window.x);
READ_INT(*layout, float_window.y);
READ_INT(*layout, float_window.w);
READ_INT(*layout, float_window.h);
READ_INT(*layout, float_window.vdivider_pos);
if (READ_BOOL(*layout, save_window_positions)) continue;

if (READ_INT(*layout, main_window.x)) continue;
if (READ_INT(*layout, main_window.y)) continue;
if (READ_INT(*layout, main_window.w)) continue;
if (READ_INT(*layout, main_window.h)) continue;
if (READ_BOOL(*layout, main_window.maximized)) continue;
if (READ_INT(*layout, main_window.hdivider_pos)) continue;
if (READ_INT(*layout, main_window.vdivider_pos)) continue;

if (READ_INT(*layout, float_window.x)) continue;
if (READ_INT(*layout, float_window.y)) continue;
if (READ_INT(*layout, float_window.w)) continue;
if (READ_INT(*layout, float_window.h)) continue;
if (READ_INT(*layout, float_window.vdivider_pos)) continue;

READ_INT(*layout, properties_window.w);
READ_INT(*layout, properties_window.h);
if (READ_INT(*layout, properties_window.w)) continue;
if (READ_INT(*layout, properties_window.h)) continue;

READ_BOOL(*layout, tools_float);
READ_BOOL(*layout, tools_hidden);
READ_BOOL(*layout, tools_restore_state);
READ_BOOL(*layout, toolbar_hidden);
if (READ_BOOL(*layout, tools_float)) continue;
if (READ_BOOL(*layout, tools_hidden)) continue;
if (READ_BOOL(*layout, tools_restore_state)) continue;
if (READ_BOOL(*layout, toolbar_hidden)) continue;

/* panels */
READ_BOOL(*layout, panels.exif.enabled);
READ_INT_CLAMP(*layout, panels.exif.width, PANEL_MIN_WIDTH, PANEL_MAX_WIDTH);
READ_BOOL(*layout, panels.info.enabled);
READ_INT_CLAMP(*layout, panels.info.width, PANEL_MIN_WIDTH, PANEL_MAX_WIDTH);
READ_BOOL(*layout, panels.sort.enabled);
READ_INT(*layout, panels.sort.action_state);
READ_INT(*layout, panels.sort.mode_state);
READ_INT(*layout, panels.sort.selection_state);
READ_CHAR(*layout, panels.sort.action_filter);
if (READ_BOOL(*layout, panels.exif.enabled)) continue;
if (READ_INT_CLAMP(*layout, panels.exif.width, PANEL_MIN_WIDTH, PANEL_MAX_WIDTH)) continue;
if (READ_BOOL(*layout, panels.info.enabled)) continue;
if (READ_INT_CLAMP(*layout, panels.info.width, PANEL_MIN_WIDTH, PANEL_MAX_WIDTH)) continue;
if (READ_BOOL(*layout, panels.sort.enabled)) continue;
if (READ_INT(*layout, panels.sort.action_state)) continue;
if (READ_INT(*layout, panels.sort.mode_state)) continue;
if (READ_INT(*layout, panels.sort.selection_state)) continue;
if (READ_CHAR(*layout, panels.sort.action_filter)) continue;


DEBUG_1("unknown attribute %s = %s", option, value);
Expand Down
Loading

0 comments on commit a8df536

Please sign in to comment.