]> code.delx.au - gnu-emacs/commitdiff
[MAC_OS] (xpm_load_image): Add parentheses around
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Wed, 12 Apr 2006 08:05:52 +0000 (08:05 +0000)
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Wed, 12 Apr 2006 08:05:52 +0000 (08:05 +0000)
assignment used as truth value.  Add explicit braces to avoid
ambiguous `else'.
[MAC_OS] (gif_load): Remove unused variable `gcpro1'.

src/image.c

index 6f2e93a591a5e7c05f9a2e5e5a064b92f1c1139c..91aa11987693a0c2af35dff836f976056cbddc99 100644 (file)
@@ -4379,7 +4379,7 @@ xpm_load_image (f, img, contents, end)
          if (color == NULL)
            goto failure;
 
-         while (str = strtok (NULL, " \t"))
+         while ((str = strtok (NULL, " \t")) != NULL)
            {
              next_key = xpm_str_to_color_key (str);
              if (next_key >= 0)
@@ -4407,17 +4407,21 @@ xpm_load_image (f, img, contents, end)
          Lisp_Object specified_color = Fassoc (symbol_color, color_symbols);
 
          if (CONSP (specified_color) && STRINGP (XCDR (specified_color)))
-           if (xstricmp (SDATA (XCDR (specified_color)), "None") == 0)
-             color_val = Qt;
-           else if (x_defined_color (f, SDATA (XCDR (specified_color)),
-                                     &cdef, 0))
-             color_val = make_number (cdef.pixel);
+           {
+             if (xstricmp (SDATA (XCDR (specified_color)), "None") == 0)
+               color_val = Qt;
+             else if (x_defined_color (f, SDATA (XCDR (specified_color)),
+                                       &cdef, 0))
+               color_val = make_number (cdef.pixel);
+           }
        }
       if (NILP (color_val) && max_key > 0)
-       if (xstricmp (max_color, "None") == 0)
-         color_val = Qt;
-       else if (x_defined_color (f, max_color, &cdef, 0))
-         color_val = make_number (cdef.pixel);
+       {
+         if (xstricmp (max_color, "None") == 0)
+           color_val = Qt;
+         else if (x_defined_color (f, max_color, &cdef, 0))
+           color_val = make_number (cdef.pixel);
+       }
       if (!NILP (color_val))
        (*put_color_table) (color_table, beg, chars_per_pixel, color_val);
 
@@ -7846,7 +7850,6 @@ gif_load (f, img)
   int width, height;
   XImagePtr ximg;
   TimeValue time;
-  struct gcpro gcpro1;
   int ino;
   CGrafPtr old_port;
   GDHandle old_gdh;