[27533] in Source-Commits

home help back first fref pref prev next nref lref last post

python-afs commit: Clarify comments about int size in _util.pxd

daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Thu Nov 14 11:31:02 2013

Date: Thu, 14 Nov 2013 11:30:55 -0500
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201311141630.rAEGUtq5024872@drugstore.mit.edu>
To: source-commits@MIT.EDU

https://github.com/mit-athena/python-afs/commits/c1dbb2ff59d6c3fa4671897be03b0af10c58c5a3
commit c1dbb2ff59d6c3fa4671897be03b0af10c58c5a3
Author: Jonathan Reed <jdreed@mit.edu>
Date:   Thu Nov 14 11:25:59 2013 -0500

    Clarify comments about int size in _util.pxd
    
    Replace misleading comments about int size, and clarify that
    the ctypedefs control conversion between C and Python.

 afs/_util.pxd |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/afs/_util.pxd b/afs/_util.pxd
index 0263443..3d9bcd3 100644
--- a/afs/_util.pxd
+++ b/afs/_util.pxd
@@ -24,8 +24,11 @@ cdef extern from "netinet/in.h":
         in_addr sin_addr
         char sin_zero[8]
 
-# Note that even on 64-bit platforms, Pyrex/Cython's long is 4 bytes,
-# and unsigned long is 8, so this works.
+# Note that these are in an "extern", so the resulting C code will use
+# the actual type definitions in the header file.  The ctypedef here
+# controls C<->Python conversion, ensuring afs_uint32 will turn into a
+# Python long and afs_int32 will turn into a Python int.  This is
+# really only relevant for 32-bit interpreters.
 cdef extern from "afs/stds.h":
     ctypedef unsigned long afs_uint32
     ctypedef long afs_int32

home help back first fref pref prev next nref lref last post