]> granicus.if.org Git - postgresql/commitdiff
Sprinkle some const decorations
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 23 Oct 2018 10:17:16 +0000 (12:17 +0200)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 23 Oct 2018 10:25:17 +0000 (12:25 +0200)
These mainly help understanding the function signatures better.

src/backend/parser/parse_coerce.c
src/include/parser/parse_coerce.h

index c31a5630b2fce7723ccfbb8be53fb5da06bbfa90..7d8cb459e8a240c4db9992f4e7521374eb8db06b 100644 (file)
@@ -540,7 +540,7 @@ coerce_type(ParseState *pstate, Node *node,
  * as this determines the set of available casts.
  */
 bool
-can_coerce_type(int nargs, Oid *input_typeids, Oid *target_typeids,
+can_coerce_type(int nargs, const Oid *input_typeids, const Oid *target_typeids,
                                CoercionContext ccontext)
 {
        bool            have_generics = false;
@@ -1467,8 +1467,8 @@ coerce_to_common_type(ParseState *pstate, Node *node,
  * We do not ereport here, but just return false if a rule is violated.
  */
 bool
-check_generic_type_consistency(Oid *actual_arg_types,
-                                                          Oid *declared_arg_types,
+check_generic_type_consistency(const Oid *actual_arg_types,
+                                                          const Oid *declared_arg_types,
                                                           int nargs)
 {
        int                     j;
@@ -1664,7 +1664,7 @@ check_generic_type_consistency(Oid *actual_arg_types,
  * assume that successive inputs are of the same actual element type.
  */
 Oid
-enforce_generic_type_consistency(Oid *actual_arg_types,
+enforce_generic_type_consistency(const Oid *actual_arg_types,
                                                                 Oid *declared_arg_types,
                                                                 int nargs,
                                                                 Oid rettype,
index af12c136efa5779fff634cabcdb49882285997fc..93c1ab4ef8c6b48479829f1d2214d57c97ffb7c8 100644 (file)
@@ -41,7 +41,7 @@ extern Node *coerce_to_target_type(ParseState *pstate,
                                          CoercionContext ccontext,
                                          CoercionForm cformat,
                                          int location);
-extern bool can_coerce_type(int nargs, Oid *input_typeids, Oid *target_typeids,
+extern bool can_coerce_type(int nargs, const Oid *input_typeids, const Oid *target_typeids,
                                CoercionContext ccontext);
 extern Node *coerce_type(ParseState *pstate, Node *node,
                        Oid inputTypeId, Oid targetTypeId, int32 targetTypeMod,
@@ -71,10 +71,10 @@ extern Node *coerce_to_common_type(ParseState *pstate, Node *node,
                                          Oid targetTypeId,
                                          const char *context);
 
-extern bool check_generic_type_consistency(Oid *actual_arg_types,
-                                                          Oid *declared_arg_types,
+extern bool check_generic_type_consistency(const Oid *actual_arg_types,
+                                                          const Oid *declared_arg_types,
                                                           int nargs);
-extern Oid enforce_generic_type_consistency(Oid *actual_arg_types,
+extern Oid enforce_generic_type_consistency(const Oid *actual_arg_types,
                                                                 Oid *declared_arg_types,
                                                                 int nargs,
                                                                 Oid rettype,