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

Commit1cd4c14

Browse files
committed
Fixed all elog related warnings, as well as a few others.
1 parent7c9390c commit1cd4c14

File tree

42 files changed

+184
-182
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+184
-182
lines changed

‎src/backend/access/common/heaptuple.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.59 1999/12/16 22:19:34 wieck Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.60 2000/01/15 02:59:17 petere Exp $
1212
*
1313
* NOTES
1414
* The old interface functions have been converted to macros
@@ -136,8 +136,9 @@ DataFill(char *data,
136136
*((int32*)value[i]));
137137
break;
138138
default:
139-
memmove(data,DatumGetPointer(value[i]),
140-
att[i]->attlen);
139+
Assert(att[i]->attlen >=0);
140+
memmove(data,DatumGetPointer(value[i]),
141+
(size_t)(att[i]->attlen));
141142
break;
142143
}
143144
data= (char*)att_addlength((long)data,att[i]->attlen,value[i]);
@@ -324,8 +325,8 @@ nocachegetattr(HeapTuple tuple,
324325
Form_pg_attribute*att=tupleDesc->attrs;
325326
intslow=0;/* do we have to walk nulls? */
326327

327-
328-
#ifIN_MACRO
328+
(void)isnull;/*not used*/
329+
#ifdefIN_MACRO
329330
/* This is handled in the macro */
330331
Assert(attnum>0);
331332

@@ -346,7 +347,7 @@ nocachegetattr(HeapTuple tuple,
346347

347348
if (HeapTupleNoNulls(tuple))
348349
{
349-
#ifIN_MACRO
350+
#ifdefIN_MACRO
350351
/* This is handled in the macro */
351352
if (att[attnum]->attcacheoff!=-1)
352353
{
@@ -376,7 +377,7 @@ nocachegetattr(HeapTuple tuple,
376377
* ----------------
377378
*/
378379

379-
#ifIN_MACRO
380+
#ifdefIN_MACRO
380381
/* This is handled in the macro */
381382
if (att_isnull(attnum,bp))
382383
{
@@ -565,7 +566,7 @@ heap_copytuple(HeapTuple tuple)
565566
newTuple->t_datamcxt=CurrentMemoryContext;
566567
newTuple->t_data= (HeapTupleHeader) ((char*)newTuple+HEAPTUPLESIZE);
567568
memmove((char*)newTuple->t_data,
568-
(char*)tuple->t_data,(int)tuple->t_len);
569+
(char*)tuple->t_data,tuple->t_len);
569570
returnnewTuple;
570571
}
571572

@@ -589,7 +590,7 @@ heap_copytuple_with_tuple(HeapTuple src, HeapTuple dest)
589590
dest->t_datamcxt=CurrentMemoryContext;
590591
dest->t_data= (HeapTupleHeader)palloc(src->t_len);
591592
memmove((char*)dest->t_data,
592-
(char*)src->t_data,(int)src->t_len);
593+
(char*)src->t_data,src->t_len);
593594
return;
594595
}
595596

@@ -655,7 +656,7 @@ heap_formtuple(TupleDesc tupleDescriptor,
655656
HeapTupletuple;/* return tuple */
656657
HeapTupleHeadertd;/* tuple data */
657658
intbitmaplen;
658-
longlen;
659+
unsignedlonglen;
659660
inthoff;
660661
boolhasnull= false;
661662
inti;
@@ -687,7 +688,7 @@ heap_formtuple(TupleDesc tupleDescriptor,
687688
tuple->t_datamcxt=CurrentMemoryContext;
688689
td=tuple->t_data= (HeapTupleHeader) ((char*)tuple+HEAPTUPLESIZE);
689690

690-
MemSet((char*)td,0,(int)len);
691+
MemSet((char*)td,0,len);
691692

692693
tuple->t_len=len;
693694
ItemPointerSetInvalid(&(tuple->t_self));
@@ -803,8 +804,6 @@ heap_modifytuple(HeapTuple tuple,
803804
void
804805
heap_freetuple(HeapTuplehtup)
805806
{
806-
externintgetpid();
807-
808807
if (htup->t_data!=NULL)
809808
if (htup->t_datamcxt!=NULL&& (char*)(htup->t_data)!=
810809
((char*)htup+HEAPTUPLESIZE))
@@ -828,7 +827,7 @@ heap_addheader(uint32 natts,/* max domain index */
828827
{
829828
HeapTupletuple;
830829
HeapTupleHeadertd;/* tuple data */
831-
longlen;
830+
unsignedlonglen;
832831
inthoff;
833832

834833
AssertArg(natts>0);
@@ -841,7 +840,7 @@ heap_addheader(uint32 natts,/* max domain index */
841840
tuple->t_datamcxt=CurrentMemoryContext;
842841
td=tuple->t_data= (HeapTupleHeader) ((char*)tuple+HEAPTUPLESIZE);
843842

844-
MemSet((char*)td,0,(int)len);
843+
MemSet((char*)td,0,len);
845844

846845
tuple->t_len=len;
847846
ItemPointerSetInvalid(&(tuple->t_self));
@@ -850,7 +849,8 @@ heap_addheader(uint32 natts,/* max domain index */
850849
td->t_infomask=0;
851850
td->t_infomask |=HEAP_XMAX_INVALID;
852851

853-
memmove((char*)td+hoff,structure,structlen);
852+
if (structlen>0)
853+
memmove((char*)td+hoff,structure, (size_t)structlen);
854854

855855
returntuple;
856856
}

‎src/backend/access/common/indextuple.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.40 2000/01/11 03:33:11 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.41 2000/01/15 02:59:17 petere Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -63,7 +63,7 @@ index_formtuple(TupleDesc tupleDescriptor,
6363

6464
tp= (char*)palloc(size);
6565
tuple= (IndexTuple)tp;
66-
MemSet(tp,0,(int)size);
66+
MemSet(tp,0,size);
6767

6868
DataFill((char*)tp+hoff,
6969
tupleDescriptor,
@@ -133,6 +133,7 @@ nocache_index_getattr(IndexTuple tup,
133133
intdata_off;/* tuple data offset */
134134
Form_pg_attribute*att=tupleDesc->attrs;
135135

136+
(void)isnull;
136137
/* ----------------
137138
*sanity checks
138139
* ----------------

‎src/backend/access/gist/gistscan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ gistdropscan(IndexScanDesc s)
266266
prev=l;
267267

268268
if (l== (GISTScanList)NULL)
269-
elog(ERROR,"GiST scan list corrupted -- cannot find 0x%lx",s);
269+
elog(ERROR,"GiST scan list corrupted -- cannot find 0x%p",(void*)s);
270270

271271
if (prev== (GISTScanList)NULL)
272272
GISTScans=l->gsl_next;

‎src/backend/access/hash/hashscan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.20 1999/07/1523:02:55 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.21 2000/01/15 02:59:19 petere Exp $
1111
*
1212
* NOTES
1313
* Because we can be doing an index scan on a relation while we
@@ -74,7 +74,7 @@ _hash_dropscan(IndexScanDesc scan)
7474
last=chk;
7575

7676
if (chk== (HashScanList)NULL)
77-
elog(ERROR,"hash scan list trashed; can't find 0x%lx",scan);
77+
elog(ERROR,"hash scan list trashed; can't find 0x%p",(void*)scan);
7878

7979
if (last== (HashScanList)NULL)
8080
HashScans=chk->hashsl_next;

‎src/backend/access/heap/hio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Id: hio.c,v 1.27 1999/11/29 04:34:55 tgl Exp $
10+
* $Id: hio.c,v 1.28 2000/01/15 02:59:20 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -114,7 +114,7 @@ RelationPutHeapTupleAtEnd(Relation relation, HeapTuple tuple)
114114
* this code should go away eventually.
115115
*/
116116
if (len>MaxTupleSize)
117-
elog(ERROR,"Tuple is too big: size %d, max size %d",
117+
elog(ERROR,"Tuple is too big: size %d, max size %ld",
118118
len,MaxTupleSize);
119119

120120
/*

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

Lines changed: 5 additions & 5 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.38 1999/11/22 17:55:53 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.39 2000/01/15 02:59:21 petere Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -502,8 +502,8 @@ OperatorRelationFillScanKeyEntry(Relation operatorRelation,
502502
{
503503
if (IsBootstrapProcessingMode())
504504
heap_endscan(scan);
505-
elog(ERROR,"OperatorObjectIdFillScanKeyEntry: unknown operator %lu",
506-
(uint32)operatorObjectId);
505+
elog(ERROR,"OperatorObjectIdFillScanKeyEntry: unknown operator %u",
506+
operatorObjectId);
507507
}
508508

509509
entry->sk_flags=0;
@@ -517,8 +517,8 @@ OperatorRelationFillScanKeyEntry(Relation operatorRelation,
517517
if (!RegProcedureIsValid(entry->sk_procedure))
518518
{
519519
elog(ERROR,
520-
"OperatorObjectIdFillScanKeyEntry: no procedure for operator %lu",
521-
(uint32)operatorObjectId);
520+
"OperatorObjectIdFillScanKeyEntry: no procedure for operator %u",
521+
operatorObjectId);
522522
}
523523
}
524524

‎src/backend/access/nbtree/nbtinsert.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.52 1999/12/26 03:48:22 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.53 2000/01/15 02:59:23 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -275,7 +275,7 @@ _bt_insertonpg(Relation rel,
275275
* Note that at this point, itemsz doesn't include the ItemId.
276276
*/
277277
if (itemsz> (PageGetPageSize(page)-sizeof(PageHeaderData)-MAXALIGN(sizeof(BTPageOpaqueData)))/3-sizeof(ItemIdData))
278-
elog(ERROR,"btree: index item size %d exceeds maximum %d",
278+
elog(ERROR,"btree: index item size %d exceeds maximum %ld",
279279
itemsz,
280280
(PageGetPageSize(page)-sizeof(PageHeaderData)-MAXALIGN(sizeof(BTPageOpaqueData)))/3-sizeof(ItemIdData));
281281

‎src/backend/access/nbtree/nbtscan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.28 1999/08/08 20:12:51 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.29 2000/01/15 02:59:23 petere Exp $
1111
*
1212
*
1313
* NOTES
@@ -95,7 +95,7 @@ _bt_dropscan(IndexScanDesc scan)
9595
last=chk;
9696

9797
if (chk== (BTScanList)NULL)
98-
elog(ERROR,"btree scan list trashed; can't find 0x%lx",scan);
98+
elog(ERROR,"btree scan list trashed; can't find 0x%p",(void*)scan);
9999

100100
if (last== (BTScanList)NULL)
101101
BTScans=chk->btsl_next;

‎src/backend/access/nbtree/nbtsort.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* Copyright (c) 1994, Regents of the University of California
2828
*
2929
* IDENTIFICATION
30-
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsort.c,v 1.48 2000/01/08 21:24:49 tgl Exp $
30+
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsort.c,v 1.49 2000/01/15 02:59:23 petere Exp $
3131
*
3232
*-------------------------------------------------------------------------
3333
*/
@@ -314,7 +314,7 @@ _bt_buildadd(Relation index, BTPageState *state, BTItem bti, int flags)
314314
* But during creation of an index, we don't go through there.
315315
*/
316316
if (btisz> (PageGetPageSize(npage)-sizeof(PageHeaderData)-MAXALIGN(sizeof(BTPageOpaqueData)))/3-sizeof(ItemIdData))
317-
elog(ERROR,"btree: index item size %d exceeds maximum %d",
317+
elog(ERROR,"btree: index item size %d exceeds maximum %ld",
318318
btisz,
319319
(PageGetPageSize(npage)-sizeof(PageHeaderData)-MAXALIGN(sizeof(BTPageOpaqueData)))/3-sizeof(ItemIdData));
320320

‎src/backend/access/rtree/rtscan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.29 1999/07/17 20:16:45 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.30 2000/01/15 02:59:25 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -267,7 +267,7 @@ rtdropscan(IndexScanDesc s)
267267
prev=l;
268268

269269
if (l== (RTScanList)NULL)
270-
elog(ERROR,"rtree scan list corrupted -- cannot find 0x%lx",s);
270+
elog(ERROR,"rtree scan list corrupted -- cannot find 0x%p",(void*)s);
271271

272272
if (prev== (RTScanList)NULL)
273273
RTScans=l->rtsl_next;

‎src/backend/bootstrap/bootstrap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.76 2000/01/11 04:00:30 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.77 2000/01/15 02:59:27 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -771,7 +771,7 @@ cleanup()
771771
beenhere=1;
772772
else
773773
{
774-
elog(FATAL,"Memory manager fault: cleanup called twice.\n",stderr);
774+
elog(FATAL,"Memory manager fault: cleanup called twice.\n");
775775
proc_exit(1);
776776
}
777777
if (reldesc!= (Relation)NULL)

‎src/backend/catalog/aclchk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.33 2000/01/13 18:26:04 petere Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.34 2000/01/15 02:59:28 petere Exp $
1111
*
1212
* NOTES
1313
* See acl.h.
@@ -264,7 +264,7 @@ aclcheck(char *relname, Acl *acl, AclId id, AclIdType idtype, AclMode mode)
264264
*/
265265
if (num<1)
266266
{
267-
#ifACLDEBUG_TRACE||1
267+
#ifdefined(ACLDEBUG_TRACE)||1
268268
elog(DEBUG,"aclcheck: zero-length ACL, returning 1");
269269
#endif
270270
returnACLCHECK_OK;

‎src/backend/catalog/catalog.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/catalog/catalog.c,v 1.26 1999/11/22 17:55:56 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.27 2000/01/15 02:59:28 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -29,7 +29,7 @@ char *
2929
relpath(char*relname)
3030
{
3131
char*path;
32-
intbufsize=0;
32+
size_tbufsize=0;
3333

3434
if (IsSharedSystemRelationName(relname))
3535
{
@@ -156,7 +156,7 @@ fillatt(TupleDesc tupleDesc)
156156
0,0,0);
157157
if (!HeapTupleIsValid(tuple))
158158
{
159-
elog(ERROR,"fillatt: unknown atttypid %ld",
159+
elog(ERROR,"fillatt: unknown atttypid %d",
160160
(*attributeP)->atttypid);
161161
}
162162
else

‎src/backend/commands/sequence.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ init_sequence(char *caller, char *name)
417417
if (RelationGetRelid(seqrel)!=elm->relid)
418418
{
419419
elog(NOTICE,"%s.%s: sequence was re-created",
420-
name,caller,name);
420+
name,caller);
421421
elm->relid=RelationGetRelid(seqrel);
422422
elm->cached=elm->last=elm->increment=0;
423423
}

‎src/backend/commands/variable.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Routines for handling of 'SET var TO',
33
*'SHOW var' and 'RESET var' statements.
44
*
5-
* $Id: variable.c,v 1.26 1999/09/27 20:27:03 momjian Exp $
5+
* $Id: variable.c,v 1.27 2000/01/15 02:59:29 petere Exp $
66
*
77
*/
88

@@ -523,7 +523,7 @@ reset_timezone()
523523
{
524524
strcpy(tzbuf,"=");
525525
if (putenv(tzbuf)!=0)
526-
elog(ERROR,"Unable to clear TZ environment variable",NULL);
526+
elog(ERROR,"Unable to clear TZ environment variable");
527527
tzset();
528528
}
529529

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp