[Python-checkins] CVS: python/dist/src/Modules _localemodule.c,2.10,2.11

Fredrik Lundh python-dev@python.org
Sat, 8 Jul 2000 13:07:27 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory slayer.i.sourceforge.net:/tmp/cvs-serv9392/Modules
Modified Files:
	_localemodule.c 
Log Message:
- _getdefaultlocale shouldn't accept arguments
- some more spacification...
Index: _localemodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_localemodule.c,v
retrieving revision 2.10
retrieving revision 2.11
diff -C2 -r2.10 -r2.11
*** _localemodule.c	2000年07月08日 19:57:37	2.10
--- _localemodule.c	2000年07月08日 20:07:24	2.11
***************
*** 71,75 ****
 if (PyList_SetItem(result, i, val)) {
 Py_DECREF(val);
! val = 0;
 break;
 }
--- 71,75 ----
 if (PyList_SetItem(result, i, val)) {
 Py_DECREF(val);
! val = NULL;
 break;
 }
***************
*** 111,115 ****
 }
 ulo = PyString_FromStringAndSize((const char *)ul, n);
! if(!ulo)
 return;
 if (string)
--- 111,115 ----
 }
 ulo = PyString_FromStringAndSize((const char *)ul, n);
! if (!ulo)
 return;
 if (string)
***************
*** 158,162 ****
 
 if (!PyArg_ParseTuple(args, "i|z:setlocale", &category, &locale))
! return 0;
 
 if (locale) {
--- 158,162 ----
 
 if (!PyArg_ParseTuple(args, "i|z:setlocale", &category, &locale))
! return NULL;
 
 if (locale) {
***************
*** 227,235 ****
 
 if (!PyArg_NoArgs(args))
! return 0;
 
 result = PyDict_New();
! if(!result)
! return 0;
 
 /* if LC_NUMERIC is different in the C library, use saved value */
--- 227,235 ----
 
 if (!PyArg_NoArgs(args))
! return NULL;
 
 result = PyDict_New();
! if (!result)
! return NULL;
 
 /* if LC_NUMERIC is different in the C library, use saved value */
***************
*** 320,324 ****
 PyObject *result;
 
! if(!PyArg_ParseTuple(args, "s:strxfrm", &s))
 return NULL;
 
--- 320,324 ----
 PyObject *result;
 
! if (!PyArg_ParseTuple(args, "s:strxfrm", &s))
 return NULL;
 
***************
*** 348,351 ****
--- 348,354 ----
 char locale[100];
 
+ if (!PyArg_NoArgs(args))
+ return NULL;
+ 
 sprintf(encoding, "cp%d", GetACP());
 
***************
*** 384,388 ****
 {"strxfrm", (PyCFunction) PyLocale_strxfrm, 1, strxfrm__doc__},
 #if defined(MS_WIN32)
! {"_getdefaultlocale", (PyCFunction) PyLocale_getdefaultlocale, 1},
 #endif
 {NULL, NULL}
--- 387,391 ----
 {"strxfrm", (PyCFunction) PyLocale_strxfrm, 1, strxfrm__doc__},
 #if defined(MS_WIN32)
! {"_getdefaultlocale", (PyCFunction) PyLocale_getdefaultlocale, 0},
 #endif
 {NULL, NULL}

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