Clean up some minor gcc warnings. I'm not touching the
major one, though, which is the truly ugly stores into libpq private storage. Can't you find a better way to do this?
This commit is contained in:
parent
939229904a
commit
80dc7e207a
@ -30,8 +30,8 @@ static PGresult *res = NULL;
|
|||||||
|
|
||||||
static int on_error_state = ON_ERROR_STOP;
|
static int on_error_state = ON_ERROR_STOP;
|
||||||
|
|
||||||
static in_result_block = FALSE;
|
static int in_result_block = FALSE;
|
||||||
static was_get_unset_result = FALSE;
|
static int was_get_unset_result = FALSE;
|
||||||
|
|
||||||
/* LOCAL VARIABLES */
|
/* LOCAL VARIABLES */
|
||||||
static int tuple;
|
static int tuple;
|
||||||
@ -214,6 +214,7 @@ get_result()
|
|||||||
was_get_unset_result = TRUE;
|
was_get_unset_result = TRUE;
|
||||||
|
|
||||||
/* we have to store the fetch location somewhere */
|
/* we have to store the fetch location somewhere */
|
||||||
|
/* XXX THIS IS A NO-NO */
|
||||||
cmdstatus[0] = NUL;
|
cmdstatus[0] = NUL;
|
||||||
memcpy(&cmdstatus[1], &tuple, sizeof(tuple));
|
memcpy(&cmdstatus[1], &tuple, sizeof(tuple));
|
||||||
|
|
||||||
@ -235,13 +236,16 @@ set_result(PGresult *newres)
|
|||||||
halt("set_result called with null result pointer\n");
|
halt("set_result called with null result pointer\n");
|
||||||
|
|
||||||
if (res != NULL && was_get_unset_result == FALSE)
|
if (res != NULL && was_get_unset_result == FALSE)
|
||||||
|
{
|
||||||
if (in_result_block == FALSE)
|
if (in_result_block == FALSE)
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/* XXX THIS IS A NO-NO */
|
||||||
cmdstatus[0] = NUL;
|
cmdstatus[0] = NUL;
|
||||||
memcpy(&cmdstatus[1], &tuple, sizeof(tuple));
|
memcpy(&cmdstatus[1], &tuple, sizeof(tuple));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
in_result_block = TRUE;
|
in_result_block = TRUE;
|
||||||
was_get_unset_result = FALSE;
|
was_get_unset_result = FALSE;
|
||||||
@ -270,6 +274,8 @@ unset_result(PGresult *oldres)
|
|||||||
halt("Unset of result without being set.\n");
|
halt("Unset of result without being set.\n");
|
||||||
|
|
||||||
was_get_unset_result = TRUE;
|
was_get_unset_result = TRUE;
|
||||||
|
|
||||||
|
/* XXX THIS IS A NO-NO */
|
||||||
cmdstatus[0] = NUL;
|
cmdstatus[0] = NUL;
|
||||||
memcpy(&cmdstatus[1], &tuple, sizeof(tuple));
|
memcpy(&cmdstatus[1], &tuple, sizeof(tuple));
|
||||||
in_result_block = FALSE;
|
in_result_block = FALSE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user