Author: Armin Rigo <[email protected]>
Branch:
Changeset: r1114:372ff4956b15
Date: 2013-01-06 10:27 +0100
http://bitbucket.org/cffi/cffi/changeset/372ff4956b15/
Log: Document intptr_t
diff --git a/doc/source/index.rst b/doc/source/index.rst
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -721,6 +721,12 @@
>>> int(x)
42
+To cast a pointer to an int, cast it to ``intptr_t``, which is defined
+by C to be a large enough integer type::
+
+ >>> int(ffi.cast("intptr_t", pointer_cdata))
+ 135812708
+
The initializer given as the optional second argument to ``ffi.new()``
can be mostly anything that you would use as an initializer for C code,
with lists or tuples instead of using the C syntax ``{ .., .., .. }``.
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit