33 * out of its tuple
44 *
55 * IDENTIFICATION
6- * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.56 2000/07/0605:48:11 tgl Exp $
6+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.57 2000/07/0623:03:37 tgl Exp $
77 *
88 * This software is copyrighted by Jan Wieck - Hamburg.
99 *
@@ -818,7 +818,8 @@ make_viewdef(StringInfo buf, HeapTuple ruletup, TupleDesc rulettc)
818818
819819query = (Query * )lfirst (actions );
820820
821- if (ev_type != '1' || ev_attr >=0 || !is_instead || strcmp (ev_qual ,"<>" ))
821+ if (ev_type != '1' || ev_attr >=0 || !is_instead ||
822+ strcmp (ev_qual ,"<>" )!= 0 )
822823{
823824appendStringInfo (buf ,"Not a view" );
824825return ;
@@ -929,9 +930,9 @@ get_select_query_def(Query *query, deparse_context *context)
929930rte = (RangeTblEntry * )lfirst (l );
930931if (rte -> ref == NULL )
931932continue ;
932- if (! strcmp (rte -> ref -> relname ,"*NEW*" ))
933+ if (strcmp (rte -> ref -> relname ,"*NEW*" )== 0 )
933934continue ;
934- if (! strcmp (rte -> ref -> relname ,"*OLD*" ))
935+ if (strcmp (rte -> ref -> relname ,"*OLD*" )== 0 )
935936continue ;
936937
937938rt_constonly = FALSE;
@@ -948,7 +949,7 @@ get_select_query_def(Query *query, deparse_context *context)
948949sep = " " ;
949950foreach (l ,query -> targetList )
950951{
951- bool tell_as = FALSE ;
952+ bool tell_as = false ;
952953
953954tle = (TargetEntry * )lfirst (l );
954955appendStringInfo (buf ,sep );
@@ -959,16 +960,15 @@ get_select_query_def(Query *query, deparse_context *context)
959960
960961/* Check if we must say AS ... */
961962if (!IsA (tle -> expr ,Var ))
962- tell_as = strcmp (tle -> resdom -> resname ,"?column?" );
963+ tell_as = ( strcmp (tle -> resdom -> resname ,"?column?" ) != 0 );
963964else
964965{
965966Var * var = (Var * ) (tle -> expr );
966967char * attname ;
967968
968969rte = get_rte_for_var (var ,context );
969970attname = get_attribute_name (rte -> relid ,var -> varattno );
970- if (strcmp (attname ,tle -> resdom -> resname ))
971- tell_as = TRUE;
971+ tell_as = (strcmp (attname ,tle -> resdom -> resname )!= 0 );
972972}
973973
974974/* and do if so */
@@ -990,9 +990,9 @@ get_select_query_def(Query *query, deparse_context *context)
990990
991991if (rte -> ref == NULL )
992992continue ;
993- if (! strcmp (rte -> ref -> relname ,"*NEW*" ))
993+ if (strcmp (rte -> ref -> relname ,"*NEW*" )== 0 )
994994continue ;
995- if (! strcmp (rte -> ref -> relname ,"*OLD*" ))
995+ if (strcmp (rte -> ref -> relname ,"*OLD*" )== 0 )
996996continue ;
997997
998998appendStringInfo (buf ,sep );
@@ -1107,9 +1107,9 @@ get_insert_query_def(Query *query, deparse_context *context)
11071107rte = (RangeTblEntry * )lfirst (l );
11081108if (rte -> ref == NULL )
11091109continue ;
1110- if (! strcmp (rte -> ref -> relname ,"*NEW*" ))
1110+ if (strcmp (rte -> ref -> relname ,"*NEW*" )== 0 )
11111111continue ;
1112- if (! strcmp (rte -> ref -> relname ,"*OLD*" ))
1112+ if (strcmp (rte -> ref -> relname ,"*OLD*" )== 0 )
11131113continue ;
11141114
11151115rt_constonly = FALSE;
@@ -1280,9 +1280,9 @@ get_rule_expr(Node *node, deparse_context *context)
12801280if (rte -> ref == NULL )
12811281appendStringInfo (buf ,"%s." ,
12821282quote_identifier (rte -> relname ));
1283- else if (! strcmp (rte -> ref -> relname ,"*NEW*" ))
1283+ else if (strcmp (rte -> ref -> relname ,"*NEW*" )== 0 )
12841284appendStringInfo (buf ,"new." );
1285- else if (! strcmp (rte -> ref -> relname ,"*OLD*" ))
1285+ else if (strcmp (rte -> ref -> relname ,"*OLD*" )== 0 )
12861286appendStringInfo (buf ,"old." );
12871287else
12881288appendStringInfo (buf ,"%s." ,
@@ -1520,14 +1520,14 @@ get_func_expr(Expr *expr, deparse_context *context)
15201520 */
15211521if (procStruct -> pronargs == 1 && procStruct -> proargtypes [0 ]== InvalidOid )
15221522{
1523- if (! strcmp (proname ,"nullvalue" ))
1523+ if (strcmp (proname ,"nullvalue" )== 0 )
15241524{
15251525appendStringInfoChar (buf ,'(' );
15261526get_rule_expr ((Node * )lfirst (expr -> args ),context );
15271527appendStringInfo (buf ," ISNULL)" );
15281528return ;
15291529}
1530- if (! strcmp (proname ,"nonnullvalue" ))
1530+ if (strcmp (proname ,"nonnullvalue" )== 0 )
15311531{
15321532appendStringInfoChar (buf ,'(' );
15331533get_rule_expr ((Node * )lfirst (expr -> args ),context );