]> granicus.if.org Git - python/commitdiff
Silenced compiler warnings.
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 8 Oct 2016 06:58:08 +0000 (09:58 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Sat, 8 Oct 2016 06:58:08 +0000 (09:58 +0300)
Modules/getpath.c
Modules/socketmodule.c
Objects/codeobject.c
Parser/pgen.c

index b23915900041a33c8d82890c66b4f921a6808755..18b161cfee98fcdd7ab9c0f37ee7a929c224f65c 100644 (file)
@@ -329,11 +329,9 @@ search_for_exec_prefix(char *argv0_path, char *home)
        n = fread(rel_builddir_path, 1, MAXPATHLEN, f);
        rel_builddir_path[n] = '\0';
        fclose(f);
-       if (n >= 0) {
-         strcpy(exec_prefix, argv0_path);
-         joinpath(exec_prefix, rel_builddir_path);
-         return -1;
-       }
+       strcpy(exec_prefix, argv0_path);
+       joinpath(exec_prefix, rel_builddir_path);
+       return -1;
       }
     }
 
index c046178fb4b5180163d9330dbd691cb55cf88ff9..75e07c1dc894375573ca04d8645e8bb64ff58edd 100644 (file)
@@ -3472,7 +3472,7 @@ socket_gethostbyname_ex(PyObject *self, PyObject *args)
     int buf_len = (sizeof buf) - 1;
     int errnop;
 #endif
-#if defined(HAVE_GETHOSTBYNAME_R_3_ARG) || defined(HAVE_GETHOSTBYNAME_R_6_ARG)
+#ifdef HAVE_GETHOSTBYNAME_R_3_ARG
     int result;
 #endif
 #endif /* HAVE_GETHOSTBYNAME_R */
@@ -3484,7 +3484,7 @@ socket_gethostbyname_ex(PyObject *self, PyObject *args)
     Py_BEGIN_ALLOW_THREADS
 #ifdef HAVE_GETHOSTBYNAME_R
 #if   defined(HAVE_GETHOSTBYNAME_R_6_ARG)
-    result = gethostbyname_r(name, &hp_allocated, buf, buf_len,
+    gethostbyname_r(name, &hp_allocated, buf, buf_len,
                              &h, &errnop);
 #elif defined(HAVE_GETHOSTBYNAME_R_5_ARG)
     h = gethostbyname_r(name, &hp_allocated, buf, buf_len, &errnop);
@@ -3548,7 +3548,7 @@ socket_gethostbyaddr(PyObject *self, PyObject *args)
     int buf_len = (sizeof buf) - 1;
     int errnop;
 #endif
-#if defined(HAVE_GETHOSTBYNAME_R_3_ARG) || defined(HAVE_GETHOSTBYNAME_R_6_ARG)
+#ifdef HAVE_GETHOSTBYNAME_R_3_ARG
     int result;
 #endif
 #endif /* HAVE_GETHOSTBYNAME_R */
@@ -3581,7 +3581,7 @@ socket_gethostbyaddr(PyObject *self, PyObject *args)
     Py_BEGIN_ALLOW_THREADS
 #ifdef HAVE_GETHOSTBYNAME_R
 #if   defined(HAVE_GETHOSTBYNAME_R_6_ARG)
-    result = gethostbyaddr_r(ap, al, af,
+    gethostbyaddr_r(ap, al, af,
         &hp_allocated, buf, buf_len,
         &h, &errnop);
 #elif defined(HAVE_GETHOSTBYNAME_R_5_ARG)
index b7c4059976e62290af3efaf6d5a345caff422261..79ac1b5340fbf338039fda7b16b43ad50bded205 100644 (file)
@@ -95,7 +95,6 @@ PyCode_New(int argcount, int nlocals, int stacksize, int flags,
            PyObject *lnotab)
 {
     PyCodeObject *co;
-    Py_ssize_t i;
     /* Check argument types */
     if (argcount < 0 || nlocals < 0 ||
         code == NULL ||
index b2f84709fc42c6cf7fa0800d459b1f0393ba9632..f3031aea0b6d141d884827614b77ff6b3d28d665 100644 (file)
@@ -136,11 +136,12 @@ addnfa(nfagrammar *gr, char *name)
 
 static char REQNFMT[] = "metacompile: less than %d children\n";
 
-#define REQN(i, count) \
+#define REQN(i, count) do { \
     if (i < count) { \
         fprintf(stderr, REQNFMT, count); \
         Py_FatalError("REQN"); \
-    } else
+    } \
+} while (0)
 
 #else
 #define REQN(i, count)  /* empty */