Cython has moved to github.

pyrex

view Tests/3/Reference/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 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 void __Pyx_WriteUnraisable(char *name); /*proto*/
43 static void __Pyx_AddTraceback(char *funcname); /*proto*/
45 /* Declarations from multass */
47 static void __pyx_f_7multass_f(void); /*proto*/
50 static __Pyx_StringTabEntry __pyx_string_tab[] = {
51 {0, 0, 0, 0}
52 };
54 /* Implementation of multass */
56 static void __pyx_f_7multass_f(void) {
57 PyObject *__pyx_v_obj1a;
58 PyObject *__pyx_v_obj2a;
59 PyObject *__pyx_v_obj3a;
60 PyObject *__pyx_v_obj1b;
61 PyObject *__pyx_v_obj2b;
62 PyObject *__pyx_v_obj3b;
63 int __pyx_v_int1;
64 int __pyx_v_int2;
65 char *__pyx_v_ptr1;
66 char *__pyx_v_ptr2;
67 PyObject *__pyx_1 = 0;
68 PyObject *__pyx_2 = 0;
69 PyObject *__pyx_3 = 0;
70 int __pyx_4;
71 char *__pyx_5;
72 PyObject *__pyx_6 = 0;
73 __pyx_v_obj1a = Py_None; Py_INCREF(Py_None);
74 __pyx_v_obj2a = Py_None; Py_INCREF(Py_None);
75 __pyx_v_obj3a = Py_None; Py_INCREF(Py_None);
76 __pyx_v_obj1b = Py_None; Py_INCREF(Py_None);
77 __pyx_v_obj2b = Py_None; Py_INCREF(Py_None);
78 __pyx_v_obj3b = Py_None; Py_INCREF(Py_None);
80 /* "/Local/Projects/D/Pyrex/Source/Tests/3/multass.pyx":5 */
81 __pyx_1 = __pyx_v_obj1b;
82 Py_INCREF(__pyx_1);
83 __pyx_2 = __pyx_v_obj2b;
84 Py_INCREF(__pyx_2);
85 Py_DECREF(__pyx_v_obj1a);
86 __pyx_v_obj1a = __pyx_1;
87 __pyx_1 = 0;
88 Py_DECREF(__pyx_v_obj2a);
89 __pyx_v_obj2a = __pyx_2;
90 __pyx_2 = 0;
92 /* "/Local/Projects/D/Pyrex/Source/Tests/3/multass.pyx":6 */
93 __pyx_1 = __pyx_v_obj1b;
94 Py_INCREF(__pyx_1);
95 __pyx_2 = __pyx_v_obj2b;
96 Py_INCREF(__pyx_2);
97 __pyx_3 = __pyx_v_obj3b;
98 Py_INCREF(__pyx_3);
99 Py_DECREF(__pyx_v_obj1a);
100 __pyx_v_obj1a = __pyx_1;
101 __pyx_1 = 0;
102 Py_DECREF(__pyx_v_obj2a);
103 __pyx_v_obj2a = __pyx_2;
104 __pyx_2 = 0;
105 Py_DECREF(__pyx_v_obj3a);
106 __pyx_v_obj3a = __pyx_3;
107 __pyx_3 = 0;
109 /* "/Local/Projects/D/Pyrex/Source/Tests/3/multass.pyx":7 */
110 __pyx_4 = __pyx_v_int2;
111 __pyx_5 = __pyx_v_ptr2;
112 __pyx_1 = __pyx_v_obj1b;
113 Py_INCREF(__pyx_1);
114 __pyx_v_int1 = __pyx_4;
115 __pyx_v_ptr1 = __pyx_5;
116 Py_DECREF(__pyx_v_obj1a);
117 __pyx_v_obj1a = __pyx_1;
118 __pyx_1 = 0;
120 /* "/Local/Projects/D/Pyrex/Source/Tests/3/multass.pyx":8 */
121 __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
122 __pyx_3 = PyNumber_Add(__pyx_v_obj1b, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
123 Py_DECREF(__pyx_2); __pyx_2 = 0;
124 __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
125 __pyx_2 = PyNumber_Add(__pyx_v_obj2b, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
126 Py_DECREF(__pyx_1); __pyx_1 = 0;
127 __pyx_1 = PyInt_FromLong(3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
128 __pyx_6 = PyNumber_Add(__pyx_v_obj3b, __pyx_1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;}
129 Py_DECREF(__pyx_1); __pyx_1 = 0;
130 Py_DECREF(__pyx_v_obj1a);
131 __pyx_v_obj1a = __pyx_3;
132 __pyx_3 = 0;
133 Py_DECREF(__pyx_v_obj2a);
134 __pyx_v_obj2a = __pyx_2;
135 __pyx_2 = 0;
136 Py_DECREF(__pyx_v_obj3a);
137 __pyx_v_obj3a = __pyx_6;
138 __pyx_6 = 0;
140 goto __pyx_L0;
141 __pyx_L1:;
142 Py_XDECREF(__pyx_1);
143 Py_XDECREF(__pyx_2);
144 Py_XDECREF(__pyx_3);
145 Py_XDECREF(__pyx_6);
146 __Pyx_WriteUnraisable("multass.f");
147 __pyx_L0:;
148 Py_DECREF(__pyx_v_obj1a);
149 Py_DECREF(__pyx_v_obj2a);
150 Py_DECREF(__pyx_v_obj3a);
151 Py_DECREF(__pyx_v_obj1b);
152 Py_DECREF(__pyx_v_obj2b);
153 Py_DECREF(__pyx_v_obj3b);
154 }
156 static struct PyMethodDef __pyx_methods[] = {
157 {0, 0, 0, 0}
158 };
160 static void __pyx_init_filenames(void); /*proto*/
162 PyMODINIT_FUNC initmultass(void); /*proto*/
163 PyMODINIT_FUNC initmultass(void) {
164 __pyx_init_filenames();
165 __pyx_m = Py_InitModule4("multass", __pyx_methods, 0, 0, PYTHON_API_VERSION);
166 if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
167 Py_INCREF(__pyx_m);
168 __pyx_b = PyImport_AddModule("__builtin__");
169 if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
170 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
171 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
172 return;
173 __pyx_L1:;
174 __Pyx_AddTraceback("multass");
175 }
177 static char *__pyx_filenames[] = {
178 "multass.pyx",
179 };
181 /* Runtime support code */
183 static void __pyx_init_filenames(void) {
184 __pyx_f = __pyx_filenames;
185 }
187 static void __Pyx_WriteUnraisable(char *name) {
188 PyObject *old_exc, *old_val, *old_tb;
189 PyObject *ctx;
190 PyErr_Fetch(&old_exc, &old_val, &old_tb);
191 ctx = PyString_FromString(name);
192 PyErr_Restore(old_exc, old_val, old_tb);
193 if (!ctx)
194 ctx = Py_None;
195 PyErr_WriteUnraisable(ctx);
196 }
198 #include "compile.h"
199 #include "frameobject.h"
200 #include "traceback.h"
202 static void __Pyx_AddTraceback(char *funcname) {
203 PyObject *py_srcfile = 0;
204 PyObject *py_funcname = 0;
205 PyObject *py_globals = 0;
206 PyObject *empty_tuple = 0;
207 PyObject *empty_string = 0;
208 PyCodeObject *py_code = 0;
209 PyFrameObject *py_frame = 0;
211 py_srcfile = PyString_FromString(__pyx_filename);
212 if (!py_srcfile) goto bad;
213 py_funcname = PyString_FromString(funcname);
214 if (!py_funcname) goto bad;
215 py_globals = PyModule_GetDict(__pyx_m);
216 if (!py_globals) goto bad;
217 empty_tuple = PyTuple_New(0);
218 if (!empty_tuple) goto bad;
219 empty_string = PyString_FromString("");
220 if (!empty_string) goto bad;
221 py_code = PyCode_New(
222 0, /*int argcount,*/
223 0, /*int nlocals,*/
224 0, /*int stacksize,*/
225 0, /*int flags,*/
226 empty_string, /*PyObject *code,*/
227 empty_tuple, /*PyObject *consts,*/
228 empty_tuple, /*PyObject *names,*/
229 empty_tuple, /*PyObject *varnames,*/
230 empty_tuple, /*PyObject *freevars,*/
231 empty_tuple, /*PyObject *cellvars,*/
232 py_srcfile, /*PyObject *filename,*/
233 py_funcname, /*PyObject *name,*/
234 __pyx_lineno, /*int firstlineno,*/
235 empty_string /*PyObject *lnotab*/
236 );
237 if (!py_code) goto bad;
238 py_frame = PyFrame_New(
239 PyThreadState_Get(), /*PyThreadState *tstate,*/
240 py_code, /*PyCodeObject *code,*/
241 py_globals, /*PyObject *globals,*/
242 0 /*PyObject *locals*/
243 );
244 if (!py_frame) goto bad;
245 py_frame->f_lineno = __pyx_lineno;
246 PyTraceBack_Here(py_frame);
247 bad:
248 Py_XDECREF(py_srcfile);
249 Py_XDECREF(py_funcname);
250 Py_XDECREF(empty_tuple);
251 Py_XDECREF(empty_string);
252 Py_XDECREF(py_code);
253 Py_XDECREF(py_frame);
254 }