[pypy-svn] r74358 - pypy/trunk/pypy/module/cpyext/test

agaynor at codespeak.net agaynor at codespeak.net
Tue May 4 14:36:14 CEST 2010


Author: agaynor
Date: Tue May  4 14:36:13 2010
New Revision: 74358

Modified:
   pypy/trunk/pypy/module/cpyext/test/foo.c
Log:
Normalized whitespace (removed tabs).

Modified: pypy/trunk/pypy/module/cpyext/test/foo.c
==============================================================================
--- pypy/trunk/pypy/module/cpyext/test/foo.c	(original)
+++ pypy/trunk/pypy/module/cpyext/test/foo.c	Tue May  4 14:36:13 2010
@@ -2,8 +2,8 @@
 #include "structmember.h"
 
 typedef struct {
-	PyObject_HEAD
-    int	foo;		/* the context holder */
+    PyObject_HEAD
+    int    foo;        /* the context holder */
     PyObject *foo_object;
     char *foo_string;
     char foo_string_inplace[5];
@@ -14,17 +14,17 @@
 static fooobject *
 newfooobject(void)
 {
-	fooobject *foop;
+    fooobject *foop;
 
-	foop = PyObject_New(fooobject, &footype);
-	if (foop == NULL)
-		return NULL;
-
-	foop->foo = 42;
-	foop->foo_object = NULL;
-	foop->foo_string = "Hello from PyPy";
-	strncpy(foop->foo_string_inplace, "spam", 5);
-	return foop;
+    foop = PyObject_New(fooobject, &footype);
+    if (foop == NULL)
+        return NULL;
+
+    foop->foo = 42;
+    foop->foo_object = NULL;
+    foop->foo_string = "Hello from PyPy";
+    strncpy(foop->foo_string_inplace, "spam", 5);
+    return foop;
 }
 
 
@@ -33,7 +33,7 @@
 static void
 foo_dealloc(fooobject *foop)
 {
-	PyObject_Del(foop);
+    PyObject_Del(foop);
 }
 
 
@@ -42,14 +42,14 @@
 static PyObject *
 foo_copy(fooobject *self)
 {
-	fooobject *foop;
+    fooobject *foop;
 
-	if ((foop = newfooobject()) == NULL)
-		return NULL;
+    if ((foop = newfooobject()) == NULL)
+        return NULL;
 
-	foop->foo = self->foo;
+    foop->foo = self->foo;
 
-	return (PyObject *)foop;
+    return (PyObject *)foop;
 }
 
 static PyObject *
@@ -61,9 +61,9 @@
 
 
 static PyMethodDef foo_methods[] = {
-	{"copy",      (PyCFunction)foo_copy,      METH_NOARGS,  NULL},
-	{"unset_string_member", (PyCFunction)foo_unset, METH_NOARGS, NULL},
-	{NULL, NULL}			     /* sentinel */
+    {"copy",      (PyCFunction)foo_copy,      METH_NOARGS,  NULL},
+    {"unset_string_member", (PyCFunction)foo_unset, METH_NOARGS, NULL},
+    {NULL, NULL}                 /* sentinel */
 };
 
 static PyObject *
@@ -126,37 +126,37 @@
 };
 
 static PyTypeObject footype = {
-	PyVarObject_HEAD_INIT(NULL, 0)
-	"foo.foo",		  /*tp_name*/
-	sizeof(fooobject),	  /*tp_size*/
-	0,			  /*tp_itemsize*/
-	/* methods */
-	(destructor)foo_dealloc,  /*tp_dealloc*/
-	0,			  /*tp_print*/
-	0,                        /*tp_getattr*/
-	0,			  /*tp_setattr*/
-	0,			  /*tp_compare*/
-	foo_repr,			  /*tp_repr*/
-    0,			  /*tp_as_number*/
-	0,                        /*tp_as_sequence*/
-	0,			  /*tp_as_mapping*/
-	0, 			  /*tp_hash*/
-	foo_call,			  /*tp_call*/
-	0,			  /*tp_str*/
-	0,			  /*tp_getattro*/
-	0,			  /*tp_setattro*/
-	0,	                  /*tp_as_buffer*/
-	Py_TPFLAGS_DEFAULT,	  /*tp_flags*/
-	0,		  /*tp_doc*/
-        0,                        /*tp_traverse*/
-        0,			  /*tp_clear*/
-        0,			  /*tp_richcompare*/
-        0,			  /*tp_weaklistoffset*/
-        0,			  /*tp_iter*/
-        0,			  /*tp_iternext*/
-        foo_methods,	          /*tp_methods*/
-        foo_members,              /*tp_members*/
-        foo_getseters,            /*tp_getset*/
+    PyVarObject_HEAD_INIT(NULL, 0)
+    "foo.foo",               /*tp_name*/
+    sizeof(fooobject),       /*tp_size*/
+    0,                       /*tp_itemsize*/
+    /* methods */
+    (destructor)foo_dealloc, /*tp_dealloc*/
+    0,                       /*tp_print*/
+    0,                       /*tp_getattr*/
+    0,                       /*tp_setattr*/
+    0,                       /*tp_compare*/
+    foo_repr,                /*tp_repr*/
+    0,                       /*tp_as_number*/
+    0,                       /*tp_as_sequence*/
+    0,                       /*tp_as_mapping*/
+    0,                       /*tp_hash*/
+    foo_call,                /*tp_call*/
+    0,                       /*tp_str*/
+    0,                       /*tp_getattro*/
+    0,                       /*tp_setattro*/
+    0,                       /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT,      /*tp_flags*/
+    0,                       /*tp_doc*/
+    0,                       /*tp_traverse*/
+    0,                       /*tp_clear*/
+    0,                       /*tp_richcompare*/
+    0,                       /*tp_weaklistoffset*/
+    0,                       /*tp_iter*/
+    0,                       /*tp_iternext*/
+    foo_methods,             /*tp_methods*/
+    foo_members,             /*tp_members*/
+    foo_getseters,           /*tp_getset*/
 };
 
 typedef struct {
@@ -246,20 +246,20 @@
 static PyObject *
 foo_new(PyObject *self, PyObject *args)
 {
-	fooobject *foop;
+    fooobject *foop;
 
-	if ((foop = newfooobject()) == NULL) {
-		return NULL;
-	}
-	
-	return (PyObject *)foop;
+    if ((foop = newfooobject()) == NULL) {
+        return NULL;
+    }
+    
+    return (PyObject *)foop;
 }
 
 /* List of functions exported by this module */
 
 static PyMethodDef foo_functions[] = {
-	{"new",		(PyCFunction)foo_new, METH_NOARGS, NULL},
-	{NULL,		NULL}	/* Sentinel */
+    {"new",        (PyCFunction)foo_new, METH_NOARGS, NULL},
+    {NULL,        NULL}    /* Sentinel */
 };
 
 
@@ -267,7 +267,7 @@
 
 void initfoo(void)
 {
-	PyObject *m, *d;
+    PyObject *m, *d;
 
     footype.ob_type = &PyType_Type;
 
@@ -279,14 +279,14 @@
         return;
     if (PyType_Ready(&FuuType) < 0)
         return;
-	m = Py_InitModule("foo", foo_functions);
-	if (m == NULL)
-	    return;
-	d = PyModule_GetDict(m);
-	if (d) {
-	    if (PyDict_SetItemString(d, "fooType", (PyObject *)&footype) < 0)
+    m = Py_InitModule("foo", foo_functions);
+    if (m == NULL)
+        return;
+    d = PyModule_GetDict(m);
+    if (d) {
+        if (PyDict_SetItemString(d, "fooType", (PyObject *)&footype) < 0)
             return;
         PyDict_SetItemString(d, "FuuType", (PyObject *) &FuuType);
     }
-   	/* No need to check the error here, the caller will do that */
+       /* No need to check the error here, the caller will do that */
 }



More information about the Pypy-commit mailing list