Cython has moved to github.

pyrex

view Tests/7/cforfromloop.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 int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
42 static void __Pyx_AddTraceback(char *funcname); /*proto*/
44 /* Declarations from cforfromloop */
47 /* Declarations from implementation of cforfromloop */
49 static int __pyx_v_12cforfromloop_i;
50 static int __pyx_v_12cforfromloop_j;
51 static int __pyx_v_12cforfromloop_k;
52 static PyObject *__pyx_v_12cforfromloop_a;
53 static PyObject *__pyx_v_12cforfromloop_b;
54 static PyObject *__pyx_v_12cforfromloop_x;
59 static __Pyx_StringTabEntry __pyx_string_tab[] = {
60 {0, 0, 0, 0}
61 };
65 /* Implementation of cforfromloop */
67 static struct PyMethodDef __pyx_methods[] = {
68 {0, 0, 0, 0}
69 };
71 static void __pyx_init_filenames(void); /*proto*/
73 PyMODINIT_FUNC initcforfromloop(void); /*proto*/
74 PyMODINIT_FUNC initcforfromloop(void) {
75 long __pyx_1;
76 PyObject *__pyx_2 = 0;
77 long __pyx_3;
78 int __pyx_4;
79 __pyx_init_filenames();
80 __pyx_m = Py_InitModule4("cforfromloop", __pyx_methods, 0, 0, PYTHON_API_VERSION);
81 if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
82 Py_INCREF(__pyx_m);
83 __pyx_b = PyImport_AddModule("__builtin__");
84 if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
85 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
86 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
87 __pyx_v_12cforfromloop_a = Py_None; Py_INCREF(Py_None);
88 __pyx_v_12cforfromloop_b = Py_None; Py_INCREF(Py_None);
89 __pyx_v_12cforfromloop_x = Py_None; Py_INCREF(Py_None);
91 /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":4 */
92 for (__pyx_v_12cforfromloop_i = 0; __pyx_v_12cforfromloop_i < 10; ++__pyx_v_12cforfromloop_i) {
93 }
95 /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":7 */
96 for (__pyx_v_12cforfromloop_i = 0+1; __pyx_v_12cforfromloop_i <= 10; ++__pyx_v_12cforfromloop_i) {
97 }
99 /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":10 */
100 for (__pyx_v_12cforfromloop_i = 10; __pyx_v_12cforfromloop_i > 0; --__pyx_v_12cforfromloop_i) {
101 }
103 /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":13 */
104 for (__pyx_v_12cforfromloop_i = 10-1; __pyx_v_12cforfromloop_i >= 0; --__pyx_v_12cforfromloop_i) {
105 }
107 /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":16 */
108 for (__pyx_1 = 0; __pyx_1 <= 10; ++__pyx_1) {
109 __pyx_2 = PyInt_FromLong(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
110 Py_DECREF(__pyx_v_12cforfromloop_x);
111 __pyx_v_12cforfromloop_x = __pyx_2;
112 __pyx_2 = 0;
113 }
115 /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":19 */
116 __pyx_1 = PyInt_AsLong(__pyx_v_12cforfromloop_a); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}
117 __pyx_3 = PyInt_AsLong(__pyx_v_12cforfromloop_b); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}
118 for (__pyx_v_12cforfromloop_i = __pyx_1; __pyx_v_12cforfromloop_i <= __pyx_3; ++__pyx_v_12cforfromloop_i) {
119 }
121 /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":22 */
122 for (__pyx_v_12cforfromloop_i = __pyx_v_12cforfromloop_k; __pyx_v_12cforfromloop_i <= __pyx_v_12cforfromloop_j; ++__pyx_v_12cforfromloop_i) {
123 }
125 /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":25 */
126 __pyx_1 = (__pyx_v_12cforfromloop_j / 18);
127 for (__pyx_v_12cforfromloop_i = (__pyx_v_12cforfromloop_k * 42); __pyx_v_12cforfromloop_i <= __pyx_1; ++__pyx_v_12cforfromloop_i) {
128 }
130 /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":28 */
131 while (1) {
132 __pyx_4 = __pyx_v_12cforfromloop_j;
133 if (!__pyx_4) break;
134 for (__pyx_v_12cforfromloop_i = 0; __pyx_v_12cforfromloop_i <= 10; ++__pyx_v_12cforfromloop_i) {
136 /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":30 */
137 goto __pyx_L20;
139 /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":31 */
140 goto __pyx_L21;
141 __pyx_L20:;
142 }
143 /*else*/ {
145 /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":33 */
146 goto __pyx_L18;
148 /* "/Local/Projects/D/Pyrex/Source/Tests/7/cforfromloop.pyx":34 */
149 goto __pyx_L19;
150 }
151 __pyx_L21:;
152 __pyx_L18:;
153 }
154 __pyx_L19:;
155 return;
156 __pyx_L1:;
157 Py_XDECREF(__pyx_2);
158 __Pyx_AddTraceback("cforfromloop");
159 }
161 static char *__pyx_filenames[] = {
162 "cforfromloop.pyx",
163 };
165 /* Runtime support code */
167 static void __pyx_init_filenames(void) {
168 __pyx_f = __pyx_filenames;
169 }
171 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
172 while (t->p) {
173 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
174 if (!*t->p)
175 return -1;
176 if (t->i)
177 PyString_InternInPlace(t->p);
178 ++t;
179 }
180 return 0;
181 }
183 #include "compile.h"
184 #include "frameobject.h"
185 #include "traceback.h"
187 static void __Pyx_AddTraceback(char *funcname) {
188 PyObject *py_srcfile = 0;
189 PyObject *py_funcname = 0;
190 PyObject *py_globals = 0;
191 PyObject *empty_tuple = 0;
192 PyObject *empty_string = 0;
193 PyCodeObject *py_code = 0;
194 PyFrameObject *py_frame = 0;
196 py_srcfile = PyString_FromString(__pyx_filename);
197 if (!py_srcfile) goto bad;
198 py_funcname = PyString_FromString(funcname);
199 if (!py_funcname) goto bad;
200 py_globals = PyModule_GetDict(__pyx_m);
201 if (!py_globals) goto bad;
202 empty_tuple = PyTuple_New(0);
203 if (!empty_tuple) goto bad;
204 empty_string = PyString_FromString("");
205 if (!empty_string) goto bad;
206 py_code = PyCode_New(
207 0, /*int argcount,*/
208 0, /*int nlocals,*/
209 0, /*int stacksize,*/
210 0, /*int flags,*/
211 empty_string, /*PyObject *code,*/
212 empty_tuple, /*PyObject *consts,*/
213 empty_tuple, /*PyObject *names,*/
214 empty_tuple, /*PyObject *varnames,*/
215 empty_tuple, /*PyObject *freevars,*/
216 empty_tuple, /*PyObject *cellvars,*/
217 py_srcfile, /*PyObject *filename,*/
218 py_funcname, /*PyObject *name,*/
219 __pyx_lineno, /*int firstlineno,*/
220 empty_string /*PyObject *lnotab*/
221 );
222 if (!py_code) goto bad;
223 py_frame = PyFrame_New(
224 PyThreadState_Get(), /*PyThreadState *tstate,*/
225 py_code, /*PyCodeObject *code,*/
226 py_globals, /*PyObject *globals,*/
227 0 /*PyObject *locals*/
228 );
229 if (!py_frame) goto bad;
230 py_frame->f_lineno = __pyx_lineno;
231 PyTraceBack_Here(py_frame);
232 bad:
233 Py_XDECREF(py_srcfile);
234 Py_XDECREF(py_funcname);
235 Py_XDECREF(empty_tuple);
236 Py_XDECREF(empty_string);
237 Py_XDECREF(py_code);
238 Py_XDECREF(py_frame);
239 }