Commit b82d5a2c authored by Alvaro Herrera's avatar Alvaro Herrera

Silence compiler warnings

Reported by Peter Eisentraut.  Coding suggested by Tom Lane.
parent 83bed06b
...@@ -2290,23 +2290,18 @@ get_object_namespace(const ObjectAddress *address) ...@@ -2290,23 +2290,18 @@ get_object_namespace(const ObjectAddress *address)
int int
read_objtype_from_string(const char *objtype) read_objtype_from_string(const char *objtype)
{ {
ObjectType type;
int i; int i;
for (i = 0; i < lengthof(ObjectTypeMap); i++) for (i = 0; i < lengthof(ObjectTypeMap); i++)
{ {
if (strcmp(ObjectTypeMap[i].tm_name, objtype) == 0) if (strcmp(ObjectTypeMap[i].tm_name, objtype) == 0)
{ return ObjectTypeMap[i].tm_type;
type = ObjectTypeMap[i].tm_type;
break;
}
} }
if (i >= lengthof(ObjectTypeMap)) ereport(ERROR,
ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("unrecognized object type \"%s\"", objtype)));
errmsg("unrecognized object type \"%s\"", objtype)));
return type; return -1; /* keep compiler quiet */
} }
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment