]> granicus.if.org Git - python/commitdiff
Silenced compiler warning
authorChristian Heimes <christian@cheimes.de>
Fri, 22 Aug 2008 19:47:25 +0000 (19:47 +0000)
committerChristian Heimes <christian@cheimes.de>
Fri, 22 Aug 2008 19:47:25 +0000 (19:47 +0000)
Objects/stringlib/find.h:97: warning: 'stringlib_contains_obj' defined but not used
Reviewed by Benjamin Peterson

Misc/NEWS
Objects/bytearrayobject.c
Objects/stringlib/find.h

index f7a18c0b2c5cc1ddbc795aeff16c58ec0d14de83..0a328bde66c5943be8fa7b121ccf3cab3f568ba6 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -15,6 +15,9 @@ Core and Builtins
 - 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
 -------
 
index 5ba1f6d8e52b1726cc532f82187806fc98146cb5..c4fc37f070e304cc16cfa9be3bc5a952154fdd8a 100644 (file)
@@ -1098,6 +1098,7 @@ bytes_dealloc(PyByteArrayObject *self)
 #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"
index 5b17c7fb0797f35bbe95f2311beaaf283d74b9df..9e0d299845259ce373008c16b50d0406ec3b847f 100644 (file)
@@ -90,7 +90,7 @@ stringlib_rfind_slice(const STRINGLIB_CHAR* str, Py_ssize_t str_len,
     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)