Moved declarations of varaibles/pointers to the beginning of functions

Moved the declarations of varaibles/pointers to the beginning of the functions,
where MSVC requires them to be defined.
This commit is contained in:
Jason Erickson 2009-10-04 13:30:18 -06:00 committed by Federico Di Gregorio
parent 69224032ce
commit 0f00ee129d
2 changed files with 8 additions and 6 deletions

View File

@ -35,6 +35,7 @@
static void
conn_notice_callback(void *args, const char *message)
{
struct connectionObject_notice *notice;
connectionObject *self = (connectionObject *)args;
Dprintf("conn_notice_callback: %s", message);
@ -52,8 +53,7 @@ conn_notice_callback(void *args, const char *message)
if (self->protocol < 3 && strncmp(message, "ERROR", 5) == 0)
pq_set_critical(self, message);
else {
struct connectionObject_notice *notice =
(struct connectionObject_notice *)
notice = (struct connectionObject_notice *)
malloc(sizeof(struct connectionObject_notice));
notice->message = strdup(message);
notice->next = self->notice_pending;
@ -64,10 +64,11 @@ conn_notice_callback(void *args, const char *message)
void
conn_notice_process(connectionObject *self)
{
struct connectionObject_notice *notice;
Py_BEGIN_ALLOW_THREADS;
pthread_mutex_lock(&self->lock);
struct connectionObject_notice *notice = self->notice_pending;
notice = self->notice_pending;
while (notice != NULL) {
Py_BLOCK_THREADS;
@ -97,10 +98,11 @@ conn_notice_process(connectionObject *self)
void
conn_notice_clean(connectionObject *self)
{
struct connectionObject_notice *tmp, *notice;
Py_BEGIN_ALLOW_THREADS;
pthread_mutex_lock(&self->lock);
struct connectionObject_notice *tmp, *notice = self->notice_pending;
notice = self->notice_pending;
while (notice != NULL) {
tmp = notice;

View File

@ -684,7 +684,7 @@ static PyObject *
_psyco_curs_buildrow_fill(cursorObject *self, PyObject *res,
int row, int n, int istuple)
{
int i, len;
int i, len, err;
const char *str;
PyObject *val;
@ -713,7 +713,7 @@ _psyco_curs_buildrow_fill(cursorObject *self, PyObject *res,
PyTuple_SET_ITEM(res, i, val);
}
else {
int err = PySequence_SetItem(res, i, val);
err = PySequence_SetItem(res, i, val);
Py_DECREF(val);
if (err == -1) {
Py_DECREF(res);