Commit d3c16d7d authored by Jim Fulton's avatar Jim Fulton

Cleaned up to avoid VC++ warnings.

parent 6bfad104
/* /*
$Id: cPickleCache.c,v 1.11 1997/12/10 22:20:43 jim Exp $ $Id: cPickleCache.c,v 1.12 1997/12/15 15:25:09 jim Exp $
C implementation of a pickle jar cache. C implementation of a pickle jar cache.
Copyright Copyright
Copyright 1996 Digital Creations, L.C., 910 Princess Anne Copyright 1996 Digital Creations, L.C., 910 Princess Anne
...@@ -11,12 +12,13 @@ ...@@ -11,12 +12,13 @@
rights reserved. rights reserved.
***************************************************************************/ ***************************************************************************/
static char *what_string = "$Id: cPickleCache.c,v 1.11 1997/12/10 22:20:43 jim Exp $"; static char *what_string = "$Id: cPickleCache.c,v 1.12 1997/12/15 15:25:09 jim Exp $";
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;} #define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define UNLESS(E) if(!(E)) #define UNLESS(E) if(!(E))
#define UNLESS_ASSIGN(V,E) ASSIGN(V,E) UNLESS(V) #define UNLESS_ASSIGN(V,E) ASSIGN(V,E) UNLESS(V)
#define Py_ASSIGN(P,E) if(!PyObject_AssignExpression(&(P),(E))) return NULL #define Py_ASSIGN(P,E) if(!PyObject_AssignExpression(&(P),(E))) return NULL
#define OBJECT(O) ((PyObject*)O)
#include "cPersistence.h" #include "cPersistence.h"
#include <time.h> #include <time.h>
...@@ -71,7 +73,6 @@ static PyObject *PATimeType=NULL; ...@@ -71,7 +73,6 @@ static PyObject *PATimeType=NULL;
static int static int
gc_item(ccobject *self, PyObject *key, PyObject *v, time_t now, time_t dt) gc_item(ccobject *self, PyObject *key, PyObject *v, time_t now, time_t dt)
{ {
PyObject *atime;
time_t t; time_t t;
if(v && key) if(v && key)
...@@ -317,7 +318,7 @@ cc_report(ccobject *self, PyObject *args) ...@@ -317,7 +318,7 @@ cc_report(ccobject *self, PyObject *args)
{ {
if(v->ob_type==(PyTypeObject*)PATimeType if(v->ob_type==(PyTypeObject*)PATimeType
&& ( && (
(t && ((PATimeobject*)v)->object->ob_type == t) (t && OBJECT(((PATimeobject*)v)->object->ob_type) == t)
|| ! t)) || ! t))
printf("%d\t%p\t%s\t%ld\t%d\t%ld\n", printf("%d\t%p\t%s\t%ld\t%d\t%ld\n",
(((PATimeobject*)v)->object->oid), (((PATimeobject*)v)->object->oid),
...@@ -326,7 +327,7 @@ cc_report(ccobject *self, PyObject *args) ...@@ -326,7 +327,7 @@ cc_report(ccobject *self, PyObject *args)
(long)(((PATimeobject*)v)->object->ob_refcnt), (long)(((PATimeobject*)v)->object->ob_refcnt),
(((PATimeobject*)v)->object->state), (((PATimeobject*)v)->object->state),
(long)(((PATimeobject*)v)->object->atime) ); (long)(((PATimeobject*)v)->object->atime) );
else if((t && ((PATimeobject*)v)->object->ob_type == t) else if((t && OBJECT(((PATimeobject*)v)->object->ob_type) == t)
|| ! t) || ! t)
printf("%d\t%p\t%s\t%ld\t%d\n", printf("%d\t%p\t%s\t%ld\t%d\n",
(((cPersistentObject*)v)->oid), (((cPersistentObject*)v)->oid),
...@@ -612,7 +613,7 @@ void ...@@ -612,7 +613,7 @@ void
initcPickleCache() initcPickleCache()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.11 $"; char *rev="$Revision: 1.12 $";
Cctype.ob_type=&PyType_Type; Cctype.ob_type=&PyType_Type;
...@@ -635,11 +636,16 @@ initcPickleCache() ...@@ -635,11 +636,16 @@ initcPickleCache()
PyString_FromStringAndSize(rev+11,strlen(rev+11)-2)); PyString_FromStringAndSize(rev+11,strlen(rev+11)-2));
#include "dcprotect.h"
if (PyErr_Occurred()) Py_FatalError("can't initialize module cCache"); if (PyErr_Occurred()) Py_FatalError("can't initialize module cCache");
} }
/****************************************************************************** /******************************************************************************
$Log: cPickleCache.c,v $ $Log: cPickleCache.c,v $
Revision 1.12 1997/12/15 15:25:09 jim
Cleaned up to avoid VC++ warnings.
Revision 1.11 1997/12/10 22:20:43 jim Revision 1.11 1997/12/10 22:20:43 jim
Added has_key method. Added has_key method.
......
/* /*
$Id: cPickleCache.c,v 1.11 1997/12/10 22:20:43 jim Exp $ $Id: cPickleCache.c,v 1.12 1997/12/15 15:25:09 jim Exp $
C implementation of a pickle jar cache. C implementation of a pickle jar cache.
Copyright Copyright
Copyright 1996 Digital Creations, L.C., 910 Princess Anne Copyright 1996 Digital Creations, L.C., 910 Princess Anne
...@@ -11,12 +12,13 @@ ...@@ -11,12 +12,13 @@
rights reserved. rights reserved.
***************************************************************************/ ***************************************************************************/
static char *what_string = "$Id: cPickleCache.c,v 1.11 1997/12/10 22:20:43 jim Exp $"; static char *what_string = "$Id: cPickleCache.c,v 1.12 1997/12/15 15:25:09 jim Exp $";
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;} #define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define UNLESS(E) if(!(E)) #define UNLESS(E) if(!(E))
#define UNLESS_ASSIGN(V,E) ASSIGN(V,E) UNLESS(V) #define UNLESS_ASSIGN(V,E) ASSIGN(V,E) UNLESS(V)
#define Py_ASSIGN(P,E) if(!PyObject_AssignExpression(&(P),(E))) return NULL #define Py_ASSIGN(P,E) if(!PyObject_AssignExpression(&(P),(E))) return NULL
#define OBJECT(O) ((PyObject*)O)
#include "cPersistence.h" #include "cPersistence.h"
#include <time.h> #include <time.h>
...@@ -71,7 +73,6 @@ static PyObject *PATimeType=NULL; ...@@ -71,7 +73,6 @@ static PyObject *PATimeType=NULL;
static int static int
gc_item(ccobject *self, PyObject *key, PyObject *v, time_t now, time_t dt) gc_item(ccobject *self, PyObject *key, PyObject *v, time_t now, time_t dt)
{ {
PyObject *atime;
time_t t; time_t t;
if(v && key) if(v && key)
...@@ -317,7 +318,7 @@ cc_report(ccobject *self, PyObject *args) ...@@ -317,7 +318,7 @@ cc_report(ccobject *self, PyObject *args)
{ {
if(v->ob_type==(PyTypeObject*)PATimeType if(v->ob_type==(PyTypeObject*)PATimeType
&& ( && (
(t && ((PATimeobject*)v)->object->ob_type == t) (t && OBJECT(((PATimeobject*)v)->object->ob_type) == t)
|| ! t)) || ! t))
printf("%d\t%p\t%s\t%ld\t%d\t%ld\n", printf("%d\t%p\t%s\t%ld\t%d\t%ld\n",
(((PATimeobject*)v)->object->oid), (((PATimeobject*)v)->object->oid),
...@@ -326,7 +327,7 @@ cc_report(ccobject *self, PyObject *args) ...@@ -326,7 +327,7 @@ cc_report(ccobject *self, PyObject *args)
(long)(((PATimeobject*)v)->object->ob_refcnt), (long)(((PATimeobject*)v)->object->ob_refcnt),
(((PATimeobject*)v)->object->state), (((PATimeobject*)v)->object->state),
(long)(((PATimeobject*)v)->object->atime) ); (long)(((PATimeobject*)v)->object->atime) );
else if((t && ((PATimeobject*)v)->object->ob_type == t) else if((t && OBJECT(((PATimeobject*)v)->object->ob_type) == t)
|| ! t) || ! t)
printf("%d\t%p\t%s\t%ld\t%d\n", printf("%d\t%p\t%s\t%ld\t%d\n",
(((cPersistentObject*)v)->oid), (((cPersistentObject*)v)->oid),
...@@ -612,7 +613,7 @@ void ...@@ -612,7 +613,7 @@ void
initcPickleCache() initcPickleCache()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.11 $"; char *rev="$Revision: 1.12 $";
Cctype.ob_type=&PyType_Type; Cctype.ob_type=&PyType_Type;
...@@ -635,11 +636,16 @@ initcPickleCache() ...@@ -635,11 +636,16 @@ initcPickleCache()
PyString_FromStringAndSize(rev+11,strlen(rev+11)-2)); PyString_FromStringAndSize(rev+11,strlen(rev+11)-2));
#include "dcprotect.h"
if (PyErr_Occurred()) Py_FatalError("can't initialize module cCache"); if (PyErr_Occurred()) Py_FatalError("can't initialize module cCache");
} }
/****************************************************************************** /******************************************************************************
$Log: cPickleCache.c,v $ $Log: cPickleCache.c,v $
Revision 1.12 1997/12/15 15:25:09 jim
Cleaned up to avoid VC++ warnings.
Revision 1.11 1997/12/10 22:20:43 jim Revision 1.11 1997/12/10 22:20:43 jim
Added has_key method. Added has_key method.
......
/* /*
$Id: cPickleCache.c,v 1.11 1997/12/10 22:20:43 jim Exp $ $Id: cPickleCache.c,v 1.12 1997/12/15 15:25:09 jim Exp $
C implementation of a pickle jar cache. C implementation of a pickle jar cache.
Copyright Copyright
Copyright 1996 Digital Creations, L.C., 910 Princess Anne Copyright 1996 Digital Creations, L.C., 910 Princess Anne
...@@ -11,12 +12,13 @@ ...@@ -11,12 +12,13 @@
rights reserved. rights reserved.
***************************************************************************/ ***************************************************************************/
static char *what_string = "$Id: cPickleCache.c,v 1.11 1997/12/10 22:20:43 jim Exp $"; static char *what_string = "$Id: cPickleCache.c,v 1.12 1997/12/15 15:25:09 jim Exp $";
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;} #define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define UNLESS(E) if(!(E)) #define UNLESS(E) if(!(E))
#define UNLESS_ASSIGN(V,E) ASSIGN(V,E) UNLESS(V) #define UNLESS_ASSIGN(V,E) ASSIGN(V,E) UNLESS(V)
#define Py_ASSIGN(P,E) if(!PyObject_AssignExpression(&(P),(E))) return NULL #define Py_ASSIGN(P,E) if(!PyObject_AssignExpression(&(P),(E))) return NULL
#define OBJECT(O) ((PyObject*)O)
#include "cPersistence.h" #include "cPersistence.h"
#include <time.h> #include <time.h>
...@@ -71,7 +73,6 @@ static PyObject *PATimeType=NULL; ...@@ -71,7 +73,6 @@ static PyObject *PATimeType=NULL;
static int static int
gc_item(ccobject *self, PyObject *key, PyObject *v, time_t now, time_t dt) gc_item(ccobject *self, PyObject *key, PyObject *v, time_t now, time_t dt)
{ {
PyObject *atime;
time_t t; time_t t;
if(v && key) if(v && key)
...@@ -317,7 +318,7 @@ cc_report(ccobject *self, PyObject *args) ...@@ -317,7 +318,7 @@ cc_report(ccobject *self, PyObject *args)
{ {
if(v->ob_type==(PyTypeObject*)PATimeType if(v->ob_type==(PyTypeObject*)PATimeType
&& ( && (
(t && ((PATimeobject*)v)->object->ob_type == t) (t && OBJECT(((PATimeobject*)v)->object->ob_type) == t)
|| ! t)) || ! t))
printf("%d\t%p\t%s\t%ld\t%d\t%ld\n", printf("%d\t%p\t%s\t%ld\t%d\t%ld\n",
(((PATimeobject*)v)->object->oid), (((PATimeobject*)v)->object->oid),
...@@ -326,7 +327,7 @@ cc_report(ccobject *self, PyObject *args) ...@@ -326,7 +327,7 @@ cc_report(ccobject *self, PyObject *args)
(long)(((PATimeobject*)v)->object->ob_refcnt), (long)(((PATimeobject*)v)->object->ob_refcnt),
(((PATimeobject*)v)->object->state), (((PATimeobject*)v)->object->state),
(long)(((PATimeobject*)v)->object->atime) ); (long)(((PATimeobject*)v)->object->atime) );
else if((t && ((PATimeobject*)v)->object->ob_type == t) else if((t && OBJECT(((PATimeobject*)v)->object->ob_type) == t)
|| ! t) || ! t)
printf("%d\t%p\t%s\t%ld\t%d\n", printf("%d\t%p\t%s\t%ld\t%d\n",
(((cPersistentObject*)v)->oid), (((cPersistentObject*)v)->oid),
...@@ -612,7 +613,7 @@ void ...@@ -612,7 +613,7 @@ void
initcPickleCache() initcPickleCache()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.11 $"; char *rev="$Revision: 1.12 $";
Cctype.ob_type=&PyType_Type; Cctype.ob_type=&PyType_Type;
...@@ -635,11 +636,16 @@ initcPickleCache() ...@@ -635,11 +636,16 @@ initcPickleCache()
PyString_FromStringAndSize(rev+11,strlen(rev+11)-2)); PyString_FromStringAndSize(rev+11,strlen(rev+11)-2));
#include "dcprotect.h"
if (PyErr_Occurred()) Py_FatalError("can't initialize module cCache"); if (PyErr_Occurred()) Py_FatalError("can't initialize module cCache");
} }
/****************************************************************************** /******************************************************************************
$Log: cPickleCache.c,v $ $Log: cPickleCache.c,v $
Revision 1.12 1997/12/15 15:25:09 jim
Cleaned up to avoid VC++ warnings.
Revision 1.11 1997/12/10 22:20:43 jim Revision 1.11 1997/12/10 22:20:43 jim
Added has_key method. Added has_key method.
......
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