Cython has moved to github.

pyrex

view Tests/10/Reference/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 39259a22b0e7
children d726c327e53c
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; char *s;} __Pyx_InternTabEntry; /*proto*/
33 typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
35 static PyObject *__pyx_m;
36 static PyObject *__pyx_b;
37 static int __pyx_lineno;
38 static char *__pyx_filename;
39 static char **__pyx_f;
41 static void __Pyx_AddTraceback(char *funcname); /*proto*/
43 /* Declarations from inplace_ops */
45 static int __pyx_f_11inplace_ops_f(void); /*proto*/
48 static __Pyx_StringTabEntry __pyx_string_tab[] = {
49 {0, 0, 0, 0}
50 };
52 /* Implementation of inplace_ops */
54 static int __pyx_f_11inplace_ops_f(void) {
55 PyObject *__pyx_v_a;
56 PyObject *__pyx_v_b;
57 int __pyx_r;
58 PyObject *__pyx_1 = 0;
59 __pyx_v_a = Py_None; Py_INCREF(Py_None);
60 __pyx_v_b = Py_None; Py_INCREF(Py_None);
62 /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_ops.pyx":3 */
63 __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;}
64 Py_DECREF(__pyx_v_a);
65 __pyx_v_a = __pyx_1;
67 /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_ops.pyx":4 */
68 __pyx_1 = PyNumber_InPlaceSubtract(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; goto __pyx_L1;}
69 Py_DECREF(__pyx_v_a);
70 __pyx_v_a = __pyx_1;
72 /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_ops.pyx":5 */
73 __pyx_1 = PyNumber_InPlaceMultiply(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}
74 Py_DECREF(__pyx_v_a);
75 __pyx_v_a = __pyx_1;
77 /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_ops.pyx":6 */
78 __pyx_1 = PyNumber_InPlaceDivide(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;}
79 Py_DECREF(__pyx_v_a);
80 __pyx_v_a = __pyx_1;
82 /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_ops.pyx":7 */
83 __pyx_1 = PyNumber_InPlaceRemainder(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; goto __pyx_L1;}
84 Py_DECREF(__pyx_v_a);
85 __pyx_v_a = __pyx_1;
87 /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_ops.pyx":8 */
88 __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;}
89 Py_DECREF(__pyx_v_a);
90 __pyx_v_a = __pyx_1;
92 /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_ops.pyx":9 */
93 __pyx_1 = PyNumber_InPlaceLshift(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; goto __pyx_L1;}
94 Py_DECREF(__pyx_v_a);
95 __pyx_v_a = __pyx_1;
97 /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_ops.pyx":10 */
98 __pyx_1 = PyNumber_InPlaceRshift(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; goto __pyx_L1;}
99 Py_DECREF(__pyx_v_a);
100 __pyx_v_a = __pyx_1;
102 /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_ops.pyx":11 */
103 __pyx_1 = PyNumber_InPlaceAnd(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; goto __pyx_L1;}
104 Py_DECREF(__pyx_v_a);
105 __pyx_v_a = __pyx_1;
107 /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_ops.pyx":12 */
108 __pyx_1 = PyNumber_InPlaceXor(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; goto __pyx_L1;}
109 Py_DECREF(__pyx_v_a);
110 __pyx_v_a = __pyx_1;
112 /* "/Local/Projects/D/Pyrex/Source/Tests/10/inplace_ops.pyx":13 */
113 __pyx_1 = PyNumber_InPlaceOr(__pyx_v_a, __pyx_v_b); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;}
114 Py_DECREF(__pyx_v_a);
115 __pyx_v_a = __pyx_1;
117 __pyx_r = 0;
118 goto __pyx_L0;
119 __pyx_L1:;
120 Py_XDECREF(__pyx_1);
121 __Pyx_AddTraceback("inplace_ops.f");
122 __pyx_r = (-1);
123 __pyx_L0:;
124 Py_DECREF(__pyx_v_a);
125 Py_DECREF(__pyx_v_b);
126 return __pyx_r;
127 }
129 static struct PyMethodDef __pyx_methods[] = {
130 {0, 0, 0, 0}
131 };
133 static void __pyx_init_filenames(void); /*proto*/
135 PyMODINIT_FUNC initinplace_ops(void); /*proto*/
136 PyMODINIT_FUNC initinplace_ops(void) {
137 __pyx_init_filenames();
138 __pyx_m = Py_InitModule4("inplace_ops", __pyx_methods, 0, 0, PYTHON_API_VERSION);
139 if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
140 Py_INCREF(__pyx_m);
141 __pyx_b = PyImport_AddModule("__builtin__");
142 if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
143 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
144 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
145 return;
146 __pyx_L1:;
147 __Pyx_AddTraceback("inplace_ops");
148 }
150 static char *__pyx_filenames[] = {
151 "inplace_ops.pyx",
152 };
154 /* Runtime support code */
156 static void __pyx_init_filenames(void) {
157 __pyx_f = __pyx_filenames;
158 }
160 #include "compile.h"
161 #include "frameobject.h"
162 #include "traceback.h"
164 static void __Pyx_AddTraceback(char *funcname) {
165 PyObject *py_srcfile = 0;
166 PyObject *py_funcname = 0;
167 PyObject *py_globals = 0;
168 PyObject *empty_tuple = 0;
169 PyObject *empty_string = 0;
170 PyCodeObject *py_code = 0;
171 PyFrameObject *py_frame = 0;
173 py_srcfile = PyString_FromString(__pyx_filename);
174 if (!py_srcfile) goto bad;
175 py_funcname = PyString_FromString(funcname);
176 if (!py_funcname) goto bad;
177 py_globals = PyModule_GetDict(__pyx_m);
178 if (!py_globals) goto bad;
179 empty_tuple = PyTuple_New(0);
180 if (!empty_tuple) goto bad;
181 empty_string = PyString_FromString("");
182 if (!empty_string) goto bad;
183 py_code = PyCode_New(
184 0, /*int argcount,*/
185 0, /*int nlocals,*/
186 0, /*int stacksize,*/
187 0, /*int flags,*/
188 empty_string, /*PyObject *code,*/
189 empty_tuple, /*PyObject *consts,*/
190 empty_tuple, /*PyObject *names,*/
191 empty_tuple, /*PyObject *varnames,*/
192 empty_tuple, /*PyObject *freevars,*/
193 empty_tuple, /*PyObject *cellvars,*/
194 py_srcfile, /*PyObject *filename,*/
195 py_funcname, /*PyObject *name,*/
196 __pyx_lineno, /*int firstlineno,*/
197 empty_string /*PyObject *lnotab*/
198 );
199 if (!py_code) goto bad;
200 py_frame = PyFrame_New(
201 PyThreadState_Get(), /*PyThreadState *tstate,*/
202 py_code, /*PyCodeObject *code,*/
203 py_globals, /*PyObject *globals,*/
204 0 /*PyObject *locals*/
205 );
206 if (!py_frame) goto bad;
207 py_frame->f_lineno = __pyx_lineno;
208 PyTraceBack_Here(py_frame);
209 bad:
210 Py_XDECREF(py_srcfile);
211 Py_XDECREF(py_funcname);
212 Py_XDECREF(empty_tuple);
213 Py_XDECREF(empty_string);
214 Py_XDECREF(py_code);
215 Py_XDECREF(py_frame);
216 }