Cython has moved to github.

pyrex

view Tests/10/Reference/voidstarcast.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 237330d074f9
children 3b20cb4923eb
line source
1 /* Generated by Pyrex 0.9.8 on Fri May 16 21:00:19 2008 */
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 int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
43 static void __Pyx_AddTraceback(char *funcname); /*proto*/
45 /* Declarations from voidstarcast */
47 struct __pyx_obj_12voidstarcast_C {
48 PyObject_HEAD
49 int i;
50 };
53 static PyTypeObject *__pyx_ptype_12voidstarcast_C = 0;
54 static int __pyx_f_12voidstarcast_f(void); /*proto*/
57 static __Pyx_StringTabEntry __pyx_string_tab[] = {
58 {&__pyx_n_foo, 1, __pyx_k1, sizeof(__pyx_k1)},
59 {0, 0, 0, 0}
60 };
62 /* Implementation of voidstarcast */
65 static int __pyx_f_12voidstarcast_f(void) {
66 PyObject *__pyx_v_x;
67 void *__pyx_v_p;
68 int __pyx_v_i;
69 int __pyx_r;
70 PyObject *__pyx_1 = 0;
71 __pyx_v_x = Py_None; Py_INCREF(Py_None);
73 /* "/Local/Projects/D/Pyrex/Source/Tests/10/voidstarcast.pyx":8 */
74 Py_INCREF(((PyObject *)__pyx_v_p));
75 Py_DECREF(__pyx_v_x);
76 __pyx_v_x = ((PyObject *)__pyx_v_p);
78 /* "/Local/Projects/D/Pyrex/Source/Tests/10/voidstarcast.pyx":9 */
79 __pyx_v_p = ((void *)__pyx_v_x);
81 /* "/Local/Projects/D/Pyrex/Source/Tests/10/voidstarcast.pyx":10 */
82 __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_p), __pyx_n_foo); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; goto __pyx_L1;}
83 Py_DECREF(__pyx_v_x);
84 __pyx_v_x = __pyx_1;
85 __pyx_1 = 0;
87 /* "/Local/Projects/D/Pyrex/Source/Tests/10/voidstarcast.pyx":11 */
88 __pyx_v_i = ((struct __pyx_obj_12voidstarcast_C *)__pyx_v_p)->i;
90 /* "/Local/Projects/D/Pyrex/Source/Tests/10/voidstarcast.pyx":12 */
91 ((struct __pyx_obj_12voidstarcast_C *)__pyx_v_p)->i = __pyx_v_i;
93 __pyx_r = 0;
94 goto __pyx_L0;
95 __pyx_L1:;
96 Py_XDECREF(__pyx_1);
97 __Pyx_AddTraceback("voidstarcast.f");
98 __pyx_r = (-1);
99 __pyx_L0:;
100 Py_DECREF(__pyx_v_x);
101 return __pyx_r;
102 }
105 static PyObject *__pyx_tp_new_12voidstarcast_C(PyTypeObject *t, PyObject *a, PyObject *k) {
106 PyObject *o = (*t->tp_alloc)(t, 0);
107 if (!o) return 0;
108 return o;
109 }
111 static void __pyx_tp_dealloc_12voidstarcast_C(PyObject *o) {
112 (*o->ob_type->tp_free)(o);
113 }
115 static struct PyMethodDef __pyx_methods_12voidstarcast_C[] = {
116 {0, 0, 0, 0}
117 };
119 static PyNumberMethods __pyx_tp_as_number_C = {
120 0, /*nb_add*/
121 0, /*nb_subtract*/
122 0, /*nb_multiply*/
123 0, /*nb_divide*/
124 0, /*nb_remainder*/
125 0, /*nb_divmod*/
126 0, /*nb_power*/
127 0, /*nb_negative*/
128 0, /*nb_positive*/
129 0, /*nb_absolute*/
130 0, /*nb_nonzero*/
131 0, /*nb_invert*/
132 0, /*nb_lshift*/
133 0, /*nb_rshift*/
134 0, /*nb_and*/
135 0, /*nb_xor*/
136 0, /*nb_or*/
137 0, /*nb_coerce*/
138 0, /*nb_int*/
139 0, /*nb_long*/
140 0, /*nb_float*/
141 0, /*nb_oct*/
142 0, /*nb_hex*/
143 0, /*nb_inplace_add*/
144 0, /*nb_inplace_subtract*/
145 0, /*nb_inplace_multiply*/
146 0, /*nb_inplace_divide*/
147 0, /*nb_inplace_remainder*/
148 0, /*nb_inplace_power*/
149 0, /*nb_inplace_lshift*/
150 0, /*nb_inplace_rshift*/
151 0, /*nb_inplace_and*/
152 0, /*nb_inplace_xor*/
153 0, /*nb_inplace_or*/
154 0, /*nb_floor_divide*/
155 0, /*nb_true_divide*/
156 0, /*nb_inplace_floor_divide*/
157 0, /*nb_inplace_true_divide*/
158 #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
159 0, /*nb_index*/
160 #endif
161 };
163 static PySequenceMethods __pyx_tp_as_sequence_C = {
164 0, /*sq_length*/
165 0, /*sq_concat*/
166 0, /*sq_repeat*/
167 0, /*sq_item*/
168 0, /*sq_slice*/
169 0, /*sq_ass_item*/
170 0, /*sq_ass_slice*/
171 0, /*sq_contains*/
172 0, /*sq_inplace_concat*/
173 0, /*sq_inplace_repeat*/
174 };
176 static PyMappingMethods __pyx_tp_as_mapping_C = {
177 0, /*mp_length*/
178 0, /*mp_subscript*/
179 0, /*mp_ass_subscript*/
180 };
182 static PyBufferProcs __pyx_tp_as_buffer_C = {
183 0, /*bf_getreadbuffer*/
184 0, /*bf_getwritebuffer*/
185 0, /*bf_getsegcount*/
186 0, /*bf_getcharbuffer*/
187 };
189 PyTypeObject __pyx_type_12voidstarcast_C = {
190 PyObject_HEAD_INIT(0)
191 0, /*ob_size*/
192 "voidstarcast.C", /*tp_name*/
193 sizeof(struct __pyx_obj_12voidstarcast_C), /*tp_basicsize*/
194 0, /*tp_itemsize*/
195 __pyx_tp_dealloc_12voidstarcast_C, /*tp_dealloc*/
196 0, /*tp_print*/
197 0, /*tp_getattr*/
198 0, /*tp_setattr*/
199 0, /*tp_compare*/
200 0, /*tp_repr*/
201 &__pyx_tp_as_number_C, /*tp_as_number*/
202 &__pyx_tp_as_sequence_C, /*tp_as_sequence*/
203 &__pyx_tp_as_mapping_C, /*tp_as_mapping*/
204 0, /*tp_hash*/
205 0, /*tp_call*/
206 0, /*tp_str*/
207 0, /*tp_getattro*/
208 0, /*tp_setattro*/
209 &__pyx_tp_as_buffer_C, /*tp_as_buffer*/
210 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/
211 0, /*tp_doc*/
212 0, /*tp_traverse*/
213 0, /*tp_clear*/
214 0, /*tp_richcompare*/
215 0, /*tp_weaklistoffset*/
216 0, /*tp_iter*/
217 0, /*tp_iternext*/
218 __pyx_methods_12voidstarcast_C, /*tp_methods*/
219 0, /*tp_members*/
220 0, /*tp_getset*/
221 0, /*tp_base*/
222 0, /*tp_dict*/
223 0, /*tp_descr_get*/
224 0, /*tp_descr_set*/
225 0, /*tp_dictoffset*/
226 0, /*tp_init*/
227 0, /*tp_alloc*/
228 __pyx_tp_new_12voidstarcast_C, /*tp_new*/
229 0, /*tp_free*/
230 0, /*tp_is_gc*/
231 0, /*tp_bases*/
232 0, /*tp_mro*/
233 0, /*tp_cache*/
234 0, /*tp_subclasses*/
235 0, /*tp_weaklist*/
236 };
238 static struct PyMethodDef __pyx_methods[] = {
239 {0, 0, 0, 0}
240 };
242 static void __pyx_init_filenames(void); /*proto*/
244 PyMODINIT_FUNC initvoidstarcast(void); /*proto*/
245 PyMODINIT_FUNC initvoidstarcast(void) {
246 __pyx_init_filenames();
247 __pyx_m = Py_InitModule4("voidstarcast", __pyx_methods, 0, 0, PYTHON_API_VERSION);
248 if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
249 Py_INCREF(__pyx_m);
250 __pyx_b = PyImport_AddModule("__builtin__");
251 if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
252 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
253 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
254 if (PyType_Ready(&__pyx_type_12voidstarcast_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
255 if (PyObject_SetAttrString(__pyx_m, "C", (PyObject *)&__pyx_type_12voidstarcast_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
256 __pyx_ptype_12voidstarcast_C = &__pyx_type_12voidstarcast_C;
258 /* "/Local/Projects/D/Pyrex/Source/Tests/10/voidstarcast.pyx":4 */
259 return;
260 __pyx_L1:;
261 __Pyx_AddTraceback("voidstarcast");
262 }
264 static char *__pyx_filenames[] = {
265 "voidstarcast.pyx",
266 };
268 /* Runtime support code */
270 static void __pyx_init_filenames(void) {
271 __pyx_f = __pyx_filenames;
272 }
274 static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
275 while (t->p) {
276 *t->p = PyString_InternFromString(t->s);
277 if (!*t->p)
278 return -1;
279 ++t;
280 }
281 return 0;
282 }
284 #include "compile.h"
285 #include "frameobject.h"
286 #include "traceback.h"
288 static void __Pyx_AddTraceback(char *funcname) {
289 PyObject *py_srcfile = 0;
290 PyObject *py_funcname = 0;
291 PyObject *py_globals = 0;
292 PyObject *empty_tuple = 0;
293 PyObject *empty_string = 0;
294 PyCodeObject *py_code = 0;
295 PyFrameObject *py_frame = 0;
297 py_srcfile = PyString_FromString(__pyx_filename);
298 if (!py_srcfile) goto bad;
299 py_funcname = PyString_FromString(funcname);
300 if (!py_funcname) goto bad;
301 py_globals = PyModule_GetDict(__pyx_m);
302 if (!py_globals) goto bad;
303 empty_tuple = PyTuple_New(0);
304 if (!empty_tuple) goto bad;
305 empty_string = PyString_FromString("");
306 if (!empty_string) goto bad;
307 py_code = PyCode_New(
308 0, /*int argcount,*/
309 0, /*int nlocals,*/
310 0, /*int stacksize,*/
311 0, /*int flags,*/
312 empty_string, /*PyObject *code,*/
313 empty_tuple, /*PyObject *consts,*/
314 empty_tuple, /*PyObject *names,*/
315 empty_tuple, /*PyObject *varnames,*/
316 empty_tuple, /*PyObject *freevars,*/
317 empty_tuple, /*PyObject *cellvars,*/
318 py_srcfile, /*PyObject *filename,*/
319 py_funcname, /*PyObject *name,*/
320 __pyx_lineno, /*int firstlineno,*/
321 empty_string /*PyObject *lnotab*/
322 );
323 if (!py_code) goto bad;
324 py_frame = PyFrame_New(
325 PyThreadState_Get(), /*PyThreadState *tstate,*/
326 py_code, /*PyCodeObject *code,*/
327 py_globals, /*PyObject *globals,*/
328 0 /*PyObject *locals*/
329 );
330 if (!py_frame) goto bad;
331 py_frame->f_lineno = __pyx_lineno;
332 PyTraceBack_Here(py_frame);
333 bad:
334 Py_XDECREF(py_srcfile);
335 Py_XDECREF(py_funcname);
336 Py_XDECREF(empty_tuple);
337 Py_XDECREF(empty_string);
338 Py_XDECREF(py_code);
339 Py_XDECREF(py_frame);
340 }