[Python-checkins] CVS: python/dist/src/Modules cPickle.c,2.59,2.60

Fred L. Drake fdrake@users.sourceforge.net
2001年7月17日 11:34:06 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv22092/Modules
Modified Files:
	cPickle.c 
Log Message:
Remove code to initialize globals that are never used.
Add some casts to quiet warnings from an unspecified non-GCC compiler.
This closes SF patch #436258.
Index: cPickle.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/cPickle.c,v
retrieving revision 2.59
retrieving revision 2.60
diff -C2 -r2.59 -r2.60
*** cPickle.c	2001年04月10日 04:35:28	2.59
--- cPickle.c	2001年07月17日 18:34:03	2.60
***************
*** 128,134 ****
 static char MARKv = MARK;
 
- /* atol function from string module */
- static PyObject *atol_func;
- 
 static PyObject *PickleError;
 static PyObject *PicklingError;
--- 128,131 ----
***************
*** 146,150 ****
 *write_str, *__safe_for_unpickling___str, *append_str,
 *read_str, *readline_str, *__main___str, *__basicnew___str,
! *copy_reg_str, *dispatch_table_str, *safe_constructors_str, *empty_str;
 
 #ifndef PyList_SET_ITEM
--- 143,147 ----
 *write_str, *__safe_for_unpickling___str, *append_str,
 *read_str, *readline_str, *__main___str, *__basicnew___str,
! *copy_reg_str, *dispatch_table_str, *safe_constructors_str;
 
 #ifndef PyList_SET_ITEM
***************
*** 1001,1005 ****
 double f;
 long fhi, flo;
! char str[9], *p = str;
 
 *p = BINFLOAT;
--- 998,1003 ----
 double f;
 long fhi, flo;
! char str[9];
! unsigned char *p = (unsigned char *)str;
 
 *p = BINFLOAT;
***************
*** 1057,1085 ****
 
 /* Second byte */
! *p = (char) (((e&0xF)<<4) | (fhi>>24));
 p++;
 
 /* Third byte */
! *p = (fhi>>16) & 0xFF;
 p++;
 
 /* Fourth byte */
! *p = (fhi>>8) & 0xFF;
 p++;
 
 /* Fifth byte */
! *p = fhi & 0xFF;
 p++;
 
 /* Sixth byte */
! *p = (flo>>16) & 0xFF;
 p++;
 
 /* Seventh byte */
! *p = (flo>>8) & 0xFF;
 p++;
 
 /* Eighth byte */
! *p = flo & 0xFF;
 
 if ((*self->write_func)(self, str, 9) < 0)
--- 1055,1083 ----
 
 /* Second byte */
! *p = (unsigned char) (((e&0xF)<<4) | (fhi>>24));
 p++;
 
 /* Third byte */
! *p = (unsigned char) ((fhi>>16) & 0xFF);
 p++;
 
 /* Fourth byte */
! *p = (unsigned char) ((fhi>>8) & 0xFF);
 p++;
 
 /* Fifth byte */
! *p = (unsigned char) (fhi & 0xFF);
 p++;
 
 /* Sixth byte */
! *p = (unsigned char) ((flo>>16) & 0xFF);
 p++;
 
 /* Seventh byte */
! *p = (unsigned char) ((flo>>8) & 0xFF);
 p++;
 
 /* Eighth byte */
! *p = (unsigned char) (flo & 0xFF);
 
 if ((*self->write_func)(self, str, 9) < 0)
***************
*** 4459,4463 ****
 static int
 init_stuff(PyObject *module_dict) {
! PyObject *string, *copy_reg, *t, *r;
 
 #define INIT_STR(S) UNLESS(S ## _str=PyString_FromString(#S)) return -1;
--- 4457,4461 ----
 static int
 init_stuff(PyObject *module_dict) {
! PyObject *copy_reg, *t, *r;
 
 #define INIT_STR(S) UNLESS(S ## _str=PyString_FromString(#S)) return -1;
***************
*** 4480,4484 ****
 INIT_STR(safe_constructors);
 INIT_STR(__basicnew__);
- UNLESS (empty_str=PyString_FromString("")) return -1;
 
 UNLESS (copy_reg = PyImport_ImportModule("copy_reg"))
--- 4478,4481 ----
***************
*** 4498,4509 ****
 
 /* Down to here ********************************** */
- 
- UNLESS (string = PyImport_ImportModule("string"))
- return -1;
- 
- UNLESS (atol_func = PyObject_GetAttrString(string, "atol"))
- return -1;
- 
- Py_DECREF(string);
 
 UNLESS (empty_tuple = PyTuple_New(0))
--- 4495,4498 ----

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