Author: Armin Rigo <[email protected]>
Branch:
Changeset: r70094:381eb668a116
Date: 2014-03-19 17:41 +0100
http://bitbucket.org/pypy/pypy/changeset/381eb668a116/
Log: Yet another attempt to fix these C compiler warnings: don't use an
enum at all, just declare the type as 'int'.
diff --git a/pypy/module/cpyext/include/pystate.h
b/pypy/module/cpyext/include/pystate.h
--- a/pypy/module/cpyext/include/pystate.h
+++ b/pypy/module/cpyext/include/pystate.h
@@ -21,9 +21,8 @@
#define Py_END_ALLOW_THREADS PyEval_RestoreThread(_save); \
}
-typedef
- enum {PyGILState_LOCKED, PyGILState_UNLOCKED}
- PyGILState_STATE;
+enum {PyGILState_LOCKED, PyGILState_UNLOCKED};
+typedef int PyGILState_STATE;
#define PyThreadState_GET() PyThreadState_Get()
diff --git a/pypy/module/cpyext/pystate.py b/pypy/module/cpyext/pystate.py
--- a/pypy/module/cpyext/pystate.py
+++ b/pypy/module/cpyext/pystate.py
@@ -204,16 +204,14 @@
# Before external call is after running Python
rffi.aroundstate.before()
-PyGILState_STATE = rffi.COpaquePtr('PyGILState_STATE',
- typedef='PyGILState_STATE',
- compilation_info=CConfig._compilation_info_)
+PyGILState_STATE = rffi.INT
@cpython_api([], PyGILState_STATE, error=CANNOT_FAIL)
def PyGILState_Ensure(space):
if rffi.aroundstate.after:
# After external call is before entering Python
rffi.aroundstate.after()
- return lltype.nullptr(PyGILState_STATE.TO)
+ return rffi.cast(PyGILState_STATE, 0)
@cpython_api([PyGILState_STATE], lltype.Void)
def PyGILState_Release(space, state):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit