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