Cython has moved to github.

pyrex

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