Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit326d865

Browse files
committed
Change form() to varargform() to prevent portability problems.
1 parente786508 commit326d865

File tree

8 files changed

+49
-49
lines changed

8 files changed

+49
-49
lines changed

‎src/backend/access/index/istrat.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.32 1999/05/25 16:07:15 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.33 1999/06/19 04:54:10 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -612,7 +612,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy,
612612
attributeNumber++)
613613
{
614614
int16support;
615-
Form_pg_amprocform;
615+
Form_pg_amprocaform;
616616
RegProcedure*loc;
617617

618618
loc=&indexSupport[((attributeNumber-1)*maxSupportNumber)];
@@ -627,8 +627,8 @@ IndexSupportInitialize(IndexStrategy indexStrategy,
627627

628628
while (HeapTupleIsValid(tuple=heap_getnext(scan,0)))
629629
{
630-
form= (Form_pg_amproc)GETSTRUCT(tuple);
631-
loc[(form->amprocnum-1)]=form->amproc;
630+
aform= (Form_pg_amproc)GETSTRUCT(tuple);
631+
loc[(aform->amprocnum-1)]=aform->amproc;
632632
}
633633

634634
heap_endscan(scan);
@@ -667,12 +667,12 @@ IndexSupportInitialize(IndexStrategy indexStrategy,
667667

668668
while (HeapTupleIsValid(tuple=heap_getnext(scan,0)))
669669
{
670-
Form_pg_amopform;
670+
Form_pg_amopaform;
671671

672-
form= (Form_pg_amop)GETSTRUCT(tuple);
672+
aform= (Form_pg_amop)GETSTRUCT(tuple);
673673
OperatorRelationFillScanKeyEntry(operatorRelation,
674-
form->amopopr,
675-
StrategyMapGetScanKeyEntry(map,form->amopstrategy));
674+
aform->amopopr,
675+
StrategyMapGetScanKeyEntry(map,aform->amopstrategy));
676676
}
677677

678678
heap_endscan(scan);

‎src/backend/catalog/index.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.78 1999/06/16 11:01:17 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.79 1999/06/19 04:54:11 momjian Exp $
1111
*
1212
*
1313
* INTERFACE ROUTINES
@@ -372,7 +372,7 @@ AccessMethodObjectIdGetForm(Oid accessMethodObjectId)
372372
HeapScanDescpg_am_scan;
373373
HeapTuplepg_am_tuple;
374374
ScanKeyDatakey;
375-
Form_pg_amform;
375+
Form_pg_amaform;
376376

377377
/* ----------------
378378
*form a scan key for the pg_am relation
@@ -406,13 +406,13 @@ AccessMethodObjectIdGetForm(Oid accessMethodObjectId)
406406
*if found am tuple, then copy the form and return the copy
407407
* ----------------
408408
*/
409-
form= (Form_pg_am)palloc(sizeof*form);
410-
memcpy(form,GETSTRUCT(pg_am_tuple),sizeof*form);
409+
aform= (Form_pg_am)palloc(sizeof*aform);
410+
memcpy(aform,GETSTRUCT(pg_am_tuple),sizeof*aform);
411411

412412
heap_endscan(pg_am_scan);
413413
heap_close(pg_am_desc);
414414

415-
returnform;
415+
returnaform;
416416
}
417417

418418
/* ----------------------------------------------------------------

‎src/backend/commands/command.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.46 1999/05/25 22:40:54 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.47 1999/06/19 04:54:12 momjian Exp $
1111
*
1212
* NOTES
1313
* The PortalExecutorHeapMemory crap needs to be eliminated
@@ -435,7 +435,7 @@ PerformAddAttribute(char *relationName,
435435

436436
{
437437
HeapTupletypeTuple;
438-
Form_pg_typeform;
438+
Form_pg_typetform;
439439
char*typename;
440440
intattnelems;
441441

@@ -469,21 +469,21 @@ PerformAddAttribute(char *relationName,
469469
typeTuple=SearchSysCacheTuple(TYPNAME,
470470
PointerGetDatum(typename),
471471
0,0,0);
472-
form= (Form_pg_type)GETSTRUCT(typeTuple);
472+
tform= (Form_pg_type)GETSTRUCT(typeTuple);
473473

474474
if (!HeapTupleIsValid(typeTuple))
475475
elog(ERROR,"Add: type \"%s\" nonexistent",typename);
476476
namestrcpy(&(attribute->attname),colDef->colname);
477477
attribute->atttypid=typeTuple->t_data->t_oid;
478-
attribute->attlen=form->typlen;
478+
attribute->attlen=tform->typlen;
479479
attribute->attdisbursion=0;
480480
attribute->attcacheoff=-1;
481481
attribute->atttypmod=colDef->typename->typmod;
482482
attribute->attnum=i;
483-
attribute->attbyval=form->typbyval;
483+
attribute->attbyval=tform->typbyval;
484484
attribute->attnelems=attnelems;
485-
attribute->attisset= (bool) (form->typtype=='c');
486-
attribute->attalign=form->typalign;
485+
attribute->attisset= (bool) (tform->typtype=='c');
486+
attribute->attalign=tform->typalign;
487487
attribute->attnotnull= false;
488488
attribute->atthasdef= (colDef->defval!=NULL);
489489

‎src/backend/libpq/portalbuf.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portalbuf.c,v 1.14 1999/05/25 16:09:02 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portalbuf.c,v 1.15 1999/06/19 04:54:13 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -89,7 +89,7 @@ portals_realloc(size_t size)
8989
portals=newp;
9090
else
9191
libpq_raise(&PortalError,
92-
form("Cannot alloc more memory in portals_realloc"));
92+
varargform("Cannot alloc more memory in portals_realloc"));
9393

9494
for (i=oldsize;i<portals_array_size;i++)
9595
portals[i]= (PortalEntry*)NULL;
@@ -109,11 +109,11 @@ pbuf_alloc(size_t size)
109109
caddr_taddr;
110110

111111
if (size <=0)
112-
libpq_raise(&MemoryError,form("Invalid argument to pbuf_alloc()."));
112+
libpq_raise(&MemoryError,varargform("Invalid argument to pbuf_alloc()."));
113113

114114
addr= (caddr_t)palloc(size);
115115
if (addr== (caddr_t)NULL)
116-
libpq_raise(&MemoryError,form("Cannot Allocate space."));
116+
libpq_raise(&MemoryError,varargform("Cannot Allocate space."));
117117

118118
returnaddr;
119119
}
@@ -131,7 +131,7 @@ pbuf_free(caddr_t pointer)
131131
if (pointer)
132132
pfree(pointer);
133133
else
134-
libpq_raise(&MemoryError,form("Tried to free NULL memory pointer"));
134+
libpq_raise(&MemoryError,varargform("Tried to free NULL memory pointer"));
135135

136136
}
137137

@@ -437,7 +437,7 @@ pbuf_close(char *pname)
437437
inti;
438438

439439
if ((i=pbuf_getIndex(pname))==-1)
440-
libpq_raise(&PortalError,form("Portal %s does not exist.",pname));
440+
libpq_raise(&PortalError,varargform("Portal %s does not exist.",pname));
441441

442442
pbuf_freePortal(portals[i]->portal);
443443
pbuf_freeEntry(i);
@@ -462,7 +462,7 @@ pbuf_findGroup(PortalBuffer *portal,
462462

463463
if (group==NULL)
464464
libpq_raise(&PortalError,
465-
form("Group index %d out of bound.",group_index));
465+
varargform("Group index %d out of bound.",group_index));
466466

467467
returngroup;
468468
}
@@ -485,7 +485,7 @@ pbuf_findFnumber(GroupBuffer *group,
485485
returni;
486486

487487
libpq_raise(&PortalError,
488-
form("Field-name %s does not exist.",field_name));
488+
varargform("Field-name %s does not exist.",field_name));
489489

490490
/* not reached, here to make compiler happy */
491491
return0;
@@ -502,7 +502,7 @@ pbuf_checkFnumber(GroupBuffer *group,
502502
{
503503
if (field_number<0||field_number >=group->no_fields)
504504
libpq_raise(&PortalError,
505-
form("Field number %d out of bound.",field_number));
505+
varargform("Field number %d out of bound.",field_number));
506506
}
507507

508508
/* --------------------------------

‎src/backend/optimizer/path/indxpath.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.56 1999/05/25 22:41:28 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.57 1999/06/19 04:54:14 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1008,7 +1008,7 @@ clause_pred_clause_test(Expr *predicate, Node *clause)
10081008
HeapScanDescscan;
10091009
HeapTupletuple;
10101010
ScanKeyDataentry[3];
1011-
Form_pg_amopform;
1011+
Form_pg_amopaform;
10121012

10131013
pred_var= (Var*)get_leftop(predicate);
10141014
pred_const= (Const*)get_rightop(predicate);
@@ -1067,13 +1067,13 @@ clause_pred_clause_test(Expr *predicate, Node *clause)
10671067
elog(DEBUG,"clause_pred_clause_test: unknown pred_op");
10681068
return false;
10691069
}
1070-
form= (Form_pg_amop)GETSTRUCT(tuple);
1070+
aform= (Form_pg_amop)GETSTRUCT(tuple);
10711071

10721072
/* Get the predicate operator's strategy number (1 to 5) */
1073-
pred_strategy= (StrategyNumber)form->amopstrategy;
1073+
pred_strategy= (StrategyNumber)aform->amopstrategy;
10741074

10751075
/* Remember which operator class this strategy number came from */
1076-
opclass_id=form->amopclaid;
1076+
opclass_id=aform->amopclaid;
10771077

10781078
heap_endscan(scan);
10791079

@@ -1098,10 +1098,10 @@ clause_pred_clause_test(Expr *predicate, Node *clause)
10981098
elog(DEBUG,"clause_pred_clause_test: unknown clause_op");
10991099
return false;
11001100
}
1101-
form= (Form_pg_amop)GETSTRUCT(tuple);
1101+
aform= (Form_pg_amop)GETSTRUCT(tuple);
11021102

11031103
/* Get the restriction clause operator's strategy number (1 to 5) */
1104-
clause_strategy= (StrategyNumber)form->amopstrategy;
1104+
clause_strategy= (StrategyNumber)aform->amopstrategy;
11051105
heap_endscan(scan);
11061106

11071107

@@ -1130,10 +1130,10 @@ clause_pred_clause_test(Expr *predicate, Node *clause)
11301130
elog(DEBUG,"clause_pred_clause_test: unknown test_op");
11311131
return false;
11321132
}
1133-
form= (Form_pg_amop)GETSTRUCT(tuple);
1133+
aform= (Form_pg_amop)GETSTRUCT(tuple);
11341134

11351135
/* Get the test operator */
1136-
test_op=form->amopopr;
1136+
test_op=aform->amopopr;
11371137
heap_endscan(scan);
11381138

11391139

‎src/backend/utils/error/format.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/format.c,v 1.11 1999/05/25 16:12:26 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/format.c,v 1.12 1999/06/19 04:54:19 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -22,11 +22,11 @@ static char FormBuf[FormMaxSize];
2222

2323

2424
/* ----------------
25-
*form
25+
*varargform
2626
* ----------------
2727
*/
2828
char*
29-
form(constchar*fmt,...)
29+
varargform(constchar*fmt,...)
3030
{
3131
va_listargs;
3232

‎src/backend/utils/mmgr/portalmem.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.21 1999/06/12 14:07:26 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.22 1999/06/19 04:54:19 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -234,7 +234,7 @@ PortalVariableMemoryRealloc(PortalVariableMemory this,
234234
staticchar*
235235
PortalVariableMemoryGetName(PortalVariableMemorythis)
236236
{
237-
returnform("%s-var",PortalVariableMemoryGetPortal(this)->name);
237+
returnvarargform("%s-var",PortalVariableMemoryGetPortal(this)->name);
238238
}
239239

240240
/* ----------------
@@ -312,7 +312,7 @@ PortalHeapMemoryRealloc(PortalHeapMemory this,
312312
staticchar*
313313
PortalHeapMemoryGetName(PortalHeapMemorythis)
314314
{
315-
returnform("%s-heap",PortalHeapMemoryGetPortal(this)->name);
315+
returnvarargform("%s-heap",PortalHeapMemoryGetPortal(this)->name);
316316
}
317317

318318
/* ----------------

‎src/include/c.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: c.h,v 1.55 1999/05/25 16:13:22 momjian Exp $
10+
* $Id: c.h,v 1.56 1999/06/19 04:54:23 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -591,7 +591,7 @@ extern intassert_enabled;
591591
#defineLogTrap(condition,exception,printArgs) \
592592
{ if ((assert_enabled) && (condition)) \
593593
ExceptionalCondition(CppAsString(condition), &(exception), \
594-
form printArgs, __FILE__, __LINE__); }
594+
varargform printArgs, __FILE__, __LINE__); }
595595

596596
/*
597597
*LogTrapMacro is the same as LogTrap but it's intended for use in macros:
@@ -602,7 +602,7 @@ extern intassert_enabled;
602602
((bool) ((! assert_enabled) || (! condition) || \
603603
(ExceptionalCondition(CppAsString(condition), \
604604
&(exception), \
605-
form printArgs, __FILE__, __LINE__))))
605+
varargform printArgs, __FILE__, __LINE__))))
606606

607607
#ifndefUSE_ASSERT_CHECKING
608608
#defineLogAssert(condition,printArgs)
@@ -711,10 +711,10 @@ extern int ExceptionalCondition(char *conditionName,
711711

712712

713713
/* ----------------
714-
*form is used by assert and the exception handling stuff
714+
*varargform is used by assert and the exception handling stuff
715715
* ----------------
716716
*/
717-
externchar*form(constchar*fmt,...);
717+
externchar*varargform(constchar*fmt,...);
718718

719719

720720

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp