[Python-checkins] r65977 - in python/trunk: Misc/NEWS Objects/bytearrayobject.c Objects/stringlib/find.h

christian.heimes python-checkins at python.org
Fri Aug 22 21:47:25 CEST 2008


Author: christian.heimes
Date: Fri Aug 22 21:47:25 2008
New Revision: 65977

Log:
Silenced compiler warning
Objects/stringlib/find.h:97: warning: 'stringlib_contains_obj' defined but not used
Reviewed by Benjamin Peterson

Modified:
   python/trunk/Misc/NEWS
   python/trunk/Objects/bytearrayobject.c
   python/trunk/Objects/stringlib/find.h

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Fri Aug 22 21:47:25 2008
@@ -15,6 +15,9 @@
 - Issue #3642: Changed type of numarenas from uint to size_t
   in order to silence a compilier warning on 64bit OSes.
 
+- Silenced another compiler warning about a used but not defined
+  function 'stringlib_contains_obj'.
+
 Library
 -------
 

Modified: python/trunk/Objects/bytearrayobject.c
==============================================================================
--- python/trunk/Objects/bytearrayobject.c	(original)
+++ python/trunk/Objects/bytearrayobject.c	Fri Aug 22 21:47:25 2008
@@ -1098,6 +1098,7 @@
 #define STRINGLIB_EMPTY nullbytes
 #define STRINGLIB_CHECK_EXACT PyByteArray_CheckExact
 #define STRINGLIB_MUTABLE 1
+#define FROM_BYTEARRAY 1
 
 #include "stringlib/fastsearch.h"
 #include "stringlib/count.h"

Modified: python/trunk/Objects/stringlib/find.h
==============================================================================
--- python/trunk/Objects/stringlib/find.h	(original)
+++ python/trunk/Objects/stringlib/find.h	Fri Aug 22 21:47:25 2008
@@ -90,7 +90,7 @@
     return stringlib_rfind(str + start, end - start, sub, sub_len, start);
 }
 
-#ifdef STRINGLIB_STR
+#if defined(STRINGLIB_STR) && !defined(FROM_BYTEARRAY)
 
 Py_LOCAL_INLINE(int)
 stringlib_contains_obj(PyObject* str, PyObject* sub)


More information about the Python-checkins mailing list