Commit 2c7a6851 authored by Fred Drake's avatar Fred Drake

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.
parent c32cc7c1
...@@ -127,9 +127,6 @@ LONG Long (unbounded) integer; repr(i), then newline. ...@@ -127,9 +127,6 @@ LONG Long (unbounded) integer; repr(i), then newline.
static char MARKv = MARK; static char MARKv = MARK;
/* atol function from string module */
static PyObject *atol_func;
static PyObject *PickleError; static PyObject *PickleError;
static PyObject *PicklingError; static PyObject *PicklingError;
static PyObject *UnpickleableError; static PyObject *UnpickleableError;
...@@ -145,7 +142,7 @@ static PyObject *__class___str, *__getinitargs___str, *__dict___str, ...@@ -145,7 +142,7 @@ static PyObject *__class___str, *__getinitargs___str, *__dict___str,
*__getstate___str, *__setstate___str, *__name___str, *__reduce___str, *__getstate___str, *__setstate___str, *__name___str, *__reduce___str,
*write_str, *__safe_for_unpickling___str, *append_str, *write_str, *__safe_for_unpickling___str, *append_str,
*read_str, *readline_str, *__main___str, *__basicnew___str, *read_str, *readline_str, *__main___str, *__basicnew___str,
*copy_reg_str, *dispatch_table_str, *safe_constructors_str, *empty_str; *copy_reg_str, *dispatch_table_str, *safe_constructors_str;
#ifndef PyList_SET_ITEM #ifndef PyList_SET_ITEM
#define PyList_SET_ITEM(op, i, v) (((PyListObject *)(op))->ob_item[i] = (v)) #define PyList_SET_ITEM(op, i, v) (((PyListObject *)(op))->ob_item[i] = (v))
...@@ -1000,7 +997,8 @@ save_float(Picklerobject *self, PyObject *args) { ...@@ -1000,7 +997,8 @@ save_float(Picklerobject *self, PyObject *args) {
int s, e; int s, e;
double f; double f;
long fhi, flo; long fhi, flo;
char str[9], *p = str; char str[9];
unsigned char *p = (unsigned char *)str;
*p = BINFLOAT; *p = BINFLOAT;
p++; p++;
...@@ -1056,31 +1054,31 @@ save_float(Picklerobject *self, PyObject *args) { ...@@ -1056,31 +1054,31 @@ save_float(Picklerobject *self, PyObject *args) {
p++; p++;
/* Second byte */ /* Second byte */
*p = (char) (((e&0xF)<<4) | (fhi>>24)); *p = (unsigned char) (((e&0xF)<<4) | (fhi>>24));
p++; p++;
/* Third byte */ /* Third byte */
*p = (fhi>>16) & 0xFF; *p = (unsigned char) ((fhi>>16) & 0xFF);
p++; p++;
/* Fourth byte */ /* Fourth byte */
*p = (fhi>>8) & 0xFF; *p = (unsigned char) ((fhi>>8) & 0xFF);
p++; p++;
/* Fifth byte */ /* Fifth byte */
*p = fhi & 0xFF; *p = (unsigned char) (fhi & 0xFF);
p++; p++;
/* Sixth byte */ /* Sixth byte */
*p = (flo>>16) & 0xFF; *p = (unsigned char) ((flo>>16) & 0xFF);
p++; p++;
/* Seventh byte */ /* Seventh byte */
*p = (flo>>8) & 0xFF; *p = (unsigned char) ((flo>>8) & 0xFF);
p++; p++;
/* Eighth byte */ /* Eighth byte */
*p = flo & 0xFF; *p = (unsigned char) (flo & 0xFF);
if ((*self->write_func)(self, str, 9) < 0) if ((*self->write_func)(self, str, 9) < 0)
return -1; return -1;
...@@ -4458,7 +4456,7 @@ static struct PyMethodDef cPickle_methods[] = { ...@@ -4458,7 +4456,7 @@ static struct PyMethodDef cPickle_methods[] = {
static int static int
init_stuff(PyObject *module_dict) { init_stuff(PyObject *module_dict) {
PyObject *string, *copy_reg, *t, *r; PyObject *copy_reg, *t, *r;
#define INIT_STR(S) UNLESS(S ## _str=PyString_FromString(#S)) return -1; #define INIT_STR(S) UNLESS(S ## _str=PyString_FromString(#S)) return -1;
...@@ -4479,7 +4477,6 @@ init_stuff(PyObject *module_dict) { ...@@ -4479,7 +4477,6 @@ init_stuff(PyObject *module_dict) {
INIT_STR(dispatch_table); INIT_STR(dispatch_table);
INIT_STR(safe_constructors); INIT_STR(safe_constructors);
INIT_STR(__basicnew__); INIT_STR(__basicnew__);
UNLESS (empty_str=PyString_FromString("")) return -1;
UNLESS (copy_reg = PyImport_ImportModule("copy_reg")) UNLESS (copy_reg = PyImport_ImportModule("copy_reg"))
return -1; return -1;
...@@ -4498,14 +4495,6 @@ init_stuff(PyObject *module_dict) { ...@@ -4498,14 +4495,6 @@ init_stuff(PyObject *module_dict) {
/* Down to here ********************************** */ /* 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)) UNLESS (empty_tuple = PyTuple_New(0))
return -1; return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment