From fbb2e9a030ee7a3fa20ce402e4b1da9809b4eb52 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 2 May 2018 15:52:54 -0400 Subject: Fix assorted compiler warnings seen in the buildfarm. Failure to use DatumGetFoo/FooGetDatum macros correctly, or at all, causes some warnings about sign conversion. This is just cosmetic at the moment but in principle it's a type violation, so clean up the instances I could find. autoprewarm.c and sharedfileset.c contained code that unportably assumed that pid_t is the same size as int. We've variously dealt with this by casting pid_t to int or to unsigned long for printing purposes; I went with the latter. Fix uninitialized-variable warning in RestoreGUCState. This is a live bug in some sense, but of no great significance given that nobody is very likely to care what "line number" is associated with a GUC that hasn't got a source file recorded. --- contrib/jsonb_plpython/jsonb_plpython.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'contrib/jsonb_plpython') diff --git a/contrib/jsonb_plpython/jsonb_plpython.c b/contrib/jsonb_plpython/jsonb_plpython.c index 08a7598aae3..645238f15b3 100644 --- a/contrib/jsonb_plpython/jsonb_plpython.c +++ b/contrib/jsonb_plpython/jsonb_plpython.c @@ -325,8 +325,13 @@ PLyNumber_ToJsonbValue(PyObject *obj, JsonbValue *jbvNum) PG_TRY(); { - num = DatumGetNumeric(DirectFunctionCall3(numeric_in, - CStringGetDatum(str), 0, -1)); + Datum numd; + + numd = DirectFunctionCall3(numeric_in, + CStringGetDatum(str), + ObjectIdGetDatum(InvalidOid), + Int32GetDatum(-1)); + num = DatumGetNumeric(numd); } PG_CATCH(); { -- cgit v1.2.3