[Python-checkins] CVS: python/dist/src/Modules md5module.c,2.25,2.26

Fred L. Drake fdrake@users.sourceforge.net
2001年11月02日 14:05:08 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv21674
Modified Files:
	md5module.c 
Log Message:
Simplify initmd5() to use PyModule_AddIntConstant().
Index: md5module.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/md5module.c,v
retrieving revision 2.25
retrieving revision 2.26
diff -C2 -d -r2.25 -r2.26
*** md5module.c	2001年11月02日 21:41:00	2.25
--- md5module.c	2001年11月02日 22:05:06	2.26
***************
*** 269,273 ****
 initmd5(void)
 {
! 	PyObject *m, *d, *i;
 
 MD5type.ob_type = &PyType_Type;
--- 269,273 ----
 initmd5(void)
 {
! 	PyObject *m, *d;
 
 MD5type.ob_type = &PyType_Type;
***************
*** 275,280 ****
 	d = PyModule_GetDict(m);
 	PyDict_SetItemString(d, "MD5Type", (PyObject *)&MD5type);
! if ( (i = PyInt_FromLong(16)) != NULL) 
! 	PyDict_SetItemString(d, "digest_size", i);
 	/* No need to check the error here, the caller will do that */
 }
--- 275,279 ----
 	d = PyModule_GetDict(m);
 	PyDict_SetItemString(d, "MD5Type", (PyObject *)&MD5type);
! 	PyModule_AddIntConstant(m, "digest_size", 16);
 	/* No need to check the error here, the caller will do that */
 }

AltStyle によって変換されたページ (->オリジナル) /