1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

Compile and warning cleanup

This commit is contained in:
Bruce Momjian
1996-11-08 06:02:30 +00:00
parent d79bb2fd0e
commit 4b2b8592a0
85 changed files with 342 additions and 228 deletions

View File

@ -4,7 +4,7 @@
# Makefile for parser
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.1 1996/10/27 09:49:05 bryanh Exp $
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.2 1996/11/08 05:57:18 momjian Exp $
#
#-------------------------------------------------------------------------
@ -16,7 +16,7 @@ INCLUDE_OPT = -I.. \
-I../include \
-I../../include
CFLAGS+=$(INCLUDE_OPT)
CFLAGS+=$(INCLUDE_OPT) -Wno-error
OBJS = analyze.o catalog_utils.o dbcommands.o gram.o \
keywords.o parser.o parse_query.o scan.o scansup.o sysfunc.o

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.12 1996/11/06 06:48:20 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.13 1996/11/08 05:57:25 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -274,7 +274,6 @@ static Query *
transformInsertStmt(ParseState *pstate, AppendStmt *stmt)
{
Query *qry = makeNode(Query); /* make a new query tree */
List *targetlist;
qry->commandType = CMD_INSERT;
pstate->p_is_insert = true;
@ -531,7 +530,7 @@ transformCursorStmt(ParseState *pstate, CursorStmt *stmt)
static Node *
transformExpr(ParseState *pstate, Node *expr)
{
Node *result;
Node *result = NULL;
if (expr==NULL)
return NULL;
@ -809,7 +808,7 @@ makeRangeTable(ParseState *pstate, char *relname, List *frmList)
Oid
exprType(Node *expr)
{
Oid type;
Oid type = (Oid)0;
switch(nodeTag(expr)) {
case T_Func:
@ -1426,7 +1425,7 @@ static Resdom *
find_tl_elt(ParseState *pstate, char *refname, char *colname, List *tlist)
{
List *i;
int real_rtable_pos;
int real_rtable_pos = 0;
if(refname)
real_rtable_pos = refnameRangeTablePosn(pstate->p_rtable, refname);
@ -1471,7 +1470,7 @@ any_ordering_op(int restype)
static List *
transformGroupClause(ParseState *pstate, List *grouplist)
{
List *glist = NIL, *gl;
List *glist = NIL, *gl = NIL;
while (grouplist != NIL) {
GroupClause *grpcl = makeNode(GroupClause);
@ -1505,7 +1504,7 @@ transformSortClause(ParseState *pstate,
char* uniqueFlag)
{
List *sortlist = NIL;
List *s, *i;
List *s = NIL, *i;
while(orderlist != NIL) {
SortBy *sortby = lfirst(orderlist);
@ -1555,7 +1554,7 @@ transformSortClause(ParseState *pstate,
}
}
else {
TargetEntry *tlelt;
TargetEntry *tlelt = NULL;
char* uniqueAttrName = uniqueFlag;
/* only create sort clause with the specified unique attribute */
@ -1873,12 +1872,12 @@ static Node *
ParseFunc(ParseState *pstate, char *funcname, List *fargs, int *curr_resno)
{
Oid rettype = (Oid)0;
Oid argrelid;
Oid argrelid = (Oid)0;
Oid funcid = (Oid)0;
List *i = NIL;
Node *first_arg= NULL;
char *relname;
char *refname;
char *relname = NULL;
char *refname = NULL;
Relation rd;
Oid relid;
int nargs;
@ -1889,7 +1888,7 @@ ParseFunc(ParseState *pstate, char *funcname, List *fargs, int *curr_resno)
bool retset;
bool exists;
bool attisset = false;
Oid toid;
Oid toid = (Oid)0;
Expr *expr;
if (fargs) {

View File

@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.7 1996/11/06 06:48:23 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.8 1996/11/08 05:57:29 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -1423,7 +1423,7 @@ FindDelimiter(char *typename)
void
op_error(char *op, int arg1, int arg2)
{
Type tp1, tp2;
Type tp1 = NULL, tp2 = NULL;
if (check_typeid(arg1)) {
tp1 = get_id_type(arg1);

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/dbcommands.c,v 1.1.1.1 1996/07/09 06:21:40 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/dbcommands.c,v 1.2 1996/11/08 05:57:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -153,7 +153,7 @@ check_permissions(char *command,
{
Relation dbrel;
HeapTuple dbtup, utup;
Oid dbowner;
Oid dbowner = (Oid)0;
char use_createdb;
bool dbfound;
bool use_super;

View File

@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.5 1996/11/06 06:48:26 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.6 1996/11/08 05:57:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -37,12 +37,18 @@
#include "nodes/makefuncs.h"
#include "optimizer/clauses.h"
void init_io(); /* from scan.l */
void parser_init(Oid *typev, int nargs); /* from gram.y */
int yyparse(); /* from gram.c */
char *parseString; /* the char* which holds the string to be parsed */
char *parseCh; /* a pointer used during parsing to walk down ParseString*/
List *parsetree = NIL;
#ifdef SETS_FIXED
static void fixupsets();
#endif
static void define_sets();
/*
* parser-- returns a list of parse trees
@ -99,6 +105,7 @@ parser(char *str, Oid *typev, int nargs)
return queryList;
}
#ifdef SETS_FIXED
static void
fixupsets(Query *parse)
{
@ -110,6 +117,7 @@ fixupsets(Query *parse)
return;
define_sets(parse);
}
#endif
/* Recursively find all of the Consts in the parsetree. Some of
* these may represent a set. The value of the Const will be the
@ -180,7 +188,7 @@ parser_typecast(Value *expr, TypeName *typename, int typlen)
char type_string[16];
int32 len;
char *cp = NULL;
char *const_string;
char *const_string = NULL;
bool string_palloced = false;
switch(nodeTag(expr)) {
@ -297,7 +305,7 @@ parser_typecast2(Node *expr, int exprType, Type tp, int typlen)
int32 len = tlen(tp);
char *cp = NULL;
char *const_string;
char *const_string = NULL;
bool string_palloced = false;
Assert(IsA(expr,Const));

View File

@ -33,10 +33,10 @@ char *Sysfunc_system_date(void)
time(&cur_time_secs);
cur_time_expanded = localtime(&cur_time_secs);
#if defined(EUROPEAN_DATES)
sprintf(buf, "%02.2d-%02.2d-%04.4d", cur_time_expanded->tm_mday,
sprintf(buf, "%2.2d-%2.2d-%4.4d", cur_time_expanded->tm_mday,
cur_time_expanded->tm_mon+1, cur_time_expanded->tm_year+1900);
#else
sprintf(buf, "%02.2d-%02.2d-%04.4d", cur_time_expanded->tm_mon+1,
sprintf(buf, "%2.2d-%2.2d-%4.4d", cur_time_expanded->tm_mon+1,
cur_time_expanded->tm_mday, cur_time_expanded->tm_year+1900);
#endif
return &buf[0];