Skip to content

Commit 50856c8

Browse files
committed
Silence a few -Wmaybe-uninitialized warnings
1 parent 343e98e commit 50856c8

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

asyncpg/protocol/codecs/datetime.pyx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ cdef timestamp_encode(ConnectionSettings settings, WriteBuffer buf, obj):
127127

128128
cdef timestamp_decode(ConnectionSettings settings, FastReadBuffer buf):
129129
cdef:
130-
int64_t seconds
131-
uint32_t microseconds
130+
int64_t seconds = 0
131+
uint32_t microseconds = 0
132132
int32_t inf = _decode_time(buf, &seconds, &microseconds)
133133

134134
if inf > 0:
@@ -163,8 +163,8 @@ cdef timestamptz_encode(ConnectionSettings settings, WriteBuffer buf, obj):
163163

164164
cdef timestamptz_decode(ConnectionSettings settings, FastReadBuffer buf):
165165
cdef:
166-
int64_t seconds
167-
uint32_t microseconds
166+
int64_t seconds = 0
167+
uint32_t microseconds = 0
168168
int32_t inf = _decode_time(buf, &seconds, &microseconds)
169169

170170
if inf > 0:
@@ -191,8 +191,8 @@ cdef time_encode(ConnectionSettings settings, WriteBuffer buf, obj):
191191

192192
cdef time_decode(ConnectionSettings settings, FastReadBuffer buf):
193193
cdef:
194-
int64_t seconds
195-
uint32_t microseconds
194+
int64_t seconds = 0
195+
uint32_t microseconds = 0
196196

197197
_decode_time(buf, &seconds, &microseconds)
198198

@@ -243,8 +243,8 @@ cdef interval_decode(ConnectionSettings settings, FastReadBuffer buf):
243243
cdef:
244244
int32_t days
245245
int32_t months
246-
int64_t seconds
247-
uint32_t microseconds
246+
int64_t seconds = 0
247+
uint32_t microseconds = 0
248248

249249
_decode_time(buf, &seconds, &microseconds)
250250
days = hton.unpack_int32(buf.read(4))

asyncpg/protocol/codecs/geometry.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ cdef point_decode(ConnectionSettings settings, FastReadBuffer buf):
9797

9898
cdef path_encode(ConnectionSettings settings, WriteBuffer wbuf, obj):
9999
cdef:
100-
bint is_closed
100+
bint is_closed = 0
101101
int32_t npts
102102
int32_t i
103103

0 commit comments

Comments
 (0)