Skip to content

Commit aca615c

Browse files
committed
Fix compile warnings for uuid type
1 parent 635e04a commit aca615c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

uuid.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import functools
22
import uuid
33

4-
from libc.stdint cimport uint64_t, uint8_t
4+
from libc.stdint cimport uint64_t, uint8_t, int8_t
55
from libc.string cimport memcpy
66

77

@@ -40,7 +40,7 @@ cdef inline char i64_to_hex(uint64_t num, char *s):
4040
return 0
4141

4242

43-
cdef pg_uuid_from_buf(char *buf):
43+
cdef pg_uuid_from_buf(const char *buf):
4444
cdef:
4545
PgBaseUUID u = UUID.__new__(UUID)
4646
memcpy(u._data, buf, 16)
@@ -69,7 +69,7 @@ cdef pg_uuid_bytes_from_str(str u, char *out):
6969
if ch == <unsigned char>b'-':
7070
continue
7171

72-
part = _hextable[ch]
72+
part = <uint8_t><int8_t>_hextable[ch]
7373
if part == <uint8_t>-1:
7474
if ch >= 0x20 and ch <= 0x7e:
7575
raise ValueError(

0 commit comments

Comments
 (0)