From 9056a39c023d19601df98cc230696684e82d799a Mon Sep 17 00:00:00 2001 From: Ildar Musin Date: Tue, 14 Jul 2020 17:26:31 +0200 Subject: [PATCH 1/2] Fix compilation warnings in crc32.c --- src/crc32.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/crc32.c b/src/crc32.c index da8cc19..0db7a29 100644 --- a/src/crc32.c +++ b/src/crc32.c @@ -19,9 +19,6 @@ crc32_in(PG_FUNCTION_ARGS) errmsg("crc32 value cannot exceed 32 bits"))); } - crc32 *out = palloc(sizeof(crc32)); - - char *p; errno = 0; long int pout = strtol(in, &p, 16); @@ -35,16 +32,14 @@ crc32_in(PG_FUNCTION_ARGS) /* I don't check if pout overflows uint32 because it's restricted by string * length check above. */ - out = (uint32_t)pout; - - PG_RETURN_CRC32(out); + PG_RETURN_CRC32(pout); } PG_FUNCTION_INFO_V1(crc32_out); Datum crc32_out(PG_FUNCTION_ARGS) { - crc32 *in = PG_GETARG_CRC32(0); + crc32 in = PG_GETARG_CRC32(0); char *out = (char *) palloc(10); snprintf(out, 10, "%08x", in); PG_RETURN_CSTRING(out); From afe2d1177b7af952bf9445f510234ec1095d20c5 Mon Sep 17 00:00:00 2001 From: Ildar Musin Date: Tue, 14 Jul 2020 18:33:05 +0200 Subject: [PATCH 2/2] Fix compilation warnings in md5.c --- src/md5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/md5.c b/src/md5.c index e106cf1..001de90 100644 --- a/src/md5.c +++ b/src/md5.c @@ -75,7 +75,7 @@ md5_recv(PG_FUNCTION_ARGS) result = palloc(sizeof(Md5)); - pq_copymsgbytes(buf, result->bytes, nbytes); + pq_copymsgbytes(buf, (char *) result->bytes, nbytes); PG_RETURN_MD5(result); }