From e481d26285b160058b093588e062cf3071fea192 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 28 Apr 2019 12:45:55 -0400 Subject: Clean up minor warnings from buildfarm. Be more consistent about use of XXXGetDatum macros in new jsonpath code. This is mostly to avoid having code that looks randomly different from everyplace else that's doing the exact same thing. In pg_regress.c, avoid an unreferenced-function warning from compilers that don't understand pg_attribute_unused(). Putting the function inside the same #ifdef as its only caller is more straightforward coding anyway. In be-secure-openssl.c, avoid use of pg_attribute_unused() on a label. That's pretty creative, but there's no good reason to suppose that it's portable, and there's absolutely no need to use goto's here in the first place. (This wasn't actually causing any buildfarm complaints, but it's new code in v12 so it has no portability track record.) --- src/backend/utils/adt/jsonpath_exec.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/backend/utils/adt/jsonpath_exec.c') diff --git a/src/backend/utils/adt/jsonpath_exec.c b/src/backend/utils/adt/jsonpath_exec.c index 074cea24ae3..ae61b8fa3e6 100644 --- a/src/backend/utils/adt/jsonpath_exec.c +++ b/src/backend/utils/adt/jsonpath_exec.c @@ -1742,8 +1742,7 @@ executeNumericItemMethod(JsonPathExecContext *cxt, JsonPathItem *jsp, "be applied to a numeric value", jspOperationName(jsp->type))))); - datum = NumericGetDatum(jb->val.numeric); - datum = DirectFunctionCall1(func, datum); + datum = DirectFunctionCall1(func, NumericGetDatum(jb->val.numeric)); if (!jspGetNext(jsp, &next) && !found) return jperOk; @@ -2109,8 +2108,8 @@ static int compareNumeric(Numeric a, Numeric b) { return DatumGetInt32(DirectFunctionCall2(numeric_cmp, - PointerGetDatum(a), - PointerGetDatum(b))); + NumericGetDatum(a), + NumericGetDatum(b))); } static JsonbValue * -- cgit v1.2.3