diff options
author | Guido van Rossum <guido@python.org> | 2000-01-20 22:32:56 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2000-01-20 22:32:56 (GMT) |
commit | bffd683f7356d92d4504b2bcaa7221fab3f52f4e (patch) | |
tree | fb68ae112139013c715e82c4b03678feab52ab21 | |
parent | e0a928dc1ec74f487471d102ae6efacc92055aa6 (diff) | |
download | cpython-bffd683f7356d92d4504b2bcaa7221fab3f52f4e.zip cpython-bffd683f7356d92d4504b2bcaa7221fab3f52f4e.tar.gz cpython-bffd683f7356d92d4504b2bcaa7221fab3f52f4e.tar.bz2 |
The rest of the changes by Trent Mick and Dale Nagata for warning-free
compilation on NT Alpha. Mostly added casts etc.
-rw-r--r-- | Include/object.h | 1 | ||||
-rw-r--r-- | Modules/arraymodule.c | 2 | ||||
-rw-r--r-- | Objects/classobject.c | 6 | ||||
-rw-r--r-- | Objects/complexobject.c | 2 | ||||
-rw-r--r-- | Objects/floatobject.c | 2 | ||||
-rw-r--r-- | Objects/frameobject.c | 4 | ||||
-rw-r--r-- | Objects/intobject.c | 2 | ||||
-rw-r--r-- | Objects/listobject.c | 2 | ||||
-rw-r--r-- | Objects/methodobject.c | 2 | ||||
-rw-r--r-- | Objects/object.c | 6 | ||||
-rw-r--r-- | Objects/stringobject.c | 8 | ||||
-rw-r--r-- | Objects/tupleobject.c | 6 | ||||
-rw-r--r-- | PC/config.h | 7 | ||||
-rw-r--r-- | Python/pythonrun.c | 4 | ||||
-rw-r--r-- | Python/thread_nt.h | 2 |
15 files changed, 34 insertions, 22 deletions
diff --git a/Include/object.h b/Include/object.h index de3f502..4375949 100644 --- a/Include/object.h +++ b/Include/object.h @@ -362,6 +362,7 @@ extern DL_IMPORT(void) _Py_Dealloc Py_PROTO((PyObject *)); extern DL_IMPORT(void) _Py_NewReference Py_PROTO((PyObject *)); extern DL_IMPORT(void) _Py_ForgetReference Py_PROTO((PyObject *)); extern DL_IMPORT(void) _Py_PrintReferences Py_PROTO((FILE *)); +extern DL_IMPORT(void) _Py_ResetReferences Py_PROTO((void)); #endif #ifndef Py_TRACE_REFS diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index fc7bf07..396b9cf 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -363,7 +363,7 @@ newarrayobject(size, descr) op->ob_type = &Arraytype; op->ob_size = size; op->ob_descr = descr; - _Py_NewReference(op); + _Py_NewReference((PyObject *)op); return (PyObject *) op; } diff --git a/Objects/classobject.c b/Objects/classobject.c index 6d49228..adf49ba 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -504,7 +504,7 @@ instance_dealloc(inst) /* much too complicated if Py_TRACE_REFS defined */ extern long _Py_RefTotal; inst->ob_type = &PyInstance_Type; - _Py_NewReference(inst); + _Py_NewReference((PyObject *)inst); _Py_RefTotal--; /* compensate for increment in NEWREF */ #ifdef COUNT_ALLOCS inst->ob_type->tp_alloc--; /* ditto */ @@ -556,7 +556,7 @@ instance_dealloc(inst) #ifdef COUNT_ALLOCS inst->ob_type->tp_free--; /* compensate for increment in UNREF */ #endif - _Py_ForgetReference(inst); + _Py_ForgetReference((PyObject *)inst); inst->ob_type = NULL; #endif /* Py_TRACE_REFS */ Py_DECREF(inst->in_class); @@ -1431,7 +1431,7 @@ PyMethod_New(func, self, class) if (im != NULL) { free_list = (PyMethodObject *)(im->im_self); im->ob_type = &PyMethod_Type; - _Py_NewReference(im); + _Py_NewReference((PyObject *)im); } else { im = PyObject_NEW(PyMethodObject, &PyMethod_Type); diff --git a/Objects/complexobject.c b/Objects/complexobject.c index e8447bb..ac95e8b 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -172,7 +172,7 @@ PyComplex_FromCComplex(cval) return PyErr_NoMemory(); op->ob_type = &PyComplex_Type; op->cval = cval; - _Py_NewReference(op); + _Py_NewReference((PyObject *)op); return (PyObject *) op; } diff --git a/Objects/floatobject.c b/Objects/floatobject.c index 557a641..6430a98 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -145,7 +145,7 @@ PyFloat_FromDouble(fval) free_list = (PyFloatObject *)op->ob_type; op->ob_type = &PyFloat_Type; op->ob_fval = fval; - _Py_NewReference(op); + _Py_NewReference((PyObject *)op); return (PyObject *) op; } diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 64fc52f..dcd760c 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -184,7 +184,7 @@ PyFrame_New(tstate, code, globals, locals) if (f == NULL) return (PyFrameObject *)PyErr_NoMemory(); f->ob_type = &PyFrame_Type; - _Py_NewReference(f); + _Py_NewReference((PyObject *)f); } else { f = free_list; @@ -199,7 +199,7 @@ PyFrame_New(tstate, code, globals, locals) else extras = f->f_nlocals + f->f_stacksize; f->ob_type = &PyFrame_Type; - _Py_NewReference(f); + _Py_NewReference((PyObject *)f); } if (builtins == NULL) { /* No builtins! Make up a minimal one. */ diff --git a/Objects/intobject.c b/Objects/intobject.c index 45c2186..00fdf82 100644 --- a/Objects/intobject.c +++ b/Objects/intobject.c @@ -168,7 +168,7 @@ PyInt_FromLong(ival) free_list = (PyIntObject *)v->ob_type; v->ob_type = &PyInt_Type; v->ob_ival = ival; - _Py_NewReference(v); + _Py_NewReference((PyObject *)v); #if NSMALLNEGINTS + NSMALLPOSINTS > 0 if (-NSMALLNEGINTS <= ival && ival < NSMALLPOSINTS) { /* save this one for a following allocation */ diff --git a/Objects/listobject.c b/Objects/listobject.c index 0342cdc..4caa6df 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -88,7 +88,7 @@ PyList_New(size) op->ob_size = size; for (i = 0; i < size; i++) op->ob_item[i] = NULL; - _Py_NewReference(op); + _Py_NewReference((PyObject *)op); return (PyObject *) op; } diff --git a/Objects/methodobject.c b/Objects/methodobject.c index e7de73a..5c69744 100644 --- a/Objects/methodobject.c +++ b/Objects/methodobject.c @@ -47,7 +47,7 @@ PyCFunction_New(ml, self) if (op != NULL) { free_list = (PyCFunctionObject *)(op->m_self); op->ob_type = &PyCFunction_Type; - _Py_NewReference(op); + _Py_NewReference((PyObject *)op); } else { op = PyObject_NEW(PyCFunctionObject, &PyCFunction_Type); diff --git a/Objects/object.c b/Objects/object.c index ee9c271..69ad23d 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -34,7 +34,7 @@ PERFORMANCE OF THIS SOFTWARE. #include "Python.h" #if defined( Py_TRACE_REFS ) || defined( Py_REF_DEBUG ) -long _Py_RefTotal; +DL_IMPORT(long) _Py_RefTotal; #endif /* Object allocation routines used by NEWOBJ and NEWVAROBJ macros. @@ -149,7 +149,7 @@ _PyObject_NewVar(tp, size, op) return (PyVarObject *)PyErr_NoMemory(); op->ob_type = tp; op->ob_size = size; - _Py_NewReference(op); + _Py_NewReference((PyObject *)op); return op; } @@ -651,7 +651,9 @@ void _Py_ForgetReference(op) register PyObject *op; { +#ifdef SLOW_UNREF_CHECK register PyObject *p; +#endif if (op->ob_refcnt < 0) Py_FatalError("UNREF negative refcnt"); if (op == &refchain || diff --git a/Objects/stringobject.c b/Objects/stringobject.c index dc47f9e..cb264e9 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -104,7 +104,7 @@ PyString_FromStringAndSize(str, size) #ifdef INTERN_STRINGS op->ob_sinterned = NULL; #endif - _Py_NewReference(op); + _Py_NewReference((PyObject *)op); if (str != NULL) memcpy(op->ob_sval, str, size); op->ob_sval[size] = '\0'; @@ -154,7 +154,7 @@ PyString_FromString(str) #ifdef INTERN_STRINGS op->ob_sinterned = NULL; #endif - _Py_NewReference(op); + _Py_NewReference((PyObject *)op); strcpy(op->ob_sval, str); #ifndef DONT_SHARE_SHORT_STRINGS if (size == 0) { @@ -317,7 +317,7 @@ string_concat(a, bb) #ifdef INTERN_STRINGS op->ob_sinterned = NULL; #endif - _Py_NewReference(op); + _Py_NewReference((PyObject *)op); memcpy(op->ob_sval, a->ob_sval, (int) a->ob_size); memcpy(op->ob_sval + a->ob_size, b->ob_sval, (int) b->ob_size); op->ob_sval[size] = '\0'; @@ -352,7 +352,7 @@ string_repeat(a, n) #ifdef INTERN_STRINGS op->ob_sinterned = NULL; #endif - _Py_NewReference(op); + _Py_NewReference((PyObject *)op); for (i = 0; i < size; i += a->ob_size) memcpy(op->ob_sval+i, a->ob_sval, (int) a->ob_size); op->ob_sval[size] = '\0'; diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index 18b3315..568c4b3 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -100,7 +100,7 @@ PyTuple_New(size) } for (i = 0; i < size; i++) op->ob_item[i] = NULL; - _Py_NewReference(op); + _Py_NewReference((PyObject *)op); #if MAXSAVESIZE > 0 if (size == 0) { free_tuples[0] = op; @@ -452,7 +452,7 @@ _PyTuple_Resize(pv, newsize, last_is_sticky) #ifdef Py_REF_DEBUG --_Py_RefTotal; #endif - _Py_ForgetReference(v); + _Py_ForgetReference((PyObject *)v); if (last_is_sticky && sizediff < 0) { /* shrinking: move entries to the front and zero moved entries */ @@ -475,7 +475,7 @@ _PyTuple_Resize(pv, newsize, last_is_sticky) PyErr_NoMemory(); return -1; } - _Py_NewReference(sv); + _Py_NewReference((PyObject *)sv); for (i = sv->ob_size; i < newsize; i++) sv->ob_item[i] = NULL; if (last_is_sticky && sizediff > 0) { diff --git a/PC/config.h b/PC/config.h index 3a02da8..c1e4f84 100644 --- a/PC/config.h +++ b/PC/config.h @@ -61,6 +61,8 @@ you must define MS_NO_COREDLL (do not test this macro) */ #ifdef _M_IX86 #define COMPILER "[MSC 32 bit (Intel)]" +#elif defined(_M_ALPHA) +#define COMPILER "[MSC 32 bit (Alpha)]" #else #define COMPILER "[MSC (Unknown)]" #endif @@ -213,13 +215,16 @@ typedef int pid_t; #ifndef USE_DL_EXPORT /* So nobody needs to specify the .lib in their Makefile any more */ #ifdef _DEBUG -#define Py_DEBUG #pragma comment(lib,"python15_d.lib") #else #pragma comment(lib,"python15.lib") #endif #endif /* USE_DL_EXPORT */ +#ifdef _DEBUG +#define Py_DEBUG +#endif + #define SIZEOF_INT 4 #define SIZEOF_LONG 4 #define SIZEOF_LONG_LONG 8 diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 4e16320..0814038 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -72,6 +72,10 @@ static void initsigs Py_PROTO((void)); static void call_sys_exitfunc Py_PROTO((void)); static void call_ll_exitfuncs Py_PROTO((void)); +#ifdef Py_TRACE_REFS +int _Py_AskYesNo(char *prompt); +#endif + int Py_DebugFlag; /* Needed by parser.c */ int Py_VerboseFlag; /* Needed by import.c */ int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */ diff --git a/Python/thread_nt.h b/Python/thread_nt.h index 0044551..7e2ccbc 100644 --- a/Python/thread_nt.h +++ b/Python/thread_nt.h @@ -65,7 +65,7 @@ int PyThread_start_new_thread(void (*func)(void *), void *arg) if (rv != -1) { success = 1; - dprintf(("%ld: PyThread_start_new_thread succeeded: %ld\n", PyThread_get_thread_ident(), aThreadId)); + dprintf(("%ld: PyThread_start_new_thread succeeded: %ld\n", PyThread_get_thread_ident(), rv)); } return success; |