diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2018-05-02 15:52:54 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2018-05-02 15:52:54 -0400 |
commit | fbb2e9a030ee7a3fa20ce402e4b1da9809b4eb52 (patch) | |
tree | 79bd48ec2dccce2957bf56d62019f24a86ab181c /contrib/hstore | |
parent | 447dbf7aa7909bca76048042d6734ee8f5249d0f (diff) | |
download | postgresql-fbb2e9a030ee7a3fa20ce402e4b1da9809b4eb52.tar.gz |
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.
Diffstat (limited to 'contrib/hstore')
-rw-r--r-- | contrib/hstore/hstore_io.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/contrib/hstore/hstore_io.c b/contrib/hstore/hstore_io.c index 7a741a779c..745497c76f 100644 --- a/contrib/hstore/hstore_io.c +++ b/contrib/hstore/hstore_io.c @@ -1462,10 +1462,14 @@ hstore_to_jsonb_loose(PG_FUNCTION_ARGS) HSTORE_VALLEN(entries, i)); if (IsValidJsonNumber(tmp.data, tmp.len)) { + Datum numd; + val.type = jbvNumeric; - val.val.numeric = DatumGetNumeric( - DirectFunctionCall3(numeric_in, - CStringGetDatum(tmp.data), 0, -1)); + numd = DirectFunctionCall3(numeric_in, + CStringGetDatum(tmp.data), + ObjectIdGetDatum(InvalidOid), + Int32GetDatum(-1)); + val.val.numeric = DatumGetNumeric(numd); } else { |