]> granicus.if.org Git - postgresql/commitdiff
Attempt to fix some compiler warnings.
authorRobert Haas <rhaas@postgresql.org>
Wed, 29 Apr 2015 18:02:01 +0000 (14:02 -0400)
committerRobert Haas <rhaas@postgresql.org>
Wed, 29 Apr 2015 18:02:27 +0000 (14:02 -0400)
src/backend/utils/adt/formatting.c
src/backend/utils/fmgr/funcapi.c

index 576db95c1bed53508d274718c0650e353376735c..233fe2f0f8c3e5d7887a21af19bd7ffb720c3bd2 100644 (file)
@@ -2507,7 +2507,7 @@ DCH_to_char(FormatNode *node, bool is_interval, TmToChar *in, char *out, Oid col
                                s += strlen(s);
                                if (tm->tm_gmtoff % SECS_PER_HOUR != 0)
                                {
-                                       sprintf(s, ":%02ld", abs(tm->tm_gmtoff % SECS_PER_HOUR) / SECS_PER_MINUTE);
+                                       sprintf(s, ":%02d", abs(tm->tm_gmtoff % SECS_PER_HOUR) / SECS_PER_MINUTE);
                                        s += strlen(s);
                                }
                                break;
index ebd7ddd3873c926acc8f6937daf8ff73822d543b..fccef382497f503edfdf0faf6f81fc099350c89d 100644 (file)
@@ -887,7 +887,6 @@ get_func_trftypes(HeapTuple procTup,
                                  Oid **p_trftypes)
 {
 
-       Form_pg_proc procStruct = (Form_pg_proc) GETSTRUCT(procTup);
        Datum           protrftypes;
        ArrayType  *arr;
        int                     nelems;
@@ -911,7 +910,7 @@ get_func_trftypes(HeapTuple procTup,
                        ARR_HASNULL(arr) ||
                        ARR_ELEMTYPE(arr) != OIDOID)
                        elog(ERROR, "protrftypes is not a 1-D Oid array");
-               Assert(nelems >= procStruct->pronargs);
+               Assert(nelems >= ((Form_pg_proc) GETSTRUCT(procTup))->pronargs);
                *p_trftypes = (Oid *) palloc(nelems * sizeof(Oid));
                memcpy(*p_trftypes, ARR_DATA_PTR(arr),
                           nelems * sizeof(Oid));