mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-26 10:53:44 +03:00
Fixed MSVC compiler error and warning
MSVC doesn't like referencing new initialized variables in the variable declaration section.
This commit is contained in:
parent
6f83c9c87a
commit
83cf908c88
|
@ -482,7 +482,7 @@ pq_begin_locked(connectionObject *conn, PGresult **pgres, char **error,
|
||||||
PyThreadState **tstate)
|
PyThreadState **tstate)
|
||||||
{
|
{
|
||||||
const size_t bufsize = 256;
|
const size_t bufsize = 256;
|
||||||
char buf[bufsize];
|
char buf[256]; /* buf size must be same as bufsize */
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
Dprintf("pq_begin_locked: pgconn = %p, autocommit = %d, status = %d",
|
Dprintf("pq_begin_locked: pgconn = %p, autocommit = %d, status = %d",
|
||||||
|
@ -1786,7 +1786,7 @@ pq_copy_both(replicationCursorObject *repl, PyObject *consume, double keepalive_
|
||||||
CLEARPGRES(curs->pgres);
|
CLEARPGRES(curs->pgres);
|
||||||
|
|
||||||
keep_intr.tv_sec = (int)keepalive_interval;
|
keep_intr.tv_sec = (int)keepalive_interval;
|
||||||
keep_intr.tv_usec = (keepalive_interval - keep_intr.tv_sec)*1.0e6;
|
keep_intr.tv_usec = (long)((keepalive_interval - keep_intr.tv_sec)*1.0e6);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
if (pq_read_replication_message(repl, &msg) < 0) {
|
if (pq_read_replication_message(repl, &msg) < 0) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user