1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

Add some const decorations to prototypes

Reviewed-by: Fabien COELHO <coelho@cri.ensmp.fr>
This commit is contained in:
Peter Eisentraut
2017-10-31 10:34:31 -04:00
parent 7e60e67861
commit 0e1539ba0d
95 changed files with 236 additions and 236 deletions

View File

@ -139,7 +139,7 @@ CommentObject(CommentStmt *stmt)
* existing comment for the specified key.
*/
void
CreateComments(Oid oid, Oid classoid, int32 subid, char *comment)
CreateComments(Oid oid, Oid classoid, int32 subid, const char *comment)
{
Relation description;
ScanKeyData skey[3];
@ -234,7 +234,7 @@ CreateComments(Oid oid, Oid classoid, int32 subid, char *comment)
* existing comment for the specified key.
*/
void
CreateSharedComments(Oid oid, Oid classoid, char *comment)
CreateSharedComments(Oid oid, Oid classoid, const char *comment)
{
Relation shdescription;
ScanKeyData skey[2];

View File

@ -152,7 +152,7 @@ static event_trigger_command_tag_check_result check_table_rewrite_ddl_tag(
const char *tag);
static void error_duplicate_filter_variable(const char *defname);
static Datum filter_list_to_array(List *filterlist);
static Oid insert_event_trigger_tuple(char *trigname, char *eventname,
static Oid insert_event_trigger_tuple(const char *trigname, const char *eventname,
Oid evtOwner, Oid funcoid, List *tags);
static void validate_ddl_tags(const char *filtervar, List *taglist);
static void validate_table_rewrite_tags(const char *filtervar, List *taglist);
@ -372,7 +372,7 @@ error_duplicate_filter_variable(const char *defname)
* Insert the new pg_event_trigger row and record dependencies.
*/
static Oid
insert_event_trigger_tuple(char *trigname, char *eventname, Oid evtOwner,
insert_event_trigger_tuple(const char *trigname, const char *eventname, Oid evtOwner,
Oid funcoid, List *taglist)
{
Relation tgrel;

View File

@ -1266,8 +1266,8 @@ find_install_path(List *evi_list, ExtensionVersionInfo *evi_target,
static ObjectAddress
CreateExtensionInternal(char *extensionName,
char *schemaName,
char *versionName,
char *oldVersionName,
const char *versionName,
const char *oldVersionName,
bool cascade,
List *parents,
bool is_create)

View File

@ -67,7 +67,7 @@ static void ComputeIndexAttrs(IndexInfo *indexInfo,
List *attList,
List *exclusionOpNames,
Oid relId,
char *accessMethodName, Oid accessMethodId,
const char *accessMethodName, Oid accessMethodId,
bool amcanorder,
bool isconstraint);
static char *ChooseIndexName(const char *tabname, Oid namespaceId,
@ -115,7 +115,7 @@ static void RangeVarCallbackForReindexIndex(const RangeVar *relation,
*/
bool
CheckIndexCompatible(Oid oldId,
char *accessMethodName,
const char *accessMethodName,
List *attributeList,
List *exclusionOpNames)
{
@ -1011,7 +1011,7 @@ ComputeIndexAttrs(IndexInfo *indexInfo,
List *attList, /* list of IndexElem's */
List *exclusionOpNames,
Oid relId,
char *accessMethodName,
const char *accessMethodName,
Oid accessMethodId,
bool amcanorder,
bool isconstraint)
@ -1277,7 +1277,7 @@ ComputeIndexAttrs(IndexInfo *indexInfo,
*/
Oid
ResolveOpClass(List *opclass, Oid attrType,
char *accessMethodName, Oid accessMethodId)
const char *accessMethodName, Oid accessMethodId)
{
char *schemaname;
char *opcname;

View File

@ -239,7 +239,7 @@ get_opclass_oid(Oid amID, List *opclassname, bool missing_ok)
* Caller must have done permissions checks etc. already.
*/
static ObjectAddress
CreateOpFamily(char *amname, char *opfname, Oid namespaceoid, Oid amoid)
CreateOpFamily(const char *amname, const char *opfname, Oid namespaceoid, Oid amoid)
{
Oid opfamilyoid;
Relation rel;

View File

@ -426,7 +426,7 @@ static void ATPostAlterTypeParse(Oid oldId, Oid oldRelId, Oid refRelId,
bool rewrite);
static void RebuildConstraintComment(AlteredTableInfo *tab, int pass,
Oid objid, Relation rel, List *domname,
char *conname);
const char *conname);
static void TryReuseIndex(Oid oldId, IndexStmt *stmt);
static void TryReuseForeignKey(Oid oldId, Constraint *con);
static void change_owner_fix_column_acls(Oid relationOid,
@ -438,14 +438,14 @@ static ObjectAddress ATExecClusterOn(Relation rel, const char *indexName,
static void ATExecDropCluster(Relation rel, LOCKMODE lockmode);
static bool ATPrepChangePersistence(Relation rel, bool toLogged);
static void ATPrepSetTableSpace(AlteredTableInfo *tab, Relation rel,
char *tablespacename, LOCKMODE lockmode);
const char *tablespacename, LOCKMODE lockmode);
static void ATExecSetTableSpace(Oid tableOid, Oid newTableSpace, LOCKMODE lockmode);
static void ATExecSetRelOptions(Relation rel, List *defList,
AlterTableType operation,
LOCKMODE lockmode);
static void ATExecEnableDisableTrigger(Relation rel, char *trigname,
static void ATExecEnableDisableTrigger(Relation rel, const char *trigname,
char fires_when, bool skip_system, LOCKMODE lockmode);
static void ATExecEnableDisableRule(Relation rel, char *rulename,
static void ATExecEnableDisableRule(Relation rel, const char *rulename,
char fires_when, LOCKMODE lockmode);
static void ATPrepAddInherit(Relation child_rel);
static ObjectAddress ATExecAddInherit(Relation child_rel, RangeVar *parent, LOCKMODE lockmode);
@ -9873,7 +9873,7 @@ ATPostAlterTypeParse(Oid oldId, Oid oldRelId, Oid refRelId, char *cmd,
static void
RebuildConstraintComment(AlteredTableInfo *tab, int pass, Oid objid,
Relation rel, List *domname,
char *conname)
const char *conname)
{
CommentStmt *cmd;
char *comment_str;
@ -10393,7 +10393,7 @@ ATExecDropCluster(Relation rel, LOCKMODE lockmode)
* ALTER TABLE SET TABLESPACE
*/
static void
ATPrepSetTableSpace(AlteredTableInfo *tab, Relation rel, char *tablespacename, LOCKMODE lockmode)
ATPrepSetTableSpace(AlteredTableInfo *tab, Relation rel, const char *tablespacename, LOCKMODE lockmode)
{
Oid tablespaceId;
@ -11060,7 +11060,7 @@ copy_relation_data(SMgrRelation src, SMgrRelation dst,
* We just pass this off to trigger.c.
*/
static void
ATExecEnableDisableTrigger(Relation rel, char *trigname,
ATExecEnableDisableTrigger(Relation rel, const char *trigname,
char fires_when, bool skip_system, LOCKMODE lockmode)
{
EnableDisableTrigger(rel, trigname, fires_when, skip_system);
@ -11072,7 +11072,7 @@ ATExecEnableDisableTrigger(Relation rel, char *trigname,
* We just pass this off to rewriteDefine.c.
*/
static void
ATExecEnableDisableRule(Relation rel, char *rulename,
ATExecEnableDisableRule(Relation rel, const char *rulename,
char fires_when, LOCKMODE lockmode)
{
EnableDisableRule(rel, rulename, fires_when);

View File

@ -103,7 +103,7 @@ static void checkEnumOwner(HeapTuple tup);
static char *domainAddConstraint(Oid domainOid, Oid domainNamespace,
Oid baseTypeOid,
int typMod, Constraint *constr,
char *domainName, ObjectAddress *constrAddr);
const char *domainName, ObjectAddress *constrAddr);
static Node *replace_domain_constraint_value(ParseState *pstate,
ColumnRef *cref);
@ -2649,7 +2649,7 @@ AlterDomainAddConstraint(List *names, Node *newConstraint,
* Implements the ALTER DOMAIN .. VALIDATE CONSTRAINT statement.
*/
ObjectAddress
AlterDomainValidateConstraint(List *names, char *constrName)
AlterDomainValidateConstraint(List *names, const char *constrName)
{
TypeName *typename;
Oid domainoid;
@ -3060,7 +3060,7 @@ checkDomainOwner(HeapTuple tup)
static char *
domainAddConstraint(Oid domainOid, Oid domainNamespace, Oid baseTypeOid,
int typMod, Constraint *constr,
char *domainName, ObjectAddress *constrAddr)
const char *domainName, ObjectAddress *constrAddr)
{
Node *expr;
char *ccsrc;

View File

@ -43,7 +43,7 @@ static void checkViewTupleDesc(TupleDesc newdesc, TupleDesc olddesc);
* are "local" and "cascaded".
*/
void
validateWithCheckOption(char *value)
validateWithCheckOption(const char *value)
{
if (value == NULL ||
(pg_strcasecmp(value, "local") != 0 &&