Commit a3c5a3cb authored by Bruce Momjian's avatar Bruce Momjian

Cleanup for oid8[] from Tatsuo Ishii.

parent 738dc876
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.18 1998/09/01 04:30:12 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.19 1998/09/22 20:28:07 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -429,9 +429,7 @@ flatten_tlist_vars(List *full_tlist, List *flat_tlist) ...@@ -429,9 +429,7 @@ flatten_tlist_vars(List *full_tlist, List *flat_tlist)
{ {
TargetEntry *tle = lfirst(x); TargetEntry *tle = lfirst(x);
result = result = lappend(result, makeTargetEntry(tle->resdom,
lappend(result,
makeTargetEntry(tle->resdom,
flatten_tlistentry((Node *) get_expr(tle), flatten_tlistentry((Node *) get_expr(tle),
flat_tlist))); flat_tlist)));
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.18 1998/09/01 06:22:43 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.19 1998/09/22 20:28:09 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -80,34 +80,35 @@ int2out(int16 sh) ...@@ -80,34 +80,35 @@ int2out(int16 sh)
int16 * int16 *
int28in(char *shs) int28in(char *shs)
{ {
int16 (*result)[]; int16 *result;
int nums; int nums;
if (shs == NULL) if (shs == NULL)
return NULL; return NULL;
result = (int16 (*)[]) palloc(sizeof(int16[8]));
result = (int16 *) palloc(sizeof(int16[8]));
if ((nums = sscanf(shs, "%hd%hd%hd%hd%hd%hd%hd%hd", if ((nums = sscanf(shs, "%hd%hd%hd%hd%hd%hd%hd%hd",
*result, &result[0],
*result + 1, &result[1],
*result + 2, &result[2],
*result + 3, &result[3],
*result + 4, &result[4],
*result + 5, &result[5],
*result + 6, &result[6],
*result + 7)) != 8) &result[7])) != 8)
{ {
do do
(*result)[nums++] = 0; result[nums++] = 0;
while (nums < 8); while (nums < 8);
} }
return (int16 *) result; return result;
} }
/* /*
* int28out - converts internal form to "num num ..." * int28out - converts internal form to "num num ..."
*/ */
char * char *
int28out(int16 (*shs)[]) int28out(int16 *shs)
{ {
int num; int num;
int16 *sp; int16 *sp;
...@@ -123,7 +124,7 @@ int28out(int16 (*shs)[]) ...@@ -123,7 +124,7 @@ int28out(int16 (*shs)[])
} }
rp = result = (char *) palloc(8 * 7); /* assumes sign, 5 digits, rp = result = (char *) palloc(8 * 7); /* assumes sign, 5 digits,
* ' ' */ * ' ' */
sp = *shs; sp = shs;
for (num = 8; num != 0; num--) for (num = 8; num != 0; num--)
{ {
itoa(*sp++, rp); itoa(*sp++, rp);
...@@ -136,7 +137,7 @@ int28out(int16 (*shs)[]) ...@@ -136,7 +137,7 @@ int28out(int16 (*shs)[])
} }
/* /*
* int28in - converts "num num ..." to internal form * int44in - converts "num num ..." to internal form
* *
* Note: * Note:
* Fills any nonexistent digits with NULLs. * Fills any nonexistent digits with NULLs.
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.19 1998/09/01 05:34:14 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.20 1998/09/22 20:28:10 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -31,34 +31,35 @@ ...@@ -31,34 +31,35 @@
Oid * Oid *
oid8in(char *oidString) oid8in(char *oidString)
{ {
Oid (*result)[]; Oid *result;
int nums; int nums;
if (oidString == NULL) if (oidString == NULL)
return NULL; return NULL;
result = (Oid (*)[]) palloc(sizeof(Oid[8]));
result = (Oid *) palloc(sizeof(Oid[8]));
if ((nums = sscanf(oidString, "%d%d%d%d%d%d%d%d", if ((nums = sscanf(oidString, "%d%d%d%d%d%d%d%d",
&(*result)[0], &result[0],
&(*result)[1], &result[1],
&(*result)[2], &result[2],
&(*result)[3], &result[3],
&(*result)[4], &result[4],
&(*result)[5], &result[5],
&(*result)[6], &result[6],
&(*result)[7])) != 8) &result[7])) != 8)
{ {
do do
(*result)[nums++] = 0; result[nums++] = 0;
while (nums < 8); while (nums < 8);
} }
return (Oid *) result; return result;
} }
/* /*
* oid8out - converts internal form to "num num ..." * oid8out - converts internal form to "num num ..."
*/ */
char * char *
oid8out(Oid (*oidArray)[]) oid8out(Oid *oidArray)
{ {
int num; int num;
Oid *sp; Oid *sp;
...@@ -75,7 +76,7 @@ oid8out(Oid (*oidArray)[]) ...@@ -75,7 +76,7 @@ oid8out(Oid (*oidArray)[])
/* assumes sign, 10 digits, ' ' */ /* assumes sign, 10 digits, ' ' */
rp = result = (char *) palloc(8 * 12); rp = result = (char *) palloc(8 * 12);
sp = *oidArray; sp = oidArray;
for (num = 8; num != 0; num--) for (num = 8; num != 0; num--)
{ {
ltoa(*sp++, rp); ltoa(*sp++, rp);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.27 1998/09/18 04:43:18 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.28 1998/09/22 20:28:11 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -211,7 +211,7 @@ regprocout(RegProcedure proid) ...@@ -211,7 +211,7 @@ regprocout(RegProcedure proid)
* int8typeout - converts int8 type oids to "typname" list * int8typeout - converts int8 type oids to "typname" list
*/ */
text * text *
oid8types(Oid (*oidArray)[]) oid8types(Oid *oidArray)
{ {
HeapTuple typetup; HeapTuple typetup;
text *result; text *result;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: builtins.h,v 1.54 1998/09/18 04:43:20 momjian Exp $ * $Id: builtins.h,v 1.55 1998/09/22 20:28:13 momjian Exp $
* *
* NOTES * NOTES
* This should normally only be included by fmgr.h. * This should normally only be included by fmgr.h.
...@@ -64,7 +64,7 @@ extern bool cideq(int8 arg1, int8 arg2); ...@@ -64,7 +64,7 @@ extern bool cideq(int8 arg1, int8 arg2);
extern int32 int2in(char *num); extern int32 int2in(char *num);
extern char *int2out(int16 sh); extern char *int2out(int16 sh);
extern int16 *int28in(char *shs); extern int16 *int28in(char *shs);
extern char *int28out(int16 (*shs)[]); extern char *int28out(int16 *shs);
extern int32 *int44in(char *input_string); extern int32 *int44in(char *input_string);
extern char *int44out(int32 *an_array); extern char *int44out(int32 *an_array);
extern int32 int4in(char *num); extern int32 int4in(char *num);
...@@ -329,7 +329,7 @@ extern bool oidnotin(Oid the_oid, char *compare); ...@@ -329,7 +329,7 @@ extern bool oidnotin(Oid the_oid, char *compare);
/* oid.c */ /* oid.c */
extern Oid *oid8in(char *oidString); extern Oid *oid8in(char *oidString);
extern char *oid8out(Oid (*oidArray)[]); extern char *oid8out(Oid *oidArray);
extern Oid oidin(char *s); extern Oid oidin(char *s);
extern char *oidout(Oid o); extern char *oidout(Oid o);
extern bool oideq(Oid arg1, Oid arg2); extern bool oideq(Oid arg1, Oid arg2);
...@@ -358,7 +358,7 @@ extern bool texticregexne(struct varlena * s, struct varlena * p); ...@@ -358,7 +358,7 @@ extern bool texticregexne(struct varlena * s, struct varlena * p);
/* regproc.c */ /* regproc.c */
extern int32 regprocin(char *pro_name_and_oid); extern int32 regprocin(char *pro_name_and_oid);
extern char *regprocout(RegProcedure proid); extern char *regprocout(RegProcedure proid);
extern text *oid8types(Oid (*oidArray)[]); extern text *oid8types(Oid *oidArray);
extern Oid regproctooid(RegProcedure rp); extern Oid regproctooid(RegProcedure rp);
/* define macro to replace mixed-case function call - tgl 97/04/27 */ /* define macro to replace mixed-case function call - tgl 97/04/27 */
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#ifndef PGENV_H #ifndef PGENV_H
#define PGENV_H #define PGENV_H
#include <string.h> #include <string>
// //
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment