Cython has moved to github.
pyrex
view Tests/3/cascadedass.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 PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
42 static void __Pyx_WriteUnraisable(char *name); /*proto*/
44 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
46 static void __Pyx_AddTraceback(char *funcname); /*proto*/
48 /* Declarations from cascadedass */
51 /* Declarations from implementation of cascadedass */
53 static void __pyx_f_11cascadedass_foo(void); /*proto*/
55 static char __pyx_k1[] = "x";
56 static char __pyx_k2[] = "y";
57 static char __pyx_k3[] = "z";
59 static PyObject *__pyx_n_x;
60 static PyObject *__pyx_n_y;
61 static PyObject *__pyx_n_z;
64 static __Pyx_StringTabEntry __pyx_string_tab[] = {
65 {&__pyx_n_x, 1, __pyx_k1, sizeof(__pyx_k1)},
66 {&__pyx_n_y, 1, __pyx_k2, sizeof(__pyx_k2)},
67 {&__pyx_n_z, 1, __pyx_k3, sizeof(__pyx_k3)},
68 {0, 0, 0, 0}
69 };
73 /* Implementation of cascadedass */
75 static void __pyx_f_11cascadedass_foo(void) {
76 int __pyx_v_i;
77 int __pyx_v_j;
78 int __pyx_v_k;
79 PyObject *__pyx_v_a;
80 PyObject *__pyx_v_b;
81 PyObject *__pyx_v_d;
82 PyObject *__pyx_v_e;
83 PyObject *__pyx_v_c;
84 PyObject *__pyx_v_f;
85 int __pyx_1;
86 PyObject *__pyx_2 = 0;
87 PyObject *__pyx_3 = 0;
88 PyObject *__pyx_4 = 0;
89 __pyx_v_a = Py_None; Py_INCREF(Py_None);
90 __pyx_v_b = Py_None; Py_INCREF(Py_None);
91 __pyx_v_d = Py_None; Py_INCREF(Py_None);
92 __pyx_v_e = Py_None; Py_INCREF(Py_None);
93 __pyx_v_c = Py_None; Py_INCREF(Py_None);
94 __pyx_v_f = Py_None; Py_INCREF(Py_None);
96 /* "/Local/Projects/D/Pyrex/Source/Tests/3/cascadedass.pyx":3 */
97 __pyx_v_i = __pyx_v_k;
98 __pyx_v_j = __pyx_v_k;
100 /* "/Local/Projects/D/Pyrex/Source/Tests/3/cascadedass.pyx":4 */
101 Py_INCREF(__pyx_v_c);
102 Py_DECREF(__pyx_v_a);
103 __pyx_v_a = __pyx_v_c;
104 Py_INCREF(__pyx_v_c);
105 Py_DECREF(__pyx_v_b);
106 __pyx_v_b = __pyx_v_c;
108 /* "/Local/Projects/D/Pyrex/Source/Tests/3/cascadedass.pyx":5 */
109 __pyx_1 = PyInt_AsLong(__pyx_v_c); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}
110 __pyx_v_i = __pyx_1;
111 __pyx_1 = PyInt_AsLong(__pyx_v_c); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}
112 __pyx_v_j = __pyx_1;
114 /* "/Local/Projects/D/Pyrex/Source/Tests/3/cascadedass.pyx":6 */
115 __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;}
116 Py_DECREF(__pyx_v_a);
117 __pyx_v_a = __pyx_2;
118 __pyx_2 = 0;
119 __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;}
120 Py_DECREF(__pyx_v_b);
121 __pyx_v_b = __pyx_2;
122 __pyx_2 = 0;
124 /* "/Local/Projects/D/Pyrex/Source/Tests/3/cascadedass.pyx":7 */
125 __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_x); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; goto __pyx_L1;}
126 __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_y); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; goto __pyx_L1;}
127 __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_z); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; goto __pyx_L1;}
128 Py_INCREF(__pyx_2);
129 Py_DECREF(__pyx_v_a);
130 __pyx_v_a = __pyx_2;
131 Py_INCREF(__pyx_2);
132 Py_DECREF(__pyx_v_d);
133 __pyx_v_d = __pyx_2;
134 Py_DECREF(__pyx_2); __pyx_2 = 0;
135 Py_INCREF(__pyx_3);
136 Py_DECREF(__pyx_v_b);
137 __pyx_v_b = __pyx_3;
138 Py_INCREF(__pyx_3);
139 Py_DECREF(__pyx_v_e);
140 __pyx_v_e = __pyx_3;
141 Py_DECREF(__pyx_3); __pyx_3 = 0;
142 Py_INCREF(__pyx_4);
143 Py_DECREF(__pyx_v_c);
144 __pyx_v_c = __pyx_4;
145 Py_INCREF(__pyx_4);
146 Py_DECREF(__pyx_v_f);
147 __pyx_v_f = __pyx_4;
148 Py_DECREF(__pyx_4); __pyx_4 = 0;
150 goto __pyx_L0;
151 __pyx_L1:;
152 Py_XDECREF(__pyx_2);
153 Py_XDECREF(__pyx_3);
154 Py_XDECREF(__pyx_4);
155 __Pyx_WriteUnraisable("cascadedass.foo");
156 __pyx_L0:;
157 Py_DECREF(__pyx_v_a);
158 Py_DECREF(__pyx_v_b);
159 Py_DECREF(__pyx_v_d);
160 Py_DECREF(__pyx_v_e);
161 Py_DECREF(__pyx_v_c);
162 Py_DECREF(__pyx_v_f);
163 }
165 static struct PyMethodDef __pyx_methods[] = {
166 {0, 0, 0, 0}
167 };
169 static void __pyx_init_filenames(void); /*proto*/
171 PyMODINIT_FUNC initcascadedass(void); /*proto*/
172 PyMODINIT_FUNC initcascadedass(void) {
173 __pyx_init_filenames();
174 __pyx_m = Py_InitModule4("cascadedass", __pyx_methods, 0, 0, PYTHON_API_VERSION);
175 if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
176 Py_INCREF(__pyx_m);
177 __pyx_b = PyImport_AddModule("__builtin__");
178 if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
179 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
180 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
181 return;
182 __pyx_L1:;
183 __Pyx_AddTraceback("cascadedass");
184 }
186 static char *__pyx_filenames[] = {
187 "cascadedass.pyx",
188 };
190 /* Runtime support code */
192 static void __pyx_init_filenames(void) {
193 __pyx_f = __pyx_filenames;
194 }
196 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
197 PyObject *result;
198 result = PyObject_GetAttr(dict, name);
199 if (!result)
200 PyErr_SetObject(PyExc_NameError, name);
201 return result;
202 }
204 static void __Pyx_WriteUnraisable(char *name) {
205 PyObject *old_exc, *old_val, *old_tb;
206 PyObject *ctx;
207 PyErr_Fetch(&old_exc, &old_val, &old_tb);
208 ctx = PyString_FromString(name);
209 PyErr_Restore(old_exc, old_val, old_tb);
210 if (!ctx)
211 ctx = Py_None;
212 PyErr_WriteUnraisable(ctx);
213 }
215 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
216 while (t->p) {
217 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
218 if (!*t->p)
219 return -1;
220 if (t->i)
221 PyString_InternInPlace(t->p);
222 ++t;
223 }
224 return 0;
225 }
227 #include "compile.h"
228 #include "frameobject.h"
229 #include "traceback.h"
231 static void __Pyx_AddTraceback(char *funcname) {
232 PyObject *py_srcfile = 0;
233 PyObject *py_funcname = 0;
234 PyObject *py_globals = 0;
235 PyObject *empty_tuple = 0;
236 PyObject *empty_string = 0;
237 PyCodeObject *py_code = 0;
238 PyFrameObject *py_frame = 0;
240 py_srcfile = PyString_FromString(__pyx_filename);
241 if (!py_srcfile) goto bad;
242 py_funcname = PyString_FromString(funcname);
243 if (!py_funcname) goto bad;
244 py_globals = PyModule_GetDict(__pyx_m);
245 if (!py_globals) goto bad;
246 empty_tuple = PyTuple_New(0);
247 if (!empty_tuple) goto bad;
248 empty_string = PyString_FromString("");
249 if (!empty_string) goto bad;
250 py_code = PyCode_New(
251 0, /*int argcount,*/
252 0, /*int nlocals,*/
253 0, /*int stacksize,*/
254 0, /*int flags,*/
255 empty_string, /*PyObject *code,*/
256 empty_tuple, /*PyObject *consts,*/
257 empty_tuple, /*PyObject *names,*/
258 empty_tuple, /*PyObject *varnames,*/
259 empty_tuple, /*PyObject *freevars,*/
260 empty_tuple, /*PyObject *cellvars,*/
261 py_srcfile, /*PyObject *filename,*/
262 py_funcname, /*PyObject *name,*/
263 __pyx_lineno, /*int firstlineno,*/
264 empty_string /*PyObject *lnotab*/
265 );
266 if (!py_code) goto bad;
267 py_frame = PyFrame_New(
268 PyThreadState_Get(), /*PyThreadState *tstate,*/
269 py_code, /*PyCodeObject *code,*/
270 py_globals, /*PyObject *globals,*/
271 0 /*PyObject *locals*/
272 );
273 if (!py_frame) goto bad;
274 py_frame->f_lineno = __pyx_lineno;
275 PyTraceBack_Here(py_frame);
276 bad:
277 Py_XDECREF(py_srcfile);
278 Py_XDECREF(py_funcname);
279 Py_XDECREF(empty_tuple);
280 Py_XDECREF(empty_string);
281 Py_XDECREF(py_code);
282 Py_XDECREF(py_frame);
283 }
