]> granicus.if.org Git - python/commitdiff
Clean up a Tab inconsistency.
authorFred Drake <fdrake@acm.org>
Fri, 2 Nov 2001 22:04:17 +0000 (22:04 +0000)
committerFred Drake <fdrake@acm.org>
Fri, 2 Nov 2001 22:04:17 +0000 (22:04 +0000)
Simplfy the insint() macro to use PyModule_AddIntConstant().

Modules/shamodule.c

index 724f6d61787009a3edf2221c3bf2c8b4dd13b7e9..b3831b961829c6ffa5a718885dc4688f5e2874ac 100644 (file)
@@ -459,7 +459,7 @@ SHA_getattr(PyObject *self, char *name)
     if (strcmp(name, "blocksize")==0)
         return PyInt_FromLong(1);
     if (strcmp(name, "digest_size")==0 || strcmp(name, "digestsize")==0)
-       return PyInt_FromLong(20);
+        return PyInt_FromLong(20);
 
     return Py_FindMethod(SHA_methods, self, name);
 }
@@ -524,9 +524,7 @@ static struct PyMethodDef SHA_functions[] = {
 
 /* Initialize this module. */
 
-#define insint(n,v) { PyObject *o=PyInt_FromLong(v); \
-       if (o!=NULL) PyDict_SetItemString(d,n,o); \
-       Py_XDECREF(o); }
+#define insint(n,v) { PyModule_AddIntConstant(m,n,v); }
 
 DL_EXPORT(void)
 initsha(void)