src/image.c, src/w32*.c, lib-src/emacsclient.c: Silence warnings under -Wall.
authorJuanma Barranquero <lekktu@gmail.com>
Thu, 27 Oct 2011 00:59:21 +0000 (02:59 +0200)
committerJuanma Barranquero <lekktu@gmail.com>
Thu, 27 Oct 2011 00:59:21 +0000 (02:59 +0200)
lib-src/ChangeLog
lib-src/emacsclient.c
src/ChangeLog
src/image.c
src/w32.c
src/w32font.c
src/w32reg.c

index 984c4d6..a8f9a0a 100644 (file)
@@ -1,3 +1,7 @@
+2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
+
+       * emacsclient.c (w32_getenv): Silence compiler warnings.
+
 2011-09-07  Glenn Morris  <rgm@gnu.org>
 
        * etags.c (Fortran_functions): Handle "elemental" functions.
index ece9dc6..76aa218 100644 (file)
@@ -359,7 +359,7 @@ w32_getenv (char *envvar)
   char *value;
   DWORD dwType;
 
-  if (value = getenv (envvar))
+  if ((value = getenv (envvar)))
     /* Found in the environment.  strdup it, because values returned
        by getenv cannot be free'd.  */
     return xstrdup (value);
@@ -382,7 +382,7 @@ w32_getenv (char *envvar)
     {
       DWORD size;
 
-      if (size = ExpandEnvironmentStrings (value, NULL, 0))
+      if ((size = ExpandEnvironmentStrings (value, NULL, 0)))
        {
          char *buffer = (char *) xmalloc (size);
          if (ExpandEnvironmentStrings (value, buffer, size))
index b3d8d4d..3caecf3 100644 (file)
@@ -1,3 +1,10 @@
+2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
+
+       * image.c (x_create_x_image_and_pixmap):
+       * w32.c (sys_rename, w32_delayed_load):
+       * w32font.c (fill_in_logfont):
+       * w32reg.c (x_get_string_resource): Silence compiler warnings.
+
 2011-10-26  Juanma Barranquero  <lekktu@gmail.com>
 
        * w32fns.c (w32_default_color_map): New function,
index ef72745..14c74f1 100644 (file)
@@ -2015,7 +2015,7 @@ x_create_x_image_and_pixmap (struct frame *f, int width, int height, int depth,
   /* Bitmaps with a depth less than 16 need a palette.  */
   /* BITMAPINFO structure already contains the first RGBQUAD.  */
   if (depth < 16)
-    palette_colors = 1 << depth - 1;
+    palette_colors = 1 << (depth - 1);
 
   *ximg = xmalloc (sizeof (XImage) + palette_colors * sizeof (RGBQUAD));
 
index 91893dd..42546fc 100644 (file)
--- a/src/w32.c
+++ b/src/w32.c
@@ -2892,12 +2892,12 @@ sys_rename (const char * oldname, const char * newname)
       int    i = 0;
 
       oldname = map_w32_filename (oldname, NULL);
-      if (o = strrchr (oldname, '\\'))
+      if ((o = strrchr (oldname, '\\')))
        o++;
       else
        o = (char *) oldname;
 
-      if (p = strrchr (temp, '\\'))
+      if ((p = strrchr (temp, '\\')))
        p++;
       else
        p = temp;
@@ -5756,7 +5756,7 @@ w32_delayed_load (Lisp_Object libraries, Lisp_Object library_id)
         for (dlls = XCDR (dlls); CONSP (dlls); dlls = XCDR (dlls))
           {
             CHECK_STRING_CAR (dlls);
-            if (library_dll = LoadLibrary (SDATA (XCAR (dlls))))
+            if ((library_dll = LoadLibrary (SDATA (XCAR (dlls)))))
               {
                 found = XCAR (dlls);
                 break;
index 985370c..f47b7a4 100644 (file)
@@ -1916,10 +1916,10 @@ fill_in_logfont (FRAME_PTR f, LOGFONT *logfont, Lisp_Object font_spec)
       int spacing = XINT (tmp);
       if (spacing < FONT_SPACING_MONO)
        logfont->lfPitchAndFamily
-         = logfont->lfPitchAndFamily & 0xF0 | VARIABLE_PITCH;
+         = (logfont->lfPitchAndFamily & 0xF0) | VARIABLE_PITCH;
       else
        logfont->lfPitchAndFamily
-         = logfont->lfPitchAndFamily & 0xF0 | FIXED_PITCH;
+         = (logfont->lfPitchAndFamily & 0xF0) | FIXED_PITCH;
     }
 
   /* Process EXTRA info.  */
index e1465be..1837443 100644 (file)
@@ -147,9 +147,9 @@ x_get_string_resource (XrmDatabase rdb, char *name, char *class)
     {
       char *resource;
 
-      if (resource = w32_get_rdb_resource (rdb, name))
+      if ((resource = w32_get_rdb_resource (rdb, name)))
         return resource;
-      if (resource = w32_get_rdb_resource (rdb, class))
+      if ((resource = w32_get_rdb_resource (rdb, class)))
         return resource;
     }
 
@@ -157,6 +157,5 @@ x_get_string_resource (XrmDatabase rdb, char *name, char *class)
     /* --quick was passed, so this is a no-op.  */
     return NULL;
 
-  return (w32_get_string_resource (name, class, REG_SZ));
+  return w32_get_string_resource (name, class, REG_SZ);
 }
-