changeset 43:e2020fcc4c51

Warning cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 24 Sep 2011 20:02:06 +0300
parents c10b6fd55036
children a862fd9906ec
files atclib/al_lsetpos.c src/editloop.cc src/edwidget.h src/infobar.cc src/menubar.h src/sticker.cc
diffstat 6 files changed, 44 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/atclib/al_lsetpos.c	Sat Sep 24 19:54:01 2011 +0300
+++ b/atclib/al_lsetpos.c	Sat Sep 24 20:02:06 2011 +0300
@@ -39,12 +39,12 @@
    inserted before prev. l->curno is then inconsistant with l->current */
 if (pos->curno > l->total       /* elements were deleted */
                                 /* current was deleted */
- || pos->current != NULL && pos->current->next == AL_AINVALIDPOINTER
+ || (pos->current != NULL && pos->current->next == AL_AINVALIDPOINTER)
                                 /* prev was deleted or an element was
                                    inserted between prev and current
                                    or current was realloc'd */
- || pos->prev != NULL && pos->prev->next != NULL
-                      && pos->prev->next != pos->current)
+ || (pos->prev != NULL && pos->prev->next != NULL
+                      && pos->prev->next != pos->current))
   {
   al_aerrno = AL_AEOL;
   return AL_AEOL;
--- a/src/editloop.cc	Sat Sep 24 19:54:01 2011 +0300
+++ b/src/editloop.cc	Sat Sep 24 20:02:06 2011 +0300
@@ -658,8 +658,7 @@
             int r = (e.modpopup->get())->process_event(&is);
 
             // [Esc] or click outside the popup menu. Close it.
-            if (r == MEN_CANCEL
-                || r == MEN_INVALID && is.key == YE_BUTL_PRESS)
+            if (r == MEN_CANCEL || (r == MEN_INVALID && is.key == YE_BUTL_PRESS))
             {
                 e.modpopup->unset();
                 goto done2;
@@ -706,8 +705,7 @@
             int r = (e.modpopup->get())->process_event(&is);
 
             // [Esc] or click outside the popup menu. Close it.
-            if (r == MEN_CANCEL
-                || r == MEN_INVALID && is.key == YE_BUTL_PRESS)
+            if (r == MEN_CANCEL || (r == MEN_INVALID && is.key == YE_BUTL_PRESS))
             {
                 e.modpopup->unset();
                 goto done2;
@@ -752,8 +750,7 @@
             int r = (e.modpopup->get())->process_event(&is);
 
             // [Esc] or click outside the popup menu. Close it.
-            if (r == MEN_CANCEL
-                || r == MEN_INVALID && is.key == YE_BUTL_PRESS)
+            if (r == MEN_CANCEL || (r == MEN_INVALID && is.key == YE_BUTL_PRESS))
             {
                 e.modpopup->unset();
                 goto done2;
@@ -805,8 +802,7 @@
             int r = (e.modpopup->get())->process_event(&is);
 
             // [Esc] or click outside the popup menu. Close it.
-            if (r == MEN_CANCEL
-                || r == MEN_INVALID && is.key == YE_BUTL_PRESS)
+            if (r == MEN_CANCEL || (r == MEN_INVALID && is.key == YE_BUTL_PRESS))
             {
                 e.modpopup->unset();
                 goto done2;
--- a/src/edwidget.h	Sat Sep 24 19:54:01 2011 +0300
+++ b/src/edwidget.h	Sat Sep 24 20:02:06 2011 +0300
@@ -11,22 +11,23 @@
 
 class edwidget_c
 {
-    public:void const unset();
-    void const draw();                // Draw yourself
-    void const undraw();        // If you're drawn, undraw yourself
-    int const can_undraw();        // Can you undraw yourself ?
-    int const need_to_clear();        // You need to undraw yself but can't ?
-    void const clear();                // Forget you're drawn
-    int const req_width();        // Tell me the width you'd like to have
-    int const req_height();        // Tell me the height you'd like 2 have
-    void const set_x0(int x0);        // This is your top left corner
-    void const set_y0(int y0);
-    void const set_x1(int x1);        // This is your bottom right corner
-    void const set_y1(int y1);
-    int const get_x0();                // Tell me where's your top left corner
-    int const get_y0();
-    int const get_x1();                // Tell me where's your bottom right c.
-    int const get_y1();
+    public:
+    void unset();
+    void draw();                // Draw yourself
+    void undraw();        // If you're drawn, undraw yourself
+    int can_undraw();        // Can you undraw yourself ?
+    int eed_to_clear();        // You need to undraw yself but can't ?
+    void clear();                // Forget you're drawn
+    int req_width();        // Tell me the width you'd like to have
+    int req_height();        // Tell me the height you'd like 2 have
+    void set_x0(int x0);        // This is your top left corner
+    void set_y0(int y0);
+    void set_x1(int x1);        // This is your bottom right corner
+    void set_y1(int y1);
+    int get_x0();                // Tell me where's your top left corner
+    int get_y0();
+    int get_x1();                // Tell me where's your bottom right c.
+    int get_y1();
 };
 
 
--- a/src/infobar.cc	Sat Sep 24 19:54:01 2011 +0300
+++ b/src/infobar.cc	Sat Sep 24 20:02:06 2011 +0300
@@ -85,14 +85,15 @@
         return;
 
     redraw_from_scratch =
-        visible && !visible_disp
+        (visible && !visible_disp)
         || file_name_disp != file_name
         || level_name_disp != level_name
         || obj_type_disp != obj_type
         || changes_disp != changes
         || grid_snap_disp != grid_snap
         || grid_step_locked_disp != grid_step_locked
-        || scale_disp != scale || grid_step_disp != grid_step;
+        || scale_disp != scale
+        || grid_step_disp != grid_step;
 
     if (redraw_from_scratch)
     {
@@ -204,16 +205,14 @@
     x += 6 * FONTW;
 
 // The current pointer coordinates.
-    if ((flags & pointer_disp_set)
-        && !(flags & pointer_set)
+    if (((flags & pointer_disp_set) && !(flags & pointer_set))
         || pointer_x_disp != pointer_x || pointer_y_disp != pointer_y)
     {
         set_colour(WINBG);
         DrawScreenBox(x, text_y0, x + 14 * FONTW - 1, text_y1);
         flags &= ~pointer_disp_set;
     }
-    if ((flags & pointer_set)
-        && !(flags & pointer_disp_set)
+    if (((flags & pointer_set) && !(flags & pointer_disp_set))
         || pointer_x_disp != pointer_x || pointer_y_disp != pointer_y)
     {
         set_colour(WINFG);
--- a/src/menubar.h	Sat Sep 24 19:54:01 2011 +0300
+++ b/src/menubar.h	Sat Sep 24 20:02:06 2011 +0300
@@ -79,9 +79,9 @@
 
     int need_to_clear()
     {
-        return bar_visible_disp && !bar_visible
-            || pulled_down_no_disp && !pulled_down_no
-            || pulled_down_menu_disp != pulled_down_menu;
+        return (bar_visible_disp && !bar_visible)
+            || (pulled_down_no_disp && !pulled_down_no)
+            || (pulled_down_menu_disp != pulled_down_menu);
     }
 
     void clear();
--- a/src/sticker.cc	Sat Sep 24 19:54:01 2011 +0300
+++ b/src/sticker.cc	Sat Sep 24 20:02:06 2011 +0300
@@ -374,10 +374,11 @@
             if (padding == 0)
             {
                 for (image_ptr = img.buf(); image_ptr < image_end; image_ptr++)
-                    *buf_ptr++ = (u32) ((game_colour[*image_ptr] >> 24) |
-                                       ((game_colour[*image_ptr] >> 8) & 0x0000ff00) |
-                                       ((game_colour[*image_ptr] << 8) & 0x00ff0000) |
-                                        (game_colour[*image_ptr] << 24));
+                    *buf_ptr++ = (u32)
+                    ((game_colour[*image_ptr] >> 24) |
+                    ((game_colour[*image_ptr] >> 8) & 0x0000ff00) |
+                    ((game_colour[*image_ptr] << 8) & 0x00ff0000) |
+                     (game_colour[*image_ptr] << 24));
             }
             else
             {
@@ -388,12 +389,11 @@
                 {
                     image_line_end += img_width;
                     for (; image_ptr < image_line_end; image_ptr++)
-                        *buf_ptr++ = (u32) ((game_colour[*image_ptr] >> 24)        // Assume game_colour uns.
-                                            | (game_colour[*image_ptr] >> 8) &
-                                            0x0000ff00 |
-                                            (game_colour[*image_ptr] << 8) &
-                                            0x00ff0000 |
-                                            (game_colour[*image_ptr] << 24));
+                        *buf_ptr++ = (u32)
+                        ((game_colour[*image_ptr] >> 24) |
+                        ((game_colour[*image_ptr] >> 8) & 0x0000ff00) |
+                        ((game_colour[*image_ptr] << 8) & 0x00ff0000) |
+                         (game_colour[*image_ptr] << 24));
                     buf_ptr = (u32 *) ((char *) buf_ptr + padding);        // Line padding
                 }
             }
@@ -410,8 +410,8 @@
     }
     else
     {
-        if (ximage->byte_order == LSBFirst && !x_server_big_endian
-            || ximage->byte_order == MSBFirst && x_server_big_endian)
+        if ((ximage->byte_order == LSBFirst && !x_server_big_endian) ||
+            (ximage->byte_order == MSBFirst && x_server_big_endian))
             ;                        // OK
         else
             warn("image byte_order %d doesn't match X server endianness\n",