1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-17 06:41:09 +03:00

Remove un-needed braces around single statements.

This commit is contained in:
Bruce Momjian
1998-06-15 19:30:31 +00:00
parent 27db9ecd0b
commit 6bd323c6b3
224 changed files with 221 additions and 2504 deletions

View File

@ -218,7 +218,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/gram.c,v 2.12 1998/06/13 04:27:15 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/gram.c,v 2.13 1998/06/15 19:28:51 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_agg.c,v 1.10 1998/03/30 16:36:36 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_agg.c,v 1.11 1998/06/15 19:28:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -351,9 +351,7 @@ agg_error(char *caller, char *aggname, Oid basetypeID)
*/
if (basetypeID == InvalidOid)
{
elog(ERROR, "%s: aggregate '%s' for all types does not exist", caller, aggname);
}
else
{
elog(ERROR, "%s: aggregate '%s' for '%s' does not exist", caller, aggname,

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.29 1998/05/29 14:00:21 thomas Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.30 1998/06/15 19:28:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -90,9 +90,7 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
result = (Node *) make_array_ref(temp, att->indirection);
}
else
{
result = temp;
}
break;
}
case T_A_Const:
@ -465,9 +463,7 @@ parser_typecast(Value *expr, TypeName *typename, int16 atttypmod)
tp = (Type) typenameType(type_string);
}
else
{
tp = (Type) typenameType(typename->name);
}
len = typeLen(tp);

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.18 1998/05/29 14:00:21 thomas Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.19 1998/06/15 19:28:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -278,9 +278,7 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
PointerGetDatum(funcname),
0, 0, 0)))
&& IS_BINARY_COMPATIBLE(typeTypeId(tp), basetype))
{
return((Node *)lfirst(fargs));
}
}
}
@ -668,13 +666,9 @@ func_select_candidate(int nargs,
{
if ((input_typeids[i] != UNKNOWNOID)
&& (current_typeids[i] == input_typeids[i]))
{
nmatch++;
}
else if (IS_BINARY_COMPATIBLE(current_typeids[i], input_typeids[i]))
{
nident++;
}
}
if ((nmatch + nident) == nargs)
@ -791,9 +785,7 @@ printf("func_select_candidate- column #%d input type is %s\n",
for (current_candidate = candidates;
current_candidate != NULL;
current_candidate = current_candidate->next)
{
ncandidates++;
}
}
if (ncandidates == 1)
@ -970,9 +962,7 @@ argtype_inherit(int nargs, Oid *oid_array)
{
arginh[i].self = oid_array[i];
if ((relid = typeidTypeRelid(oid_array[i])) != InvalidOid)
{
arginh[i].nsupers = find_inheritors(relid, &(arginh[i].supervec));
}
else
{
arginh[i].nsupers = 0;
@ -1105,9 +1095,7 @@ find_inheritors(Oid relid, Oid **supervec)
}
else
{
*supervec = (Oid *) NULL;
}
return (nvisited);
}

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_oper.c,v 1.12 1998/05/29 14:00:22 thomas Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_oper.c,v 1.13 1998/06/15 19:28:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -217,9 +217,7 @@ oper_select_candidate(int nargs,
{
if ((input_typeids[i] != UNKNOWNOID)
&& (current_typeids[i] == input_typeids[i]))
{
nmatch++;
}
}
#ifdef PARSEDEBUG
@ -257,9 +255,7 @@ printf("oper_select_candidate- reject candidate as possible match\n");
{
if (!can_coerce_type(1, &input_typeids[0], &candidates->args[0])
|| !can_coerce_type(1, &input_typeids[1], &candidates->args[1]))
{
ncandidates = 0;
}
return ((ncandidates == 1)? candidates->args: NULL);
}
@ -283,14 +279,10 @@ printf("oper_select_candidate- reject candidate as possible match\n");
if (input_typeids[i] != UNKNOWNOID)
{
if (current_typeids[i] == input_typeids[i])
{
nmatch++;
}
else if (IsPreferredType(current_category, current_typeids[i])
&& can_coerce_type(1, &input_typeids[i], &current_typeids[i]))
{
nmatch++;
}
}
}
@ -348,13 +340,9 @@ printf("oper_select_candidate- unable to coerce preferred candidate\n");
{
if ((input_typeids[i] != UNKNOWNOID)
&& (input_typeids[i] != InvalidOid))
{
current_type = input_typeids[i];
}
else
{
unknownOids = TRUE;
}
}
if (unknownOids && (current_type != UNKNOWNOID))
@ -510,14 +498,10 @@ printf("oper_exact: commutative operator found\n");
}
/* disable for now... - thomas 1998-05-14 */
else
{
tup = NULL;
}
}
if (!HeapTupleIsValid(tup) && (!noWarnings))
{
op_error(op, arg1, arg2);
}
}
return tup;
@ -589,9 +573,7 @@ printf("oper_inexact: found candidate\n");
}
else
{
tup = NULL;
}
/* Could not choose one, for whatever reason... */
if (!HeapTupleIsValid(tup))
@ -757,9 +739,7 @@ right_oper(char *op, Oid arg)
Int8GetDatum('r'));
}
else
{
tup = NULL;
}
if (!HeapTupleIsValid(tup))
{
@ -846,9 +826,7 @@ op_error(char *op, Oid arg1, Oid arg2)
tp2 = NULL;
if (typeidIsValid(arg1))
{
tp1 = typeidType(arg1);
}
else
{
elog(ERROR, "Left hand side of operator '%s' has an unknown type"
@ -856,9 +834,7 @@ op_error(char *op, Oid arg1, Oid arg2)
}
if (typeidIsValid(arg2))
{
tp2 = typeidType(arg2);
}
else
{
elog(ERROR, "Right hand side of operator %s has an unknown type"

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.15 1998/06/05 03:49:18 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.16 1998/06/15 19:28:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -164,9 +164,7 @@ transformTargetList(ParseState *pstate, List *targetlist)
lindx[i] = ((Const *) aind->lidx)->constvalue;
}
else
{
lindx[i] = 1;
}
if (lindx[i] > uindx[i])
elog(ERROR, "yyparse: lower index cannot be greater than upper index");
@ -336,9 +334,7 @@ transformTargetList(ParseState *pstate, List *targetlist)
}
if (p_target == NIL)
{
p_target = tail_p_target = lcons(tent, NIL);
}
else
{
lnext(tail_p_target) = lcons(tent, NIL);
@ -379,20 +375,14 @@ printf("parse_target: try coercing from %s to %s via text\n",
{
}
else if (can_coerce_type(1, &type_id, &text_id))
{
expr = coerce_type(pstate, expr, type_id, text_id);
}
else
{
expr = NULL;
}
}
#endif
else
{
expr = NULL;
}
return expr;
} /* coerce_target_expr() */
@ -521,13 +511,9 @@ make_targetlist_expr(ParseState *pstate,
Oid typelem;
if (arrayRef && !(((A_Indices *) lfirst(arrayRef))->lidx))
{
typelem = typeidTypElem(attrtype);
}
else
{
typelem = attrtype;
}
expr = coerce_target_expr(pstate, expr, type_id, typelem);
@ -550,9 +536,7 @@ printf("parse_target: attrtypmod is %d\n", (int4) attrtypmod);
* Then explicitly size for storage...
*/
if (attrtypmod > 0)
{
expr = size_target_expr(pstate, expr, attrtype, attrtypmod);
}
}
if (arrayRef != NIL)

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_type.c,v 1.10 1998/05/29 14:00:24 thomas Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_type.c,v 1.11 1998/06/15 19:28:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -79,14 +79,10 @@ typenameType(char *s)
HeapTuple tup;
if (s == NULL)
{
elog(ERROR, "type(): Null type");
}
if (!(tup = SearchSysCacheTuple(TYPNAME, PointerGetDatum(s), 0, 0, 0)))
{
elog(ERROR, "type name lookup of %s failed", s);
}
return ((Type) tup);
}
@ -209,9 +205,7 @@ typeidTypElem(Oid type_id)
if (!(typeTuple = SearchSysCacheTuple(TYPOID,
ObjectIdGetDatum(type_id),
0, 0, 0)))
{
elog(ERROR, "type id lookup of %u failed", type_id);
}
type = (TypeTupleForm) GETSTRUCT(typeTuple);
return (type->typelem);

View File

@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.33 1998/02/26 04:33:37 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.34 1998/06/15 19:28:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -111,9 +111,7 @@ define_sets(Node *clause)
bool oidbyval = typeByVal(t);
if (clause == NULL)
{
return;
}
else if (IsA(clause, LispList))
{
define_sets(lfirst(clause));
@ -123,9 +121,7 @@ define_sets(Node *clause)
{
if (get_constisnull((Const) clause) ||
!get_constisset((Const) clause))
{
return;
}
setoid = SetDefine(((Const *) clause)->constvalue,
typeidTypeName(((Const *) clause)->consttype));
set_constvalue((Const) clause, setoid);
@ -134,22 +130,16 @@ define_sets(Node *clause)
set_constypeByVal((Const) clause, oidbyval);
}
else if (IsA(clause, Iter))
{
define_sets(((Iter *) clause)->iterexpr);
}
else if (single_node(clause))
{
return;
}
else if (or_clause(clause) || and_clause(clause))
{
List *temp;
/* mapcan */
foreach(temp, ((Expr *) clause)->args)
{
define_sets(lfirst(temp));
}
}
else if (is_funcclause(clause))
{
@ -157,18 +147,12 @@ define_sets(Node *clause)
/* mapcan */
foreach(temp, ((Expr *) clause)->args)
{
define_sets(lfirst(temp));
}
}
else if (IsA(clause, ArrayRef))
{
define_sets(((ArrayRef *) clause)->refassgnexpr);
}
else if (not_clause(clause))
{
define_sets(get_notclausearg(clause));
}
else if (is_opclause(clause))
{
define_sets(get_leftop(clause));

View File

@ -1,7 +1,7 @@
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.20 1998/05/09 23:27:39 thomas Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.21 1998/06/15 19:28:56 momjian Exp $
*/
#define FLEX_SCANNER
@ -555,7 +555,7 @@ char *yytext;
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.20 1998/05/09 23:27:39 thomas Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.21 1998/06/15 19:28:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/