1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-12 05:01:15 +03:00

Mark functions as static and ifdef NOT_USED as appropriate.

This commit is contained in:
Bruce Momjian
2000-06-08 22:38:00 +00:00
parent 5690933d6c
commit 20ad43b576
55 changed files with 188 additions and 175 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.48 2000/05/29 19:16:57 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.49 2000/06/08 22:37:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -31,6 +31,17 @@
#include "miscadmin.h"
#include "utils/datetime.h"
static int DecodeNumber(int flen, char *field,
int fmask, int *tmask,
struct tm * tm, double *fsec, int *is2digits);
static int DecodeNumberField(int len, char *str,
int fmask, int *tmask,
struct tm * tm, double *fsec, int *is2digits);
static int DecodeTime(char *str, int fmask, int *tmask,
struct tm * tm, double *fsec);
static int DecodeTimezone(char *str, int *tzp);
static datetkn *datebsearch(char *key, datetkn *base, unsigned int nel);
static int DecodeDate(char *str, int fmask, int *tmask, struct tm * tm);
#define USE_DATE_CACHE 1
#define ROUND_ALL 0
@@ -1155,12 +1166,11 @@ DecodeTimeOnly(char **field, int *ftype, int nf,
return 0;
} /* DecodeTimeOnly() */
/* DecodeDate()
* Decode date string which includes delimiters.
* Insist on a complete set of fields.
*/
int
static int
DecodeDate(char *str, int fmask, int *tmask, struct tm * tm)
{
double fsec;
@@ -1288,7 +1298,7 @@ DecodeDate(char *str, int fmask, int *tmask, struct tm * tm)
* Only check the lower limit on hours, since this same code
* can be used to represent time spans.
*/
int
static int
DecodeTime(char *str, int fmask, int *tmask, struct tm * tm, double *fsec)
{
char *cp;
@@ -1341,7 +1351,7 @@ DecodeTime(char *str, int fmask, int *tmask, struct tm * tm, double *fsec)
/* DecodeNumber()
* Interpret numeric field as a date value in context.
*/
int
static int
DecodeNumber(int flen, char *str, int fmask,
int *tmask, struct tm * tm, double *fsec, int *is2digits)
{
@@ -1445,7 +1455,7 @@ DecodeNumber(int flen, char *str, int fmask,
/* DecodeNumberField()
* Interpret numeric string as a concatenated date field.
*/
int
static int
DecodeNumberField(int len, char *str, int fmask,
int *tmask, struct tm * tm, double *fsec, int *is2digits)
{
@@ -1513,13 +1523,13 @@ DecodeNumberField(int len, char *str, int fmask,
return -1;
return 0;
} /* DecodeNumberField() */
} /* DecodeNumberField() */
/* DecodeTimezone()
* Interpret string as a numeric timezone.
*/
int
static int
DecodeTimezone(char *str, int *tzp)
{
int tz;
@@ -1908,7 +1918,7 @@ DecodeUnits(int field, char *lowtoken, int *val)
* Binary search -- from Knuth (6.2.1) Algorithm B. Special case like this
* is WAY faster than the generic bsearch().
*/
datetkn *
static datetkn *
datebsearch(char *key, datetkn *base, unsigned int nel)
{
datetkn *last = base + nel - 1,

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.58 2000/06/05 07:28:51 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.59 2000/06/08 22:37:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -67,6 +67,8 @@
#include "fmgr.h"
#include "utils/builtins.h"
static void CheckFloat8Val(double val);
#ifndef NAN
#define NAN (0.0/0.0)
#endif
@@ -154,7 +156,7 @@ CheckFloat4Val(double val)
raise an elog warning if it is
*/
void
static void
CheckFloat8Val(double val)
{

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/tid.c,v 1.18 2000/05/30 00:49:53 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/tid.c,v 1.19 2000/06/08 22:37:28 momjian Exp $
*
* NOTES
* input routine largely stolen from boxin().
@@ -114,6 +114,7 @@ tideq(ItemPointer arg1, ItemPointer arg2)
arg1->ip_posid == arg2->ip_posid);
}
#ifdef NOT_USED
bool
tidne(ItemPointer arg1, ItemPointer arg2)
{
@@ -123,7 +124,9 @@ tidne(ItemPointer arg1, ItemPointer arg2)
BlockIdGetBlockNumber(&(arg2->ip_blkid)) ||
arg1->ip_posid != arg2->ip_posid);
}
#endif
#ifdef NOT_USED
text *
tid_text(ItemPointer tid)
{
@@ -135,7 +138,9 @@ tid_text(ItemPointer tid)
return textin(str);
} /* tid_text() */
#endif
#ifdef NOT_USED
ItemPointer
text_tid(const text *string)
{
@@ -151,7 +156,7 @@ text_tid(const text *string)
return result;
} /* text_tid() */
#endif
/*
* Functions to get latest tid of a specified tuple.

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.27 2000/05/29 01:59:08 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.28 2000/06/08 22:37:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -35,6 +35,11 @@
static double time2t(const int hour, const int min, const double sec);
static int EncodeSpecialTimestamp(Timestamp dt, char *str);
static Timestamp dt2local(Timestamp dt, int timezone);
static void dt2time(Timestamp dt, int *hour, int *min, double *sec);
static int interval2tm(Interval span, struct tm * tm, float8 *fsec);
static int tm2interval(struct tm * tm, double fsec, Interval *span);
/*****************************************************************************
@@ -120,15 +125,9 @@ timestamp_out(Timestamp *dt)
return NULL;
if (TIMESTAMP_IS_RESERVED(*dt))
{
EncodeSpecialTimestamp(*dt, buf);
}
else if (timestamp2tm(*dt, &tz, tm, &fsec, &tzn) == 0)
{
EncodeDateTime(tm, fsec, &tz, &tzn, DateStyle, buf);
}
else
EncodeSpecialTimestamp(DT_INVALID, buf);
@@ -228,7 +227,7 @@ interval_out(Interval *span)
/* EncodeSpecialTimestamp()
* Convert reserved timestamp data type to string.
*/
int
static int
EncodeSpecialTimestamp(Timestamp dt, char *str)
{
if (TIMESTAMP_IS_RESERVED(dt))
@@ -266,7 +265,7 @@ now(void)
return result;
}
void
static void
dt2time(Timestamp jd, int *hour, int *min, double *sec)
{
double time;
@@ -434,7 +433,7 @@ tm2timestamp(struct tm * tm, double fsec, int *tzp, Timestamp *result)
/* interval2tm()
* Convert a interval data type to a tm structure.
*/
int
static int
interval2tm(Interval span, struct tm * tm, float8 *fsec)
{
double time;
@@ -466,7 +465,7 @@ interval2tm(Interval span, struct tm * tm, float8 *fsec)
return 0;
} /* interval2tm() */
int
static int
tm2interval(struct tm * tm, double fsec, Interval *span)
{
span->month = ((tm->tm_year * 12) + tm->tm_mon);
@@ -485,7 +484,7 @@ time2t(const int hour, const int min, const double sec)
return (((hour * 60) + min) * 60) + sec;
} /* time2t() */
Timestamp
static Timestamp
dt2local(Timestamp dt, int tz)
{
dt -= tz;