[Python-checkins] cpython: Fix a compiler warning in posix_sendfile() on FreeBSD:

victor.stinner python-checkins at python.org
Sun Jul 7 16:36:08 CEST 2013


http://hg.python.org/cpython/rev/adafc38852c4
changeset:   84492:adafc38852c4
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Sun Jul 07 16:32:36 2013 +0200
summary:
  Fix a compiler warning in posix_sendfile() on FreeBSD:

Modules/posixmodule.c: In function 'posix_sendfile':
Modules/posixmodule.c:7700: warning: ISO C90 forbids mixed declarations and code

files:
  Modules/posixmodule.c |  5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)


diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -7695,12 +7695,13 @@
     off_t sbytes;
     struct sf_hdtr sf;
     int flags = 0;
-    sf.headers = NULL;
-    sf.trailers = NULL;
     static char *keywords[] = {"out", "in",
                                 "offset", "count",
                                 "headers", "trailers", "flags", NULL};
 
+    sf.headers = NULL;
+    sf.trailers = NULL;
+
 #ifdef __APPLE__
     if (!PyArg_ParseTupleAndKeywords(args, kwdict, "iiO&O&|OOi:sendfile",
         keywords, &out, &in, _parse_off_t, &offset, _parse_off_t, &sbytes,

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list