mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +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:
@@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-pqexec.c,v 1.30 2000/01/26 05:56:28 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-pqexec.c,v 1.31 2000/03/17 02:36:08 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -73,7 +73,7 @@ PQfn(int fnid,
|
||||
{
|
||||
if (args[i].len == VAR_LENGTH_ARG)
|
||||
arg[i] = (char *) args[i].u.ptr;
|
||||
else if (args[i].len > sizeof(int4))
|
||||
else if ((Size) args[i].len > sizeof(int4))
|
||||
elog(ERROR, "arg_length of argument %d too long", i);
|
||||
else
|
||||
arg[i] = (char *) args[i].u.integer;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* wherein you authenticate a user by seeing what IP address the system
|
||||
* says he comes from and possibly using ident).
|
||||
*
|
||||
* $Id: hba.c,v 1.49 1999/10/23 03:13:21 tgl Exp $
|
||||
* $Id: hba.c,v 1.50 2000/03/17 02:36:08 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -487,7 +487,7 @@ interpret_ident_response(char *ident_response,
|
||||
cursor++; /* skip blanks */
|
||||
i = 0;
|
||||
while (*cursor != ':' && *cursor != '\r' && !isblank(*cursor)
|
||||
&& i < sizeof(response_type) - 1)
|
||||
&& i < (int) (sizeof(response_type) - 1))
|
||||
response_type[i++] = *cursor++;
|
||||
response_type[i] = '\0';
|
||||
while (isblank(*cursor))
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: portal.c,v 1.29 2000/01/26 05:56:29 momjian Exp $
|
||||
* $Id: portal.c,v 1.30 2000/03/17 02:36:08 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -106,7 +106,7 @@ PQnportals(int rule_p)
|
||||
int i,
|
||||
n = 0;
|
||||
|
||||
for (i = 0; i < portals_array_size; ++i)
|
||||
for (i = 0; i < (int) portals_array_size; ++i)
|
||||
{
|
||||
if (portals[i] && portals[i]->portal)
|
||||
{
|
||||
@@ -138,7 +138,7 @@ PQpnames(char **pnames, int rule_p)
|
||||
if (!valid_pointer("PQpnames: invalid name buffer", pnames))
|
||||
return;
|
||||
|
||||
for (i = 0; i < portals_array_size; ++i)
|
||||
for (i = 0; i < (int) portals_array_size; ++i)
|
||||
{
|
||||
if (portals[i] && portals[i]->portal)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portalbuf.c,v 1.22 2000/01/26 05:56:29 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portalbuf.c,v 1.23 2000/03/17 02:36:08 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -90,7 +90,7 @@ portals_realloc(size_t size)
|
||||
libpq_raise(&PortalError,
|
||||
vararg_format("Cannot alloc more memory in portals_realloc"));
|
||||
|
||||
for (i = oldsize; i < portals_array_size; i++)
|
||||
for (i = oldsize; i < (int) portals_array_size; i++)
|
||||
portals[i] = (PortalEntry *) NULL;
|
||||
|
||||
}
|
||||
@@ -365,7 +365,7 @@ pbuf_getIndex(char *pname)
|
||||
|
||||
if (portals)
|
||||
{
|
||||
for (i = 0; i < portals_array_size; i++)
|
||||
for (i = 0; i < (int) portals_array_size; i++)
|
||||
if (portals[i] != NULL &&
|
||||
strncmp(portals[i]->name, pname, PortalNameLength) == 0)
|
||||
return i;
|
||||
@@ -407,12 +407,12 @@ pbuf_setup(char *pname)
|
||||
pbuf_freePortal(portals[i]->portal);
|
||||
else
|
||||
{
|
||||
for (i = 0; i < portals_array_size; i++)
|
||||
for (i = 0; i < (int) portals_array_size; i++)
|
||||
if (portals[i] == NULL)
|
||||
break;
|
||||
|
||||
/* If the portal table is full, enlarge it */
|
||||
if (i >= portals_array_size)
|
||||
if (i >= (int) portals_array_size)
|
||||
portals_realloc(PORTALS_GROW_BY);
|
||||
|
||||
portals[i] = pbuf_addEntry();
|
||||
|
||||
Reference in New Issue
Block a user