INN commit: trunk (nnrpd/python.c storage/cnfs/cnfs.c)

INN Commit rra at isc.org
Mon Aug 1 18:35:58 UTC 2011


    Date: Monday, August 1, 2011 @ 11:35:58
  Author: iulius
Revision: 9297

fix unsigned/signed conversions

Modified:
  trunk/nnrpd/python.c
  trunk/storage/cnfs/cnfs.c

---------------------+
 nnrpd/python.c      |   10 ++++++----
 storage/cnfs/cnfs.c |    2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)

Modified: nnrpd/python.c
===================================================================
--- nnrpd/python.c	2011-07-31 13:22:47 UTC (rev 9296)
+++ nnrpd/python.c	2011-08-01 18:35:58 UTC (rev 9297)
@@ -26,7 +26,7 @@
 /*  Python redefines _POSIX_C_SOURCE, so undef it to suppress warnings. */
 #undef _POSIX_C_SOURCE
 
-/*  Make "s#" use Py_ssize_t rather than int. */
+/*  Make "s#" use Py_ssize_t rather than signed size_t. */
 #define PY_SSIZE_T_CLEAN
 
 /*  Python.h must be included after having defined PY_SSIZE_T_CLEAN,
@@ -37,7 +37,7 @@
 
 /*  Define Py_ssize_t when it does not exist (Python < 2.5.0). */
 #if PY_VERSION_HEX < 0x02050000
-  typedef int Py_ssize_t;
+  typedef ssize_t Py_ssize_t;
 #endif
 
 #include "clibrary.h"
@@ -331,12 +331,14 @@
 
     while(PyDict_Next(result, &pos, &key, &value)) {
         if (!PyString_Check(key)) {
-            syslog(L_ERROR, "python access method return dictionary key %d not a string", pos);
+            syslog(L_ERROR, "python access method return dictionary key %lu not a string",
+                   (long int) pos);
             Reply("%d Internal error (2).  Goodbye!\r\n", NNTP_FAIL_TERMINATING);
             ExitWithStats(1, false);
         }
         if (!PyString_Check(value)) {
-            syslog(L_ERROR, "python access method return dictionary value %d not a string", pos);
+            syslog(L_ERROR, "python access method return dictionary value %lu not a string",
+                   (long int) pos);
             Reply("%d Internal error (2).  Goodbye!\r\n", NNTP_FAIL_TERMINATING);
             ExitWithStats(1, false);
         }

Modified: storage/cnfs/cnfs.c
===================================================================
--- storage/cnfs/cnfs.c	2011-07-31 13:22:47 UTC (rev 9296)
+++ storage/cnfs/cnfs.c	2011-08-01 18:35:58 UTC (rev 9297)
@@ -1741,7 +1741,7 @@
 	}
     }
     if (innconf->cnfscheckfudgesize != 0 && innconf->maxartsize != 0 &&
-	(ntohl(cah.size) > innconf->maxartsize + innconf->cnfscheckfudgesize)) {
+	((unsigned int) ntohl(cah.size) > innconf->maxartsize + innconf->cnfscheckfudgesize)) {
 	art->data = NULL;
 	art->len = 0;
 	art->token = NULL;




More information about the inn-committers mailing list