Cython has moved to github.
pyrex
view Tests/3/multass.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 | 94d46b3c5354 |
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 void __Pyx_WriteUnraisable(char *name); /*proto*/
42 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
44 static void __Pyx_AddTraceback(char *funcname); /*proto*/
46 /* Declarations from multass */
49 /* Declarations from implementation of multass */
51 static void __pyx_f_7multass_f(void); /*proto*/
56 static __Pyx_StringTabEntry __pyx_string_tab[] = {
57 {0, 0, 0, 0}
58 };
62 /* Implementation of multass */
64 static void __pyx_f_7multass_f(void) {
65 PyObject *__pyx_v_obj1a;
66 PyObject *__pyx_v_obj2a;
67 PyObject *__pyx_v_obj3a;
68 PyObject *__pyx_v_obj1b;
69 PyObject *__pyx_v_obj2b;
70 PyObject *__pyx_v_obj3b;
71 int __pyx_v_int1;
72 int __pyx_v_int2;
73 char *__pyx_v_ptr1;
74 char *__pyx_v_ptr2;
75 PyObject *__pyx_1 = 0;
76 PyObject *__pyx_2 = 0;
77 PyObject *__pyx_3 = 0;
78 int __pyx_4;
79 char *__pyx_5;
80 PyObject *__pyx_6 = 0;
81 __pyx_v_obj1a = Py_None; Py_INCREF(Py_None);
82 __pyx_v_obj2a = Py_None; Py_INCREF(Py_None);
83 __pyx_v_obj3a = Py_None; Py_INCREF(Py_None);
84 __pyx_v_obj1b = Py_None; Py_INCREF(Py_None);
85 __pyx_v_obj2b = Py_None; Py_INCREF(Py_None);
86 __pyx_v_obj3b = Py_None; Py_INCREF(Py_None);
88 /* "/Local/Projects/D/Pyrex/Source/Tests/3/multass.pyx":5 */
89 __pyx_1 = __pyx_v_obj1b;
90 Py_INCREF(__pyx_1);
91 __pyx_2 = __pyx_v_obj2b;
92 Py_INCREF(__pyx_2);
93 Py_DECREF(__pyx_v_obj1a);
94 __pyx_v_obj1a = __pyx_1;
95 __pyx_1 = 0;
96 Py_DECREF(__pyx_v_obj2a);
97 __pyx_v_obj2a = __pyx_2;
98 __pyx_2 = 0;
100 /* "/Local/Projects/D/Pyrex/Source/Tests/3/multass.pyx":6 */
101 __pyx_1 = __pyx_v_obj1b;
102 Py_INCREF(__pyx_1);
103 __pyx_2 = __pyx_v_obj2b;
104 Py_INCREF(__pyx_2);
105 __pyx_3 = __pyx_v_obj3b;
106 Py_INCREF(__pyx_3);
107 Py_DECREF(__pyx_v_obj1a);
108 __pyx_v_obj1a = __pyx_1;
109 __pyx_1 = 0;
110 Py_DECREF(__pyx_v_obj2a);
111 __pyx_v_obj2a = __pyx_2;
112 __pyx_2 = 0;
113 Py_DECREF(__pyx_v_obj3a);
114 __pyx_v_obj3a = __pyx_3;
115 __pyx_3 = 0;
117 /* "/Local/Projects/D/Pyrex/Source/Tests/3/multass.pyx":7 */
118 __pyx_4 = __pyx_v_int2;
119 __pyx_5 = __pyx_v_ptr2;
120 __pyx_1 = __pyx_v_obj1b;
121 Py_INCREF(__pyx_1);
122 __pyx_v_int1 = __pyx_4;
123 __pyx_v_ptr1 = __pyx_5;
124 Py_DECREF(__pyx_v_obj1a);
125 __pyx_v_obj1a = __pyx_1;
126 __pyx_1 = 0;
128 /* "/Local/Projects/D/Pyrex/Source/Tests/3/multass.pyx":8 */
129 __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
130 __pyx_3 = PyNumber_Add(__pyx_v_obj1b, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
131 Py_DECREF(__pyx_2); __pyx_2 = 0;
132 __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
133 __pyx_2 = PyNumber_Add(__pyx_v_obj2b, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
134 Py_DECREF(__pyx_1); __pyx_1 = 0;
135 __pyx_1 = PyInt_FromLong(3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
136 __pyx_6 = PyNumber_Add(__pyx_v_obj3b, __pyx_1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
137 Py_DECREF(__pyx_1); __pyx_1 = 0;
138 Py_DECREF(__pyx_v_obj1a);
139 __pyx_v_obj1a = __pyx_3;
140 __pyx_3 = 0;
141 Py_DECREF(__pyx_v_obj2a);
142 __pyx_v_obj2a = __pyx_2;
143 __pyx_2 = 0;
144 Py_DECREF(__pyx_v_obj3a);
145 __pyx_v_obj3a = __pyx_6;
146 __pyx_6 = 0;
148 goto __pyx_L0;
149 __pyx_L1:;
150 Py_XDECREF(__pyx_1);
151 Py_XDECREF(__pyx_2);
152 Py_XDECREF(__pyx_3);
153 Py_XDECREF(__pyx_6);
154 __Pyx_WriteUnraisable("multass.f");
155 __pyx_L0:;
156 Py_DECREF(__pyx_v_obj1a);
157 Py_DECREF(__pyx_v_obj2a);
158 Py_DECREF(__pyx_v_obj3a);
159 Py_DECREF(__pyx_v_obj1b);
160 Py_DECREF(__pyx_v_obj2b);
161 Py_DECREF(__pyx_v_obj3b);
162 }
164 static struct PyMethodDef __pyx_methods[] = {
165 {0, 0, 0, 0}
166 };
168 static void __pyx_init_filenames(void); /*proto*/
170 PyMODINIT_FUNC initmultass(void); /*proto*/
171 PyMODINIT_FUNC initmultass(void) {
172 __pyx_init_filenames();
173 __pyx_m = Py_InitModule4("multass", __pyx_methods, 0, 0, PYTHON_API_VERSION);
174 if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
175 Py_INCREF(__pyx_m);
176 __pyx_b = PyImport_AddModule("__builtin__");
177 if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
178 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
179 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
180 return;
181 __pyx_L1:;
182 __Pyx_AddTraceback("multass");
183 }
185 static char *__pyx_filenames[] = {
186 "multass.pyx",
187 };
189 /* Runtime support code */
191 static void __pyx_init_filenames(void) {
192 __pyx_f = __pyx_filenames;
193 }
195 static void __Pyx_WriteUnraisable(char *name) {
196 PyObject *old_exc, *old_val, *old_tb;
197 PyObject *ctx;
198 PyErr_Fetch(&old_exc, &old_val, &old_tb);
199 ctx = PyString_FromString(name);
200 PyErr_Restore(old_exc, old_val, old_tb);
201 if (!ctx)
202 ctx = Py_None;
203 PyErr_WriteUnraisable(ctx);
204 }
206 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
207 while (t->p) {
208 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
209 if (!*t->p)
210 return -1;
211 if (t->i)
212 PyString_InternInPlace(t->p);
213 ++t;
214 }
215 return 0;
216 }
218 #include "compile.h"
219 #include "frameobject.h"
220 #include "traceback.h"
222 static void __Pyx_AddTraceback(char *funcname) {
223 PyObject *py_srcfile = 0;
224 PyObject *py_funcname = 0;
225 PyObject *py_globals = 0;
226 PyObject *empty_tuple = 0;
227 PyObject *empty_string = 0;
228 PyCodeObject *py_code = 0;
229 PyFrameObject *py_frame = 0;
231 py_srcfile = PyString_FromString(__pyx_filename);
232 if (!py_srcfile) goto bad;
233 py_funcname = PyString_FromString(funcname);
234 if (!py_funcname) goto bad;
235 py_globals = PyModule_GetDict(__pyx_m);
236 if (!py_globals) goto bad;
237 empty_tuple = PyTuple_New(0);
238 if (!empty_tuple) goto bad;
239 empty_string = PyString_FromString("");
240 if (!empty_string) goto bad;
241 py_code = PyCode_New(
242 0, /*int argcount,*/
243 0, /*int nlocals,*/
244 0, /*int stacksize,*/
245 0, /*int flags,*/
246 empty_string, /*PyObject *code,*/
247 empty_tuple, /*PyObject *consts,*/
248 empty_tuple, /*PyObject *names,*/
249 empty_tuple, /*PyObject *varnames,*/
250 empty_tuple, /*PyObject *freevars,*/
251 empty_tuple, /*PyObject *cellvars,*/
252 py_srcfile, /*PyObject *filename,*/
253 py_funcname, /*PyObject *name,*/
254 __pyx_lineno, /*int firstlineno,*/
255 empty_string /*PyObject *lnotab*/
256 );
257 if (!py_code) goto bad;
258 py_frame = PyFrame_New(
259 PyThreadState_Get(), /*PyThreadState *tstate,*/
260 py_code, /*PyCodeObject *code,*/
261 py_globals, /*PyObject *globals,*/
262 0 /*PyObject *locals*/
263 );
264 if (!py_frame) goto bad;
265 py_frame->f_lineno = __pyx_lineno;
266 PyTraceBack_Here(py_frame);
267 bad:
268 Py_XDECREF(py_srcfile);
269 Py_XDECREF(py_funcname);
270 Py_XDECREF(empty_tuple);
271 Py_XDECREF(empty_string);
272 Py_XDECREF(py_code);
273 Py_XDECREF(py_frame);
274 }
