summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Erickson <jerickso@stickpeople.com>2017-02-09 20:54:29 -0700
committerJason Erickson <jerickso@stickpeople.com>2017-02-09 20:54:29 -0700
commit83cf908c88de1b6feff51f5529a0d14491354c5d (patch)
tree449e005dbc3f0475b80bae8eff2a01e04a836a75
parent6f83c9c87aecfd46d180842ef76743ab50ab7486 (diff)
downloadpsycopg2-83cf908c88de1b6feff51f5529a0d14491354c5d.tar.gz
Fixed MSVC compiler error and warning
MSVC doesn't like referencing new initialized variables in the variable declaration section.
-rw-r--r--psycopg/pqpath.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/psycopg/pqpath.c b/psycopg/pqpath.c
index a268dac..59cbb5e 100644
--- a/psycopg/pqpath.c
+++ b/psycopg/pqpath.c
@@ -482,7 +482,7 @@ pq_begin_locked(connectionObject *conn, PGresult **pgres, char **error,
PyThreadState **tstate)
{
const size_t bufsize = 256;
- char buf[bufsize];
+ char buf[256]; /* buf size must be same as bufsize */
int result;
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);
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) {
if (pq_read_replication_message(repl, &msg) < 0) {