mirror of
https://github.com/postgres/postgres.git
synced 2025-09-08 00:47:37 +03:00
Clean up possibly-uninitialized-variable warnings reported by gcc 4.x.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.250 2005/09/24 17:53:12 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.251 2005/09/24 22:54:36 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -542,7 +542,10 @@ CopyGetInt32(CopyState cstate, int32 *val)
|
||||
uint32 buf;
|
||||
|
||||
if (CopyGetData(cstate, &buf, sizeof(buf), sizeof(buf)) != sizeof(buf))
|
||||
{
|
||||
*val = 0; /* suppress compiler warning */
|
||||
return false;
|
||||
}
|
||||
*val = (int32) ntohl(buf);
|
||||
return true;
|
||||
}
|
||||
@@ -568,7 +571,10 @@ CopyGetInt16(CopyState cstate, int16 *val)
|
||||
uint16 buf;
|
||||
|
||||
if (CopyGetData(cstate, &buf, sizeof(buf), sizeof(buf)) != sizeof(buf))
|
||||
{
|
||||
*val = 0; /* suppress compiler warning */
|
||||
return false;
|
||||
}
|
||||
*val = (int16) ntohs(buf);
|
||||
return true;
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.67 2005/09/08 20:07:41 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.68 2005/09/24 22:54:36 tgl Exp $
|
||||
*
|
||||
* DESCRIPTION
|
||||
* These routines take the parse tree and pick out the
|
||||
@@ -158,6 +158,8 @@ examine_parameter_list(List *parameters, Oid languageOid,
|
||||
ListCell *x;
|
||||
int i;
|
||||
|
||||
*requiredResultType = InvalidOid; /* default result */
|
||||
|
||||
inTypes = (Oid *) palloc(parameterCount * sizeof(Oid));
|
||||
allTypes = (Datum *) palloc(parameterCount * sizeof(Datum));
|
||||
paramModes = (Datum *) palloc(parameterCount * sizeof(Datum));
|
||||
@@ -243,7 +245,6 @@ examine_parameter_list(List *parameters, Oid languageOid,
|
||||
{
|
||||
*allParameterTypes = NULL;
|
||||
*parameterModes = NULL;
|
||||
*requiredResultType = InvalidOid;
|
||||
}
|
||||
|
||||
if (have_names)
|
||||
@@ -383,16 +384,22 @@ compute_attributes_sql_style(List *options,
|
||||
if (as_item)
|
||||
*as = (List *) as_item->arg;
|
||||
else
|
||||
{
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_FUNCTION_DEFINITION),
|
||||
errmsg("no function body specified")));
|
||||
*as = NIL; /* keep compiler quiet */
|
||||
}
|
||||
|
||||
if (language_item)
|
||||
*language = strVal(language_item->arg);
|
||||
else
|
||||
{
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_FUNCTION_DEFINITION),
|
||||
errmsg("no language specified")));
|
||||
*language = NULL; /* keep compiler quiet */
|
||||
}
|
||||
|
||||
/* process optional items */
|
||||
if (volatility_item)
|
||||
|
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.170 2005/08/26 03:07:16 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.171 2005/09/24 22:54:36 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -4109,6 +4109,8 @@ transformFkeyGetPrimaryKey(Relation pkrel, Oid *indexOid,
|
||||
* look up each one in the pg_index syscache until we find one marked
|
||||
* primary key (hopefully there isn't more than one such).
|
||||
*/
|
||||
*indexOid = InvalidOid;
|
||||
|
||||
indexoidlist = RelationGetIndexList(pkrel);
|
||||
|
||||
foreach(indexoidscan, indexoidlist)
|
||||
@@ -4127,7 +4129,6 @@ transformFkeyGetPrimaryKey(Relation pkrel, Oid *indexOid,
|
||||
break;
|
||||
}
|
||||
ReleaseSysCache(indexTuple);
|
||||
indexStruct = NULL;
|
||||
}
|
||||
|
||||
list_free(indexoidlist);
|
||||
@@ -4135,7 +4136,7 @@ transformFkeyGetPrimaryKey(Relation pkrel, Oid *indexOid,
|
||||
/*
|
||||
* Check that we found it
|
||||
*/
|
||||
if (indexStruct == NULL)
|
||||
if (!OidIsValid(*indexOid))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_UNDEFINED_OBJECT),
|
||||
errmsg("there is no primary key for referenced table \"%s\"",
|
||||
|
Reference in New Issue
Block a user