mirror of
https://github.com/postgres/postgres.git
synced 2025-07-23 03:21:12 +03:00
Fix a bunch of minor portability problems and maybe-bugs revealed by
running gcc and HP's cc with warnings cranked way up. Signed vs unsigned comparisons, routines declared static and then defined not-static, that kind of thing. Tedious, but perhaps useful...
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.110 2000/02/21 18:47:00 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.111 2000/03/17 02:36:12 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Every (plan) node in POSTGRES has an associated "out" routine which
|
||||
@ -1179,7 +1179,7 @@ _outDatum(StringInfo str, Datum value, Oid type)
|
||||
{
|
||||
s = (char *) (&value);
|
||||
appendStringInfo(str, " %d [ ", length);
|
||||
for (i = 0; i < sizeof(Datum); i++)
|
||||
for (i = 0; i < (int) sizeof(Datum); i++)
|
||||
appendStringInfo(str, "%d ", (int) (s[i]));
|
||||
appendStringInfo(str, "] ");
|
||||
}
|
||||
@ -1198,7 +1198,7 @@ _outDatum(StringInfo str, Datum value, Oid type)
|
||||
if (((int) length) <= -1)
|
||||
length = VARSIZE(s);
|
||||
appendStringInfo(str, " %d [ ", length);
|
||||
for (i = 0; i < length; i++)
|
||||
for (i = 0; i < (int) length; i++)
|
||||
appendStringInfo(str, "%d ", (int) (s[i]));
|
||||
appendStringInfo(str, "] ");
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.85 2000/02/20 21:32:05 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.86 2000/03/17 02:36:12 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Most of the read functions for plan nodes are tested. (In fact, they
|
||||
@ -1952,11 +1952,11 @@ readDatum(Oid type)
|
||||
|
||||
if (byValue)
|
||||
{
|
||||
if (length > sizeof(Datum))
|
||||
if ((Size) length > sizeof(Datum))
|
||||
elog(ERROR, "readValue: byval & length = %d", length);
|
||||
res = (Datum) 0;
|
||||
s = (char *) (&res);
|
||||
for (i = 0; i < sizeof(Datum); i++)
|
||||
for (i = 0; i < (int) sizeof(Datum); i++)
|
||||
{
|
||||
token = lsptok(NULL, &tokenLength);
|
||||
s[i] = (char) atoi(token);
|
||||
|
Reference in New Issue
Block a user