Silence compiler warnings
Reported by Peter Eisentraut. Coding suggested by Tom Lane.
This commit is contained in:
parent
83bed06be4
commit
b82d5a2c7c
@ -2290,23 +2290,18 @@ get_object_namespace(const ObjectAddress *address)
|
||||
int
|
||||
read_objtype_from_string(const char *objtype)
|
||||
{
|
||||
ObjectType type;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < lengthof(ObjectTypeMap); i++)
|
||||
{
|
||||
if (strcmp(ObjectTypeMap[i].tm_name, objtype) == 0)
|
||||
{
|
||||
type = ObjectTypeMap[i].tm_type;
|
||||
break;
|
||||
}
|
||||
return ObjectTypeMap[i].tm_type;
|
||||
}
|
||||
if (i >= lengthof(ObjectTypeMap))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("unrecognized object type \"%s\"", objtype)));
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("unrecognized object type \"%s\"", objtype)));
|
||||
|
||||
return type;
|
||||
return -1; /* keep compiler quiet */
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user