mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Fix warning introduced in 5c279a6d35
.
Change two macros to be static inline functions instead to keep the data type consistent. This avoids a "comparison is always true" warning that was occurring with -Wtype-limits. In the process, change the names to look less like macros. Discussion: https://postgr.es/m/20220407063505.njnnrmbn4sxqfsts@alap3.anarazel.de
This commit is contained in:
@@ -101,7 +101,7 @@ RegisterCustomRmgr(RmgrId rmid, RmgrData *rmgr)
|
||||
ereport(ERROR, (errmsg("custom resource manager name is invalid"),
|
||||
errhint("Provide a non-empty name for the custom resource manager.")));
|
||||
|
||||
if (!RMID_IS_CUSTOM(rmid))
|
||||
if (!RmgrIdIsCustom(rmid))
|
||||
ereport(ERROR, (errmsg("custom resource manager ID %d is out of range", rmid),
|
||||
errhint("Provide a custom resource manager ID between %d and %d.",
|
||||
RM_MIN_CUSTOM_ID, RM_MAX_CUSTOM_ID)));
|
||||
@@ -153,7 +153,7 @@ pg_get_wal_resource_managers(PG_FUNCTION_ARGS)
|
||||
continue;
|
||||
values[0] = Int32GetDatum(rmid);
|
||||
values[1] = CStringGetTextDatum(GetRmgr(rmid).rm_name);
|
||||
values[2] = BoolGetDatum(RMID_IS_BUILTIN(rmid));
|
||||
values[2] = BoolGetDatum(RmgrIdIsBuiltin(rmid));
|
||||
tuplestore_putvalues(rsinfo->setResult, rsinfo->setDesc, values, nulls);
|
||||
}
|
||||
|
||||
|
@@ -1102,7 +1102,7 @@ ValidXLogRecordHeader(XLogReaderState *state, XLogRecPtr RecPtr,
|
||||
(uint32) SizeOfXLogRecord, record->xl_tot_len);
|
||||
return false;
|
||||
}
|
||||
if (!RMID_IS_VALID(record->xl_rmid))
|
||||
if (!RmgrIdIsValid(record->xl_rmid))
|
||||
{
|
||||
report_invalid_record(state,
|
||||
"invalid resource manager ID %u at %X/%X",
|
||||
|
Reference in New Issue
Block a user