# HG changeset patch # User Paul Boddie # Date 1253228924 -7200 # Node ID 63addb8fb052d8251c1916a8c0025686b68118f3 # Parent 571be37961d84e41c67e0412c114d5241ed18893 Removed Pyrex extension result. diff -r 571be37961d8 -r 63addb8fb052 vint.c --- a/vint.c Fri Sep 18 01:06:55 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,224 +0,0 @@ -/* Generated by Pyrex 0.9.6.4 on Fri Sep 11 01:26:01 2009 */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#include "structmember.h" -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#if PY_VERSION_HEX < 0x02050000 - typedef int Py_ssize_t; - #define PY_SSIZE_T_MAX INT_MAX - #define PY_SSIZE_T_MIN INT_MIN - #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) PyInt_AsLong(o) -#endif -#ifndef WIN32 - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif -#endif -#ifdef __cplusplus -#define __PYX_EXTERN_C extern "C" -#else -#define __PYX_EXTERN_C extern -#endif -#include - - -typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/ -typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/ - -static PyObject *__pyx_m; -static PyObject *__pyx_b; -static int __pyx_lineno; -static char *__pyx_filename; -static char **__pyx_f; - -static void __Pyx_AddTraceback(char *funcname); /*proto*/ - -/* Declarations from vint */ - - - -/* Implementation of vint */ - -static PyObject *__pyx_f_4vint_vint(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_f_4vint_vint(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - int __pyx_v_number; - char __pyx_v_bytes[40]; - int __pyx_v_lsd; - int __pyx_v_i; - PyObject *__pyx_v_s; - PyObject *__pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - static char *__pyx_argnames[] = {"number",0}; - if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "i", __pyx_argnames, &__pyx_v_number)) return 0; - __pyx_v_s = Py_None; Py_INCREF(Py_None); - - /* "/home/paulb/Software/Python/iixr/vint.pyx":11 */ - __pyx_1 = (__pyx_v_number < 128); - if (__pyx_1) { - - /* "/home/paulb/Software/Python/iixr/vint.pyx":12 */ - (__pyx_v_bytes[0]) = __pyx_v_number; - - /* "/home/paulb/Software/Python/iixr/vint.pyx":13 */ - __pyx_2 = PyString_FromStringAndSize(__pyx_v_bytes,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;} - Py_DECREF(__pyx_v_s); - __pyx_v_s = __pyx_2; - __pyx_2 = 0; - - /* "/home/paulb/Software/Python/iixr/vint.pyx":14 */ - Py_INCREF(__pyx_v_s); - __pyx_r = __pyx_v_s; - goto __pyx_L0; - goto __pyx_L2; - } - __pyx_L2:; - - /* "/home/paulb/Software/Python/iixr/vint.pyx":16 */ - __pyx_v_i = 0; - - /* "/home/paulb/Software/Python/iixr/vint.pyx":17 */ - while (1) { - __pyx_1 = (__pyx_v_number != 0); - if (!__pyx_1) break; - - /* "/home/paulb/Software/Python/iixr/vint.pyx":18 */ - __pyx_v_lsd = (__pyx_v_number & 127); - - /* "/home/paulb/Software/Python/iixr/vint.pyx":19 */ - __pyx_v_number = (__pyx_v_number >> 7); - - /* "/home/paulb/Software/Python/iixr/vint.pyx":20 */ - __pyx_1 = (__pyx_v_number != 0); - if (__pyx_1) { - __pyx_v_lsd = (__pyx_v_lsd | 128); - goto __pyx_L5; - } - __pyx_L5:; - - /* "/home/paulb/Software/Python/iixr/vint.pyx":22 */ - (__pyx_v_bytes[__pyx_v_i]) = __pyx_v_lsd; - - /* "/home/paulb/Software/Python/iixr/vint.pyx":23 */ - __pyx_v_i = (__pyx_v_i + 1); - } - - /* "/home/paulb/Software/Python/iixr/vint.pyx":25 */ - __pyx_2 = PyString_FromStringAndSize(__pyx_v_bytes,__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; goto __pyx_L1;} - Py_DECREF(__pyx_v_s); - __pyx_v_s = __pyx_2; - __pyx_2 = 0; - - /* "/home/paulb/Software/Python/iixr/vint.pyx":26 */ - Py_INCREF(__pyx_v_s); - __pyx_r = __pyx_v_s; - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1:; - Py_XDECREF(__pyx_2); - __Pyx_AddTraceback("vint.vint"); - __pyx_r = 0; - __pyx_L0:; - Py_DECREF(__pyx_v_s); - return __pyx_r; -} - -static struct PyMethodDef __pyx_methods[] = { - {"vint", (PyCFunction)__pyx_f_4vint_vint, METH_VARARGS|METH_KEYWORDS, 0}, - {0, 0, 0, 0} -}; - -static void __pyx_init_filenames(void); /*proto*/ - -PyMODINIT_FUNC initvint(void); /*proto*/ -PyMODINIT_FUNC initvint(void) { - __pyx_init_filenames(); - __pyx_m = Py_InitModule4("vint", __pyx_methods, 0, 0, PYTHON_API_VERSION); - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;}; - Py_INCREF(__pyx_m); - __pyx_b = PyImport_AddModule("__builtin__"); - if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;}; - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;}; - - /* "/home/paulb/Software/Python/iixr/vint.pyx":6 */ - return; - __pyx_L1:; - __Pyx_AddTraceback("vint"); -} - -static char *__pyx_filenames[] = { - "vint.pyx", -}; - -/* Runtime support code */ - -static void __pyx_init_filenames(void) { - __pyx_f = __pyx_filenames; -} - -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" - -static void __Pyx_AddTraceback(char *funcname) { - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - PyObject *py_globals = 0; - PyObject *empty_tuple = 0; - PyObject *empty_string = 0; - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - - py_srcfile = PyString_FromString(__pyx_filename); - if (!py_srcfile) goto bad; - py_funcname = PyString_FromString(funcname); - if (!py_funcname) goto bad; - py_globals = PyModule_GetDict(__pyx_m); - if (!py_globals) goto bad; - empty_tuple = PyTuple_New(0); - if (!empty_tuple) goto bad; - empty_string = PyString_FromString(""); - if (!empty_string) goto bad; - py_code = PyCode_New( - 0, /*int argcount,*/ - 0, /*int nlocals,*/ - 0, /*int stacksize,*/ - 0, /*int flags,*/ - empty_string, /*PyObject *code,*/ - empty_tuple, /*PyObject *consts,*/ - empty_tuple, /*PyObject *names,*/ - empty_tuple, /*PyObject *varnames,*/ - empty_tuple, /*PyObject *freevars,*/ - empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - __pyx_lineno, /*int firstlineno,*/ - empty_string /*PyObject *lnotab*/ - ); - if (!py_code) goto bad; - py_frame = PyFrame_New( - PyThreadState_Get(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - py_globals, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = __pyx_lineno; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - Py_XDECREF(empty_tuple); - Py_XDECREF(empty_string); - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -}