Revision: 1272
          http://geeqie.svn.sourceforge.net/geeqie/?rev=1272&view=rev
Author:   zas_
Date:     2008-11-25 17:01:03 +0000 (Tue, 25 Nov 2008)

Log Message:
-----------
Fix up unsigned expression always true/false warnings.

Modified Paths:
--------------
    trunk/src/filefilter.c
    trunk/src/image-overlay.c
    trunk/src/info.c
    trunk/src/layout.c
    trunk/src/print.c

Modified: trunk/src/filefilter.c
===================================================================
--- trunk/src/filefilter.c      2008-11-23 22:05:27 UTC (rev 1271)
+++ trunk/src/filefilter.c      2008-11-25 17:01:03 UTC (rev 1272)
@@ -304,7 +304,7 @@
                        ext = filter_to_list(fe->extensions);
                        if (ext) extension_list = g_list_concat(extension_list, 
ext);
 
-                       if (fe->file_class >= 0 && fe->file_class < 
FILE_FORMAT_CLASSES)
+                       if (fe->file_class < FILE_FORMAT_CLASSES)
                                {
                                ext = filter_to_list(fe->extensions);
                                if (ext) 
file_class_extension_list[fe->file_class] = 
g_list_concat(file_class_extension_list[fe->file_class], ext);
@@ -347,7 +347,7 @@
        GList *work;
        guint ln;
 
-       if (file_class < 0 || file_class >= FILE_FORMAT_CLASSES)
+       if (file_class >= FILE_FORMAT_CLASSES)
                {
                log_printf("WARNING: invalid file class %d\n", file_class);
                return FALSE;

Modified: trunk/src/image-overlay.c
===================================================================
--- trunk/src/image-overlay.c   2008-11-23 22:05:27 UTC (rev 1271)
+++ trunk/src/image-overlay.c   2008-11-25 17:01:03 UTC (rev 1272)
@@ -1079,7 +1079,7 @@
 
        if (!osd) return;
 
-       if (flag < IMAGE_OSD_NONE || flag >= IMAGE_OSD_COUNT) return;
+       if (flag >= IMAGE_OSD_COUNT) return;
        if (duration < 0) duration = IMAGE_OSD_DEFAULT_DURATION;
        if (duration > 1) duration += 1;
 

Modified: trunk/src/info.c
===================================================================
--- trunk/src/info.c    2008-11-23 22:05:27 UTC (rev 1271)
+++ trunk/src/info.c    2008-11-25 17:01:03 UTC (rev 1272)
@@ -527,7 +527,7 @@
                        {
                        if (t->func == info_tab_new_funcs[i])
                                {
-                               g_assert(t->pos >= 0 && t->pos < 
G_N_ELEMENTS(info_tab_new_funcs));
+                               g_assert(t->pos < 
G_N_ELEMENTS(info_tab_new_funcs));
                                str[t->pos] = i + '1';
                                }
                        }

Modified: trunk/src/layout.c
===================================================================
--- trunk/src/layout.c  2008-11-23 22:05:27 UTC (rev 1271)
+++ trunk/src/layout.c  2008-11-25 17:01:03 UTC (rev 1272)
@@ -1922,8 +1922,10 @@
 
        layout_config_parse(options->layout.style, options->layout.order,
                            &lw->dir_location,  &lw->file_location, 
&lw->image_location);
-       lw->dir_view_type = CLAMP(options->layout.dir_view_type, 0, 
VIEW_DIR_TYPES_COUNT - 1);
-       lw->file_view_type = CLAMP(options->layout.file_view_type, 0, 
VIEW_FILE_TYPES_COUNT - 1);
+       lw->dir_view_type = options->layout.dir_view_type;
+    if (lw->dir_view_type >= VIEW_DIR_TYPES_COUNT) lw->dir_view_type = 0;
+       lw->file_view_type = options->layout.file_view_type;
+    if (lw->file_view_type >= VIEW_FILE_TYPES_COUNT) lw->file_view_type = 0;
 
        /* divider positions */
 

Modified: trunk/src/print.c
===================================================================
--- trunk/src/print.c   2008-11-23 22:05:27 UTC (rev 1271)
+++ trunk/src/print.c   2008-11-25 17:01:03 UTC (rev 1272)
@@ -332,7 +332,7 @@
 
 static const gchar *print_output_name(PrintOutput output)
 {
-       if (output < 0 || output >= PRINT_OUTPUT_COUNT) return "";
+       if (output >= PRINT_OUTPUT_COUNT) return "";
 
        return _(print_output_text[output]);
 }
@@ -2809,7 +2809,7 @@
 {
        PaperUnits old_units;
 
-       if (units < 0 || units >= PAPER_UNIT_COUNT) return;
+       if (units >= PAPER_UNIT_COUNT) return;
 
        old_units = pw->paper_units;
        pw->paper_units = units;


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geeqie-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-svn

Reply via email to