[Cython] PATCH: removing strcmp() in favor of custom impl or other fixes
Lisandro Dalcin
dalcinl at gmail.com
Sat Mar 7 20:03:51 CET 2009
Here you have the patch... Implemented as an (inline) function in a
utility code that anyway is alwas emited (as it is INLINE, the GCC
does not warn). Two things worth to point out:
* The API import function uses a different thing, just a while loop. I
do not want to complicate things in generated API headers for
something that can be done with two auxiliar variables and a one-line
while loop.
* In the keyword handling code, I've used _PyString_Eq(), which is
available in the C-API for Py2. If Python's C-API provides what we
need, let's use it. Moreover, just in case, please see the
implementation of _PyString_Eq(), it is smarter (and likely faster)
than a strcmp() call ;-).
--
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
-------------- next part --------------
A non-text attachment was scrubbed...
Name: STRCMP.diff
Type: application/octet-stream
Size: 5971 bytes
Desc: not available
Url : http://codespeak.net/pipermail/cython-dev/attachments/20090307/74e3eac6/attachment.obj
More information about the Cython-dev
mailing list