Cython has moved to github.

pyrex

view Tests/10/inplace_ops.c @ 86:da6e97bb7e6d

Multiple compilation fixed
author Gregory Ewing <greg.ewing@canterbury.ac.nz>
date Sat May 24 15:50:12 2008 +1200 (4 years ago)
parents 12072e0e4fd5
children 152fab7779d2
line source
1 /* Generated by Pyrex */
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #include "structmember.h"
6 #ifndef PY_LONG_LONG
7 #define PY_LONG_LONG LONG_LONG
8 #endif
9 #if PY_VERSION_HEX < 0x02050000
10 typedef int Py_ssize_t;
11 #define PY_SSIZE_T_MAX INT_MAX
12 #define PY_SSIZE_T_MIN INT_MIN
13 #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
14 #define PyInt_AsSsize_t(o) PyInt_AsLong(o)
15 #endif
16 #ifndef WIN32
17 #ifndef __stdcall
18 #define __stdcall
19 #endif
20 #ifndef __cdecl
21 #define __cdecl
22 #endif
23 #endif
24 #ifdef __cplusplus
25 #define __PYX_EXTERN_C extern "C"
26 #else
27 #define __PYX_EXTERN_C extern
28 #endif
29 #include <math.h>
32 typedef struct {PyObject **p; int i; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
34 static PyObject *__pyx_m;
35 static PyObject *__pyx_b;
36 static int __pyx_lineno;
37 static char *__pyx_filename;
38 static char **__pyx_f;
40 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
42 static void __Pyx_AddTraceback(char *funcname); /*proto*/
44 /* Declarations from inplace_ops */
47 /* Declarations from implementation of inplace_ops */
49 static int __pyx_f_11inplace_ops_f(void); /*proto*/
54 static __Pyx_StringTabEntry __pyx_string_tab[] = {
55 {0, 0, 0, 0}
56 };
60 /* Implementation of inplace_ops */
62 static int __pyx_f_11inplace_ops_f(void) {
63 PyObject *__pyx_v_a;
64 PyObject *__pyx_v_b;
65 int __pyx_r;
66 PyObject *__pyx_1 = 0;
67 __pyx_v_a = Py_None; Py_INCREF(Py_None);
68 __pyx_v_b = Py_None; Py_INCREF(Py_None);
70 /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_ops.pyx":3 */
71 __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;}
72 Py_DECREF(__pyx_v_a);
73 __pyx_v_a = __pyx_1;
75 /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_ops.pyx":4 */
76 __pyx_1 = PyNumber_InPlaceSubtract(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;}
77 Py_DECREF(__pyx_v_a);
78 __pyx_v_a = __pyx_1;
80 /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_ops.pyx":5 */
81 __pyx_1 = PyNumber_InPlaceMultiply(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}
82 Py_DECREF(__pyx_v_a);
83 __pyx_v_a = __pyx_1;
85 /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_ops.pyx":6 */
86 __pyx_1 = PyNumber_InPlaceDivide(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;}
87 Py_DECREF(__pyx_v_a);
88 __pyx_v_a = __pyx_1;
90 /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_ops.pyx":7 */
91 __pyx_1 = PyNumber_InPlaceRemainder(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; goto __pyx_L1;}
92 Py_DECREF(__pyx_v_a);
93 __pyx_v_a = __pyx_1;
95 /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_ops.pyx":8 */
96 __pyx_1 = PyNumber_InPlacePower(__pyx_v_a, __pyx_v_b, Py_None); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
97 Py_DECREF(__pyx_v_a);
98 __pyx_v_a = __pyx_1;
100 /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_ops.pyx":9 */
101 __pyx_1 = PyNumber_InPlaceLshift(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; goto __pyx_L1;}
102 Py_DECREF(__pyx_v_a);
103 __pyx_v_a = __pyx_1;
105 /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_ops.pyx":10 */
106 __pyx_1 = PyNumber_InPlaceRshift(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; goto __pyx_L1;}
107 Py_DECREF(__pyx_v_a);
108 __pyx_v_a = __pyx_1;
110 /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_ops.pyx":11 */
111 __pyx_1 = PyNumber_InPlaceAnd(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; goto __pyx_L1;}
112 Py_DECREF(__pyx_v_a);
113 __pyx_v_a = __pyx_1;
115 /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_ops.pyx":12 */
116 __pyx_1 = PyNumber_InPlaceXor(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; goto __pyx_L1;}
117 Py_DECREF(__pyx_v_a);
118 __pyx_v_a = __pyx_1;
120 /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_ops.pyx":13 */
121 __pyx_1 = PyNumber_InPlaceOr(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;}
122 Py_DECREF(__pyx_v_a);
123 __pyx_v_a = __pyx_1;
125 __pyx_r = 0;
126 goto __pyx_L0;
127 __pyx_L1:;
128 Py_XDECREF(__pyx_1);
129 __Pyx_AddTraceback("inplace_ops.f");
130 __pyx_r = (-1);
131 __pyx_L0:;
132 Py_DECREF(__pyx_v_a);
133 Py_DECREF(__pyx_v_b);
134 return __pyx_r;
135 }
137 static struct PyMethodDef __pyx_methods[] = {
138 {0, 0, 0, 0}
139 };
141 static void __pyx_init_filenames(void); /*proto*/
143 PyMODINIT_FUNC initinplace_ops(void); /*proto*/
144 PyMODINIT_FUNC initinplace_ops(void) {
145 __pyx_init_filenames();
146 __pyx_m = Py_InitModule4("inplace_ops", __pyx_methods, 0, 0, PYTHON_API_VERSION);
147 if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
148 Py_INCREF(__pyx_m);
149 __pyx_b = PyImport_AddModule("__builtin__");
150 if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
151 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
152 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
153 return;
154 __pyx_L1:;
155 __Pyx_AddTraceback("inplace_ops");
156 }
158 static char *__pyx_filenames[] = {
159 "inplace_ops.pyx",
160 };
162 /* Runtime support code */
164 static void __pyx_init_filenames(void) {
165 __pyx_f = __pyx_filenames;
166 }
168 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
169 while (t->p) {
170 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
171 if (!*t->p)
172 return -1;
173 if (t->i)
174 PyString_InternInPlace(t->p);
175 ++t;
176 }
177 return 0;
178 }
180 #include "compile.h"
181 #include "frameobject.h"
182 #include "traceback.h"
184 static void __Pyx_AddTraceback(char *funcname) {
185 PyObject *py_srcfile = 0;
186 PyObject *py_funcname = 0;
187 PyObject *py_globals = 0;
188 PyObject *empty_tuple = 0;
189 PyObject *empty_string = 0;
190 PyCodeObject *py_code = 0;
191 PyFrameObject *py_frame = 0;
193 py_srcfile = PyString_FromString(__pyx_filename);
194 if (!py_srcfile) goto bad;
195 py_funcname = PyString_FromString(funcname);
196 if (!py_funcname) goto bad;
197 py_globals = PyModule_GetDict(__pyx_m);
198 if (!py_globals) goto bad;
199 empty_tuple = PyTuple_New(0);
200 if (!empty_tuple) goto bad;
201 empty_string = PyString_FromString("");
202 if (!empty_string) goto bad;
203 py_code = PyCode_New(
204 0, /*int argcount,*/
205 0, /*int nlocals,*/
206 0, /*int stacksize,*/
207 0, /*int flags,*/
208 empty_string, /*PyObject *code,*/
209 empty_tuple, /*PyObject *consts,*/
210 empty_tuple, /*PyObject *names,*/
211 empty_tuple, /*PyObject *varnames,*/
212 empty_tuple, /*PyObject *freevars,*/
213 empty_tuple, /*PyObject *cellvars,*/
214 py_srcfile, /*PyObject *filename,*/
215 py_funcname, /*PyObject *name,*/
216 __pyx_lineno, /*int firstlineno,*/
217 empty_string /*PyObject *lnotab*/
218 );
219 if (!py_code) goto bad;
220 py_frame = PyFrame_New(
221 PyThreadState_Get(), /*PyThreadState *tstate,*/
222 py_code, /*PyCodeObject *code,*/
223 py_globals, /*PyObject *globals,*/
224 0 /*PyObject *locals*/
225 );
226 if (!py_frame) goto bad;
227 py_frame->f_lineno = __pyx_lineno;
228 PyTraceBack_Here(py_frame);
229 bad:
230 Py_XDECREF(py_srcfile);
231 Py_XDECREF(py_funcname);
232 Py_XDECREF(empty_tuple);
233 Py_XDECREF(empty_string);
234 Py_XDECREF(py_code);
235 Py_XDECREF(py_frame);
236 }