aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2011-12-18 19:04:19 +0100
committerMichael Meskes <meskes@postgresql.org>2011-12-18 19:04:19 +0100
commit59e242a4969d2efa6ce68dc7aab3cbd8cf975b08 (patch)
tree4e7e82fbffc6ee8038956b22fd3769265d67bd38 /src
parent22232834c54c315ed57708806c9f8a9b962e2988 (diff)
downloadpostgresql-59e242a4969d2efa6ce68dc7aab3cbd8cf975b08.tar.gz
postgresql-59e242a4969d2efa6ce68dc7aab3cbd8cf975b08.zip
Mark variables as const in pgtypeslib if they only carry a format string.
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/ecpg/include/pgtypes_date.h4
-rw-r--r--src/interfaces/ecpg/include/pgtypes_timestamp.h4
-rw-r--r--src/interfaces/ecpg/pgtypeslib/common.c2
-rw-r--r--src/interfaces/ecpg/pgtypeslib/datetime.c4
-rw-r--r--src/interfaces/ecpg/pgtypeslib/extern.h2
-rw-r--r--src/interfaces/ecpg/pgtypeslib/timestamp.c10
6 files changed, 13 insertions, 13 deletions
diff --git a/src/interfaces/ecpg/include/pgtypes_date.h b/src/interfaces/ecpg/include/pgtypes_date.h
index 7ab8046b7b1..b8990bb0723 100644
--- a/src/interfaces/ecpg/include/pgtypes_date.h
+++ b/src/interfaces/ecpg/include/pgtypes_date.h
@@ -21,8 +21,8 @@ extern void PGTYPESdate_julmdy(date, int *);
extern void PGTYPESdate_mdyjul(int *, date *);
extern int PGTYPESdate_dayofweek(date);
extern void PGTYPESdate_today(date *);
-extern int PGTYPESdate_defmt_asc(date *, char *, char *);
-extern int PGTYPESdate_fmt_asc(date, char *, char *);
+extern int PGTYPESdate_defmt_asc(date *, const char *, char *);
+extern int PGTYPESdate_fmt_asc(date, const char *, char *);
#ifdef __cplusplus
}
diff --git a/src/interfaces/ecpg/include/pgtypes_timestamp.h b/src/interfaces/ecpg/include/pgtypes_timestamp.h
index 07e95294b3e..537585ce215 100644
--- a/src/interfaces/ecpg/include/pgtypes_timestamp.h
+++ b/src/interfaces/ecpg/include/pgtypes_timestamp.h
@@ -22,9 +22,9 @@ extern "C"
extern timestamp PGTYPEStimestamp_from_asc(char *, char **);
extern char *PGTYPEStimestamp_to_asc(timestamp);
extern int PGTYPEStimestamp_sub(timestamp *, timestamp *, interval *);
-extern int PGTYPEStimestamp_fmt_asc(timestamp *, char *, int, char *);
+extern int PGTYPEStimestamp_fmt_asc(timestamp *, char *, int, const char *);
extern void PGTYPEStimestamp_current(timestamp *);
-extern int PGTYPEStimestamp_defmt_asc(char *, char *, timestamp *);
+extern int PGTYPEStimestamp_defmt_asc(char *, const char *, timestamp *);
extern int PGTYPEStimestamp_add_interval(timestamp * tin, interval * span, timestamp * tout);
extern int PGTYPEStimestamp_sub_interval(timestamp * tin, interval * span, timestamp * tout);
diff --git a/src/interfaces/ecpg/pgtypeslib/common.c b/src/interfaces/ecpg/pgtypeslib/common.c
index d800321a9d3..9084fd06b4e 100644
--- a/src/interfaces/ecpg/pgtypeslib/common.c
+++ b/src/interfaces/ecpg/pgtypeslib/common.c
@@ -16,7 +16,7 @@ pgtypes_alloc(long size)
}
char *
-pgtypes_strdup(char *str)
+pgtypes_strdup(const char *str)
{
char *new = (char *) strdup(str);
diff --git a/src/interfaces/ecpg/pgtypeslib/datetime.c b/src/interfaces/ecpg/pgtypeslib/datetime.c
index 41377a68611..823626fcf56 100644
--- a/src/interfaces/ecpg/pgtypeslib/datetime.c
+++ b/src/interfaces/ecpg/pgtypeslib/datetime.c
@@ -173,7 +173,7 @@ PGTYPESdate_today(date * d)
#define PGTYPES_FMTDATE_YEAR_DIGITS_LONG 6
int
-PGTYPESdate_fmt_asc(date dDate, char *fmtstring, char *outbuf)
+PGTYPESdate_fmt_asc(date dDate, const char *fmtstring, char *outbuf)
{
static struct
{
@@ -335,7 +335,7 @@ PGTYPESdate_fmt_asc(date dDate, char *fmtstring, char *outbuf)
#define PGTYPES_DATE_MONTH_MAXLENGTH 20 /* probably even less :-) */
int
-PGTYPESdate_defmt_asc(date * d, char *fmt, char *str)
+PGTYPESdate_defmt_asc(date * d, const char *fmt, char *str)
{
/*
* token[2] = { 4,6 } means that token 2 starts at position 4 and ends at
diff --git a/src/interfaces/ecpg/pgtypeslib/extern.h b/src/interfaces/ecpg/pgtypeslib/extern.h
index c7c64b15782..88b2fb07759 100644
--- a/src/interfaces/ecpg/pgtypeslib/extern.h
+++ b/src/interfaces/ecpg/pgtypeslib/extern.h
@@ -37,7 +37,7 @@ union un_fmt_comb
int pgtypes_fmt_replace(union un_fmt_comb, int, char **, int *);
char *pgtypes_alloc(long);
-char *pgtypes_strdup(char *);
+char *pgtypes_strdup(const char *);
#ifndef bool
#define bool char
diff --git a/src/interfaces/ecpg/pgtypeslib/timestamp.c b/src/interfaces/ecpg/pgtypeslib/timestamp.c
index 8d787bbbe61..dc5ff72b601 100644
--- a/src/interfaces/ecpg/pgtypeslib/timestamp.c
+++ b/src/interfaces/ecpg/pgtypeslib/timestamp.c
@@ -18,7 +18,7 @@
#include "pgtypes_date.h"
-int PGTYPEStimestamp_defmt_scan(char **, char *, timestamp *, int *, int *, int *,
+int PGTYPEStimestamp_defmt_scan(char **, const char *, timestamp *, int *, int *, int *,
int *, int *, int *, int *);
#ifdef HAVE_INT64_TIMESTAMP
@@ -384,12 +384,12 @@ PGTYPEStimestamp_current(timestamp * ts)
static int
dttofmtasc_replace(timestamp * ts, date dDate, int dow, struct tm * tm,
- char *output, int *pstr_len, char *fmtstr)
+ char *output, int *pstr_len, const char *fmtstr)
{
union un_fmt_comb replace_val;
int replace_type;
int i;
- char *p = fmtstr;
+ const char *p = fmtstr;
char *q = output;
while (*p)
@@ -866,7 +866,7 @@ dttofmtasc_replace(timestamp * ts, date dDate, int dow, struct tm * tm,
int
-PGTYPEStimestamp_fmt_asc(timestamp * ts, char *output, int str_len, char *fmtstr)
+PGTYPEStimestamp_fmt_asc(timestamp * ts, char *output, int str_len, const char *fmtstr)
{
struct tm tm;
fsec_t fsec;
@@ -894,7 +894,7 @@ PGTYPEStimestamp_sub(timestamp * ts1, timestamp * ts2, interval * iv)
}
int
-PGTYPEStimestamp_defmt_asc(char *str, char *fmt, timestamp * d)
+PGTYPEStimestamp_defmt_asc(char *str, const char *fmt, timestamp * d)
{
int year,
month,