Cython has moved to github.
pyrex
view Tests/5/extcoerce.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_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/
42 static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
44 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
46 static void __Pyx_AddTraceback(char *funcname); /*proto*/
48 /* Declarations from extcoerce */
51 /* Declarations from implementation of extcoerce */
53 struct __pyx_obj_9extcoerce_Grail {
54 PyObject_HEAD
55 };
57 struct __pyx_obj_9extcoerce_Swallow {
58 PyObject_HEAD
59 };
63 static PyTypeObject *__pyx_ptype_9extcoerce_Grail = 0;
64 static PyTypeObject *__pyx_ptype_9extcoerce_Swallow = 0;
69 static __Pyx_StringTabEntry __pyx_string_tab[] = {
70 {0, 0, 0, 0}
71 };
75 /* Implementation of extcoerce */
77 static PyObject *__pyx_f_9extcoerce_5Grail___add__(PyObject *__pyx_arg_x, PyObject *__pyx_arg_y); /*proto*/
78 static PyObject *__pyx_f_9extcoerce_5Grail___add__(PyObject *__pyx_arg_x, PyObject *__pyx_arg_y) {
79 int __pyx_v_x;
80 float __pyx_v_y;
81 PyObject *__pyx_r;
82 __pyx_v_x = PyInt_AsLong(__pyx_arg_x); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;}
83 __pyx_v_y = PyFloat_AsDouble(__pyx_arg_y); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;}
85 __pyx_r = Py_None; Py_INCREF(Py_None);
86 goto __pyx_L0;
87 __pyx_L1:;
88 __Pyx_AddTraceback("extcoerce.Grail.__add__");
89 __pyx_r = 0;
90 __pyx_L0:;
91 return __pyx_r;
92 }
94 static PyObject *__pyx_f_9extcoerce_5Grail___getslice__(PyObject *__pyx_v_self, Py_ssize_t __pyx_arg_i, Py_ssize_t __pyx_arg_j); /*proto*/
95 static PyObject *__pyx_f_9extcoerce_5Grail___getslice__(PyObject *__pyx_v_self, Py_ssize_t __pyx_arg_i, Py_ssize_t __pyx_arg_j) {
96 PyObject *__pyx_v_i = 0;
97 PyObject *__pyx_v_j = 0;
98 PyObject *__pyx_r;
99 Py_INCREF(__pyx_v_self);
100 __pyx_v_i = PyInt_FromSsize_t(__pyx_arg_i); if (!__pyx_v_i) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;}
101 __pyx_v_j = PyInt_FromSsize_t(__pyx_arg_j); if (!__pyx_v_j) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; goto __pyx_L1;}
103 __pyx_r = Py_None; Py_INCREF(Py_None);
104 goto __pyx_L0;
105 __pyx_L1:;
106 __Pyx_AddTraceback("extcoerce.Grail.__getslice__");
107 __pyx_r = 0;
108 __pyx_L0:;
109 Py_DECREF(__pyx_v_i);
110 Py_DECREF(__pyx_v_j);
111 Py_DECREF(__pyx_v_self);
112 return __pyx_r;
113 }
115 static int __pyx_f_9extcoerce_5Grail___setslice__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_i, Py_ssize_t __pyx_arg_j, PyObject *__pyx_v_x); /*proto*/
116 static int __pyx_f_9extcoerce_5Grail___setslice__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_i, Py_ssize_t __pyx_arg_j, PyObject *__pyx_v_x) {
117 float __pyx_v_j;
118 int __pyx_r;
119 Py_INCREF(__pyx_v_self);
120 Py_INCREF(__pyx_v_x);
121 __pyx_v_j = __pyx_arg_j;
123 __pyx_r = 0;
124 Py_DECREF(__pyx_v_self);
125 Py_DECREF(__pyx_v_x);
126 return __pyx_r;
127 }
129 static PyObject *__pyx_f_9extcoerce_f(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
130 static PyObject *__pyx_f_9extcoerce_f(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
131 struct __pyx_obj_9extcoerce_Grail *__pyx_v_g = 0;
132 int __pyx_v_i;
133 struct __pyx_obj_9extcoerce_Swallow *__pyx_v_s;
134 PyObject *__pyx_v_x;
135 PyObject *__pyx_r;
136 PyObject *__pyx_1 = 0;
137 int __pyx_2;
138 static char *__pyx_argnames[] = {"g",0};
139 if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_g)) return 0;
140 Py_INCREF(__pyx_v_g);
141 __pyx_v_s = ((struct __pyx_obj_9extcoerce_Swallow *)Py_None); Py_INCREF(Py_None);
142 __pyx_v_x = Py_None; Py_INCREF(Py_None);
143 if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_9extcoerce_Grail, 1, "g")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;}
145 /* "/Local/Projects/D/Pyrex/Source/Tests/5/extcoerce.pyx":18 */
146 if (!__Pyx_TypeTest(__pyx_v_x, __pyx_ptype_9extcoerce_Grail)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}
147 Py_INCREF(__pyx_v_x);
148 Py_DECREF(((PyObject *)__pyx_v_g));
149 __pyx_v_g = ((struct __pyx_obj_9extcoerce_Grail *)__pyx_v_x);
151 /* "/Local/Projects/D/Pyrex/Source/Tests/5/extcoerce.pyx":19 */
152 Py_INCREF(((PyObject *)__pyx_v_g));
153 Py_DECREF(__pyx_v_x);
154 __pyx_v_x = ((PyObject *)__pyx_v_g);
156 /* "/Local/Projects/D/Pyrex/Source/Tests/5/extcoerce.pyx":20 */
157 __pyx_1 = PyInt_FromLong(__pyx_v_i); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}
158 if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_9extcoerce_Grail)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}
159 Py_DECREF(((PyObject *)__pyx_v_g));
160 __pyx_v_g = ((struct __pyx_obj_9extcoerce_Grail *)__pyx_1);
161 __pyx_1 = 0;
163 /* "/Local/Projects/D/Pyrex/Source/Tests/5/extcoerce.pyx":21 */
164 __pyx_2 = PyInt_AsLong(((PyObject *)__pyx_v_g)); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;}
165 __pyx_v_i = __pyx_2;
167 /* "/Local/Projects/D/Pyrex/Source/Tests/5/extcoerce.pyx":22 */
168 if (!__Pyx_TypeTest(((PyObject *)__pyx_v_s), __pyx_ptype_9extcoerce_Grail)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
169 Py_INCREF(((PyObject *)__pyx_v_s));
170 Py_DECREF(((PyObject *)__pyx_v_g));
171 __pyx_v_g = ((struct __pyx_obj_9extcoerce_Grail *)__pyx_v_s);
173 /* "/Local/Projects/D/Pyrex/Source/Tests/5/extcoerce.pyx":23 */
174 if (!__Pyx_TypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_9extcoerce_Swallow)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
175 Py_INCREF(((PyObject *)__pyx_v_g));
176 Py_DECREF(((PyObject *)__pyx_v_s));
177 __pyx_v_s = ((struct __pyx_obj_9extcoerce_Swallow *)__pyx_v_g);
179 __pyx_r = Py_None; Py_INCREF(Py_None);
180 goto __pyx_L0;
181 __pyx_L1:;
182 Py_XDECREF(__pyx_1);
183 __Pyx_AddTraceback("extcoerce.f");
184 __pyx_r = 0;
185 __pyx_L0:;
186 Py_DECREF(__pyx_v_s);
187 Py_DECREF(__pyx_v_x);
188 Py_DECREF(__pyx_v_g);
189 return __pyx_r;
190 }
192 static PyObject *__pyx_tp_new_9extcoerce_Grail(PyTypeObject *t, PyObject *a, PyObject *k) {
193 PyObject *o = (*t->tp_alloc)(t, 0);
194 if (!o) return 0;
195 return o;
196 }
198 static void __pyx_tp_dealloc_9extcoerce_Grail(PyObject *o) {
199 (*o->ob_type->tp_free)(o);
200 }
202 static int __pyx_sq_ass_slice_9extcoerce_Grail(PyObject *o, Py_ssize_t i, Py_ssize_t j, PyObject *v) {
203 if (v) {
204 return __pyx_f_9extcoerce_5Grail___setslice__(o, i, j, v);
205 }
206 else {
207 PyErr_Format(PyExc_NotImplementedError,
208 "2-element slice deletion not supported by %s", o->ob_type->tp_name);
209 return -1;
210 }
211 }
213 static struct PyMethodDef __pyx_methods_9extcoerce_Grail[] = {
214 {0, 0, 0, 0}
215 };
217 static PyNumberMethods __pyx_tp_as_number_Grail = {
218 __pyx_f_9extcoerce_5Grail___add__, /*nb_add*/
219 0, /*nb_subtract*/
220 0, /*nb_multiply*/
221 0, /*nb_divide*/
222 0, /*nb_remainder*/
223 0, /*nb_divmod*/
224 0, /*nb_power*/
225 0, /*nb_negative*/
226 0, /*nb_positive*/
227 0, /*nb_absolute*/
228 0, /*nb_nonzero*/
229 0, /*nb_invert*/
230 0, /*nb_lshift*/
231 0, /*nb_rshift*/
232 0, /*nb_and*/
233 0, /*nb_xor*/
234 0, /*nb_or*/
235 0, /*nb_coerce*/
236 0, /*nb_int*/
237 0, /*nb_long*/
238 0, /*nb_float*/
239 0, /*nb_oct*/
240 0, /*nb_hex*/
241 0, /*nb_inplace_add*/
242 0, /*nb_inplace_subtract*/
243 0, /*nb_inplace_multiply*/
244 0, /*nb_inplace_divide*/
245 0, /*nb_inplace_remainder*/
246 0, /*nb_inplace_power*/
247 0, /*nb_inplace_lshift*/
248 0, /*nb_inplace_rshift*/
249 0, /*nb_inplace_and*/
250 0, /*nb_inplace_xor*/
251 0, /*nb_inplace_or*/
252 0, /*nb_floor_divide*/
253 0, /*nb_true_divide*/
254 0, /*nb_inplace_floor_divide*/
255 0, /*nb_inplace_true_divide*/
256 #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
257 0, /*nb_index*/
258 #endif
259 };
261 static PySequenceMethods __pyx_tp_as_sequence_Grail = {
262 0, /*sq_length*/
263 0, /*sq_concat*/
264 0, /*sq_repeat*/
265 0, /*sq_item*/
266 __pyx_f_9extcoerce_5Grail___getslice__, /*sq_slice*/
267 0, /*sq_ass_item*/
268 __pyx_sq_ass_slice_9extcoerce_Grail, /*sq_ass_slice*/
269 0, /*sq_contains*/
270 0, /*sq_inplace_concat*/
271 0, /*sq_inplace_repeat*/
272 };
274 static PyMappingMethods __pyx_tp_as_mapping_Grail = {
275 0, /*mp_length*/
276 0, /*mp_subscript*/
277 0, /*mp_ass_subscript*/
278 };
280 static PyBufferProcs __pyx_tp_as_buffer_Grail = {
281 0, /*bf_getreadbuffer*/
282 0, /*bf_getwritebuffer*/
283 0, /*bf_getsegcount*/
284 0, /*bf_getcharbuffer*/
285 };
287 PyTypeObject __pyx_type_9extcoerce_Grail = {
288 PyObject_HEAD_INIT(0)
289 0, /*ob_size*/
290 "extcoerce.Grail", /*tp_name*/
291 sizeof(struct __pyx_obj_9extcoerce_Grail), /*tp_basicsize*/
292 0, /*tp_itemsize*/
293 __pyx_tp_dealloc_9extcoerce_Grail, /*tp_dealloc*/
294 0, /*tp_print*/
295 0, /*tp_getattr*/
296 0, /*tp_setattr*/
297 0, /*tp_compare*/
298 0, /*tp_repr*/
299 &__pyx_tp_as_number_Grail, /*tp_as_number*/
300 &__pyx_tp_as_sequence_Grail, /*tp_as_sequence*/
301 &__pyx_tp_as_mapping_Grail, /*tp_as_mapping*/
302 0, /*tp_hash*/
303 0, /*tp_call*/
304 0, /*tp_str*/
305 0, /*tp_getattro*/
306 0, /*tp_setattro*/
307 &__pyx_tp_as_buffer_Grail, /*tp_as_buffer*/
308 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/
309 0, /*tp_doc*/
310 0, /*tp_traverse*/
311 0, /*tp_clear*/
312 0, /*tp_richcompare*/
313 0, /*tp_weaklistoffset*/
314 0, /*tp_iter*/
315 0, /*tp_iternext*/
316 __pyx_methods_9extcoerce_Grail, /*tp_methods*/
317 0, /*tp_members*/
318 0, /*tp_getset*/
319 0, /*tp_base*/
320 0, /*tp_dict*/
321 0, /*tp_descr_get*/
322 0, /*tp_descr_set*/
323 0, /*tp_dictoffset*/
324 0, /*tp_init*/
325 0, /*tp_alloc*/
326 __pyx_tp_new_9extcoerce_Grail, /*tp_new*/
327 0, /*tp_free*/
328 0, /*tp_is_gc*/
329 0, /*tp_bases*/
330 0, /*tp_mro*/
331 0, /*tp_cache*/
332 0, /*tp_subclasses*/
333 0, /*tp_weaklist*/
334 };
336 static PyObject *__pyx_tp_new_9extcoerce_Swallow(PyTypeObject *t, PyObject *a, PyObject *k) {
337 PyObject *o = (*t->tp_alloc)(t, 0);
338 if (!o) return 0;
339 return o;
340 }
342 static void __pyx_tp_dealloc_9extcoerce_Swallow(PyObject *o) {
343 (*o->ob_type->tp_free)(o);
344 }
346 static struct PyMethodDef __pyx_methods_9extcoerce_Swallow[] = {
347 {0, 0, 0, 0}
348 };
350 static PyNumberMethods __pyx_tp_as_number_Swallow = {
351 0, /*nb_add*/
352 0, /*nb_subtract*/
353 0, /*nb_multiply*/
354 0, /*nb_divide*/
355 0, /*nb_remainder*/
356 0, /*nb_divmod*/
357 0, /*nb_power*/
358 0, /*nb_negative*/
359 0, /*nb_positive*/
360 0, /*nb_absolute*/
361 0, /*nb_nonzero*/
362 0, /*nb_invert*/
363 0, /*nb_lshift*/
364 0, /*nb_rshift*/
365 0, /*nb_and*/
366 0, /*nb_xor*/
367 0, /*nb_or*/
368 0, /*nb_coerce*/
369 0, /*nb_int*/
370 0, /*nb_long*/
371 0, /*nb_float*/
372 0, /*nb_oct*/
373 0, /*nb_hex*/
374 0, /*nb_inplace_add*/
375 0, /*nb_inplace_subtract*/
376 0, /*nb_inplace_multiply*/
377 0, /*nb_inplace_divide*/
378 0, /*nb_inplace_remainder*/
379 0, /*nb_inplace_power*/
380 0, /*nb_inplace_lshift*/
381 0, /*nb_inplace_rshift*/
382 0, /*nb_inplace_and*/
383 0, /*nb_inplace_xor*/
384 0, /*nb_inplace_or*/
385 0, /*nb_floor_divide*/
386 0, /*nb_true_divide*/
387 0, /*nb_inplace_floor_divide*/
388 0, /*nb_inplace_true_divide*/
389 #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
390 0, /*nb_index*/
391 #endif
392 };
394 static PySequenceMethods __pyx_tp_as_sequence_Swallow = {
395 0, /*sq_length*/
396 0, /*sq_concat*/
397 0, /*sq_repeat*/
398 0, /*sq_item*/
399 0, /*sq_slice*/
400 0, /*sq_ass_item*/
401 0, /*sq_ass_slice*/
402 0, /*sq_contains*/
403 0, /*sq_inplace_concat*/
404 0, /*sq_inplace_repeat*/
405 };
407 static PyMappingMethods __pyx_tp_as_mapping_Swallow = {
408 0, /*mp_length*/
409 0, /*mp_subscript*/
410 0, /*mp_ass_subscript*/
411 };
413 static PyBufferProcs __pyx_tp_as_buffer_Swallow = {
414 0, /*bf_getreadbuffer*/
415 0, /*bf_getwritebuffer*/
416 0, /*bf_getsegcount*/
417 0, /*bf_getcharbuffer*/
418 };
420 PyTypeObject __pyx_type_9extcoerce_Swallow = {
421 PyObject_HEAD_INIT(0)
422 0, /*ob_size*/
423 "extcoerce.Swallow", /*tp_name*/
424 sizeof(struct __pyx_obj_9extcoerce_Swallow), /*tp_basicsize*/
425 0, /*tp_itemsize*/
426 __pyx_tp_dealloc_9extcoerce_Swallow, /*tp_dealloc*/
427 0, /*tp_print*/
428 0, /*tp_getattr*/
429 0, /*tp_setattr*/
430 0, /*tp_compare*/
431 0, /*tp_repr*/
432 &__pyx_tp_as_number_Swallow, /*tp_as_number*/
433 &__pyx_tp_as_sequence_Swallow, /*tp_as_sequence*/
434 &__pyx_tp_as_mapping_Swallow, /*tp_as_mapping*/
435 0, /*tp_hash*/
436 0, /*tp_call*/
437 0, /*tp_str*/
438 0, /*tp_getattro*/
439 0, /*tp_setattro*/
440 &__pyx_tp_as_buffer_Swallow, /*tp_as_buffer*/
441 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/
442 0, /*tp_doc*/
443 0, /*tp_traverse*/
444 0, /*tp_clear*/
445 0, /*tp_richcompare*/
446 0, /*tp_weaklistoffset*/
447 0, /*tp_iter*/
448 0, /*tp_iternext*/
449 __pyx_methods_9extcoerce_Swallow, /*tp_methods*/
450 0, /*tp_members*/
451 0, /*tp_getset*/
452 0, /*tp_base*/
453 0, /*tp_dict*/
454 0, /*tp_descr_get*/
455 0, /*tp_descr_set*/
456 0, /*tp_dictoffset*/
457 0, /*tp_init*/
458 0, /*tp_alloc*/
459 __pyx_tp_new_9extcoerce_Swallow, /*tp_new*/
460 0, /*tp_free*/
461 0, /*tp_is_gc*/
462 0, /*tp_bases*/
463 0, /*tp_mro*/
464 0, /*tp_cache*/
465 0, /*tp_subclasses*/
466 0, /*tp_weaklist*/
467 };
469 static struct PyMethodDef __pyx_methods[] = {
470 {"f", (PyCFunction)__pyx_f_9extcoerce_f, METH_VARARGS|METH_KEYWORDS, 0},
471 {0, 0, 0, 0}
472 };
474 static void __pyx_init_filenames(void); /*proto*/
476 PyMODINIT_FUNC initextcoerce(void); /*proto*/
477 PyMODINIT_FUNC initextcoerce(void) {
478 __pyx_init_filenames();
479 __pyx_m = Py_InitModule4("extcoerce", __pyx_methods, 0, 0, PYTHON_API_VERSION);
480 if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
481 Py_INCREF(__pyx_m);
482 __pyx_b = PyImport_AddModule("__builtin__");
483 if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
484 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
485 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
486 if (PyType_Ready(&__pyx_type_9extcoerce_Grail) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
487 if (PyObject_SetAttrString(__pyx_m, "Grail", (PyObject *)&__pyx_type_9extcoerce_Grail) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
488 __pyx_ptype_9extcoerce_Grail = &__pyx_type_9extcoerce_Grail;
489 if (PyType_Ready(&__pyx_type_9extcoerce_Swallow) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; goto __pyx_L1;}
490 if (PyObject_SetAttrString(__pyx_m, "Swallow", (PyObject *)&__pyx_type_9extcoerce_Swallow) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; goto __pyx_L1;}
491 __pyx_ptype_9extcoerce_Swallow = &__pyx_type_9extcoerce_Swallow;
493 /* "/Local/Projects/D/Pyrex/Source/Tests/5/extcoerce.pyx":15 */
494 return;
495 __pyx_L1:;
496 __Pyx_AddTraceback("extcoerce");
497 }
499 static char *__pyx_filenames[] = {
500 "extcoerce.pyx",
501 };
503 /* Runtime support code */
505 static void __pyx_init_filenames(void) {
506 __pyx_f = __pyx_filenames;
507 }
509 static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name) {
510 if (!type) {
511 PyErr_Format(PyExc_SystemError, "Missing type object");
512 return 0;
513 }
514 if ((none_allowed && obj == Py_None) || PyObject_TypeCheck(obj, type))
515 return 1;
516 PyErr_Format(PyExc_TypeError,
517 "Argument '%s' has incorrect type (expected %s, got %s)",
518 name, type->tp_name, obj->ob_type->tp_name);
519 return 0;
520 }
522 static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
523 if (!type) {
524 PyErr_Format(PyExc_SystemError, "Missing type object");
525 return 0;
526 }
527 if (obj == Py_None || PyObject_TypeCheck(obj, type))
528 return 1;
529 PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s",
530 obj->ob_type->tp_name, type->tp_name);
531 return 0;
532 }
534 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
535 while (t->p) {
536 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
537 if (!*t->p)
538 return -1;
539 if (t->i)
540 PyString_InternInPlace(t->p);
541 ++t;
542 }
543 return 0;
544 }
546 #include "compile.h"
547 #include "frameobject.h"
548 #include "traceback.h"
550 static void __Pyx_AddTraceback(char *funcname) {
551 PyObject *py_srcfile = 0;
552 PyObject *py_funcname = 0;
553 PyObject *py_globals = 0;
554 PyObject *empty_tuple = 0;
555 PyObject *empty_string = 0;
556 PyCodeObject *py_code = 0;
557 PyFrameObject *py_frame = 0;
559 py_srcfile = PyString_FromString(__pyx_filename);
560 if (!py_srcfile) goto bad;
561 py_funcname = PyString_FromString(funcname);
562 if (!py_funcname) goto bad;
563 py_globals = PyModule_GetDict(__pyx_m);
564 if (!py_globals) goto bad;
565 empty_tuple = PyTuple_New(0);
566 if (!empty_tuple) goto bad;
567 empty_string = PyString_FromString("");
568 if (!empty_string) goto bad;
569 py_code = PyCode_New(
570 0, /*int argcount,*/
571 0, /*int nlocals,*/
572 0, /*int stacksize,*/
573 0, /*int flags,*/
574 empty_string, /*PyObject *code,*/
575 empty_tuple, /*PyObject *consts,*/
576 empty_tuple, /*PyObject *names,*/
577 empty_tuple, /*PyObject *varnames,*/
578 empty_tuple, /*PyObject *freevars,*/
579 empty_tuple, /*PyObject *cellvars,*/
580 py_srcfile, /*PyObject *filename,*/
581 py_funcname, /*PyObject *name,*/
582 __pyx_lineno, /*int firstlineno,*/
583 empty_string /*PyObject *lnotab*/
584 );
585 if (!py_code) goto bad;
586 py_frame = PyFrame_New(
587 PyThreadState_Get(), /*PyThreadState *tstate,*/
588 py_code, /*PyCodeObject *code,*/
589 py_globals, /*PyObject *globals,*/
590 0 /*PyObject *locals*/
591 );
592 if (!py_frame) goto bad;
593 py_frame->f_lineno = __pyx_lineno;
594 PyTraceBack_Here(py_frame);
595 bad:
596 Py_XDECREF(py_srcfile);
597 Py_XDECREF(py_funcname);
598 Py_XDECREF(empty_tuple);
599 Py_XDECREF(empty_string);
600 Py_XDECREF(py_code);
601 Py_XDECREF(py_frame);
602 }
