Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
59e242a4
Commit
59e242a4
authored
Dec 18, 2011
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mark variables as const in pgtypeslib if they only carry a format string.
parent
22232834
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
13 deletions
+13
-13
src/interfaces/ecpg/include/pgtypes_date.h
src/interfaces/ecpg/include/pgtypes_date.h
+2
-2
src/interfaces/ecpg/include/pgtypes_timestamp.h
src/interfaces/ecpg/include/pgtypes_timestamp.h
+2
-2
src/interfaces/ecpg/pgtypeslib/common.c
src/interfaces/ecpg/pgtypeslib/common.c
+1
-1
src/interfaces/ecpg/pgtypeslib/datetime.c
src/interfaces/ecpg/pgtypeslib/datetime.c
+2
-2
src/interfaces/ecpg/pgtypeslib/extern.h
src/interfaces/ecpg/pgtypeslib/extern.h
+1
-1
src/interfaces/ecpg/pgtypeslib/timestamp.c
src/interfaces/ecpg/pgtypeslib/timestamp.c
+5
-5
No files found.
src/interfaces/ecpg/include/pgtypes_date.h
View file @
59e242a4
...
@@ -21,8 +21,8 @@ extern void PGTYPESdate_julmdy(date, int *);
...
@@ -21,8 +21,8 @@ extern void PGTYPESdate_julmdy(date, int *);
extern
void
PGTYPESdate_mdyjul
(
int
*
,
date
*
);
extern
void
PGTYPESdate_mdyjul
(
int
*
,
date
*
);
extern
int
PGTYPESdate_dayofweek
(
date
);
extern
int
PGTYPESdate_dayofweek
(
date
);
extern
void
PGTYPESdate_today
(
date
*
);
extern
void
PGTYPESdate_today
(
date
*
);
extern
int
PGTYPESdate_defmt_asc
(
date
*
,
char
*
,
char
*
);
extern
int
PGTYPESdate_defmt_asc
(
date
*
,
c
onst
c
har
*
,
char
*
);
extern
int
PGTYPESdate_fmt_asc
(
date
,
char
*
,
char
*
);
extern
int
PGTYPESdate_fmt_asc
(
date
,
c
onst
c
har
*
,
char
*
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
src/interfaces/ecpg/include/pgtypes_timestamp.h
View file @
59e242a4
...
@@ -22,9 +22,9 @@ extern "C"
...
@@ -22,9 +22,9 @@ extern "C"
extern
timestamp
PGTYPEStimestamp_from_asc
(
char
*
,
char
**
);
extern
timestamp
PGTYPEStimestamp_from_asc
(
char
*
,
char
**
);
extern
char
*
PGTYPEStimestamp_to_asc
(
timestamp
);
extern
char
*
PGTYPEStimestamp_to_asc
(
timestamp
);
extern
int
PGTYPEStimestamp_sub
(
timestamp
*
,
timestamp
*
,
interval
*
);
extern
int
PGTYPEStimestamp_sub
(
timestamp
*
,
timestamp
*
,
interval
*
);
extern
int
PGTYPEStimestamp_fmt_asc
(
timestamp
*
,
char
*
,
int
,
char
*
);
extern
int
PGTYPEStimestamp_fmt_asc
(
timestamp
*
,
char
*
,
int
,
c
onst
c
har
*
);
extern
void
PGTYPEStimestamp_current
(
timestamp
*
);
extern
void
PGTYPEStimestamp_current
(
timestamp
*
);
extern
int
PGTYPEStimestamp_defmt_asc
(
char
*
,
char
*
,
timestamp
*
);
extern
int
PGTYPEStimestamp_defmt_asc
(
char
*
,
c
onst
c
har
*
,
timestamp
*
);
extern
int
PGTYPEStimestamp_add_interval
(
timestamp
*
tin
,
interval
*
span
,
timestamp
*
tout
);
extern
int
PGTYPEStimestamp_add_interval
(
timestamp
*
tin
,
interval
*
span
,
timestamp
*
tout
);
extern
int
PGTYPEStimestamp_sub_interval
(
timestamp
*
tin
,
interval
*
span
,
timestamp
*
tout
);
extern
int
PGTYPEStimestamp_sub_interval
(
timestamp
*
tin
,
interval
*
span
,
timestamp
*
tout
);
...
...
src/interfaces/ecpg/pgtypeslib/common.c
View file @
59e242a4
...
@@ -16,7 +16,7 @@ pgtypes_alloc(long size)
...
@@ -16,7 +16,7 @@ pgtypes_alloc(long size)
}
}
char
*
char
*
pgtypes_strdup
(
char
*
str
)
pgtypes_strdup
(
c
onst
c
har
*
str
)
{
{
char
*
new
=
(
char
*
)
strdup
(
str
);
char
*
new
=
(
char
*
)
strdup
(
str
);
...
...
src/interfaces/ecpg/pgtypeslib/datetime.c
View file @
59e242a4
...
@@ -173,7 +173,7 @@ PGTYPESdate_today(date * d)
...
@@ -173,7 +173,7 @@ PGTYPESdate_today(date * d)
#define PGTYPES_FMTDATE_YEAR_DIGITS_LONG 6
#define PGTYPES_FMTDATE_YEAR_DIGITS_LONG 6
int
int
PGTYPESdate_fmt_asc
(
date
dDate
,
char
*
fmtstring
,
char
*
outbuf
)
PGTYPESdate_fmt_asc
(
date
dDate
,
c
onst
c
har
*
fmtstring
,
char
*
outbuf
)
{
{
static
struct
static
struct
{
{
...
@@ -335,7 +335,7 @@ PGTYPESdate_fmt_asc(date dDate, char *fmtstring, char *outbuf)
...
@@ -335,7 +335,7 @@ PGTYPESdate_fmt_asc(date dDate, char *fmtstring, char *outbuf)
#define PGTYPES_DATE_MONTH_MAXLENGTH 20
/* probably even less :-) */
#define PGTYPES_DATE_MONTH_MAXLENGTH 20
/* probably even less :-) */
int
int
PGTYPESdate_defmt_asc
(
date
*
d
,
char
*
fmt
,
char
*
str
)
PGTYPESdate_defmt_asc
(
date
*
d
,
c
onst
c
har
*
fmt
,
char
*
str
)
{
{
/*
/*
* token[2] = { 4,6 } means that token 2 starts at position 4 and ends at
* token[2] = { 4,6 } means that token 2 starts at position 4 and ends at
...
...
src/interfaces/ecpg/pgtypeslib/extern.h
View file @
59e242a4
...
@@ -37,7 +37,7 @@ union un_fmt_comb
...
@@ -37,7 +37,7 @@ union un_fmt_comb
int
pgtypes_fmt_replace
(
union
un_fmt_comb
,
int
,
char
**
,
int
*
);
int
pgtypes_fmt_replace
(
union
un_fmt_comb
,
int
,
char
**
,
int
*
);
char
*
pgtypes_alloc
(
long
);
char
*
pgtypes_alloc
(
long
);
char
*
pgtypes_strdup
(
char
*
);
char
*
pgtypes_strdup
(
c
onst
c
har
*
);
#ifndef bool
#ifndef bool
#define bool char
#define bool char
...
...
src/interfaces/ecpg/pgtypeslib/timestamp.c
View file @
59e242a4
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
#include "pgtypes_date.h"
#include "pgtypes_date.h"
int
PGTYPEStimestamp_defmt_scan
(
char
**
,
char
*
,
timestamp
*
,
int
*
,
int
*
,
int
*
,
int
PGTYPEStimestamp_defmt_scan
(
char
**
,
c
onst
c
har
*
,
timestamp
*
,
int
*
,
int
*
,
int
*
,
int
*
,
int
*
,
int
*
,
int
*
);
int
*
,
int
*
,
int
*
,
int
*
);
#ifdef HAVE_INT64_TIMESTAMP
#ifdef HAVE_INT64_TIMESTAMP
...
@@ -384,12 +384,12 @@ PGTYPEStimestamp_current(timestamp * ts)
...
@@ -384,12 +384,12 @@ PGTYPEStimestamp_current(timestamp * ts)
static
int
static
int
dttofmtasc_replace
(
timestamp
*
ts
,
date
dDate
,
int
dow
,
struct
tm
*
tm
,
dttofmtasc_replace
(
timestamp
*
ts
,
date
dDate
,
int
dow
,
struct
tm
*
tm
,
char
*
output
,
int
*
pstr_len
,
char
*
fmtstr
)
char
*
output
,
int
*
pstr_len
,
c
onst
c
har
*
fmtstr
)
{
{
union
un_fmt_comb
replace_val
;
union
un_fmt_comb
replace_val
;
int
replace_type
;
int
replace_type
;
int
i
;
int
i
;
c
har
*
p
=
fmtstr
;
c
onst
char
*
p
=
fmtstr
;
char
*
q
=
output
;
char
*
q
=
output
;
while
(
*
p
)
while
(
*
p
)
...
@@ -866,7 +866,7 @@ dttofmtasc_replace(timestamp * ts, date dDate, int dow, struct tm * tm,
...
@@ -866,7 +866,7 @@ dttofmtasc_replace(timestamp * ts, date dDate, int dow, struct tm * tm,
int
int
PGTYPEStimestamp_fmt_asc
(
timestamp
*
ts
,
char
*
output
,
int
str_len
,
char
*
fmtstr
)
PGTYPEStimestamp_fmt_asc
(
timestamp
*
ts
,
char
*
output
,
int
str_len
,
c
onst
c
har
*
fmtstr
)
{
{
struct
tm
tm
;
struct
tm
tm
;
fsec_t
fsec
;
fsec_t
fsec
;
...
@@ -894,7 +894,7 @@ PGTYPEStimestamp_sub(timestamp * ts1, timestamp * ts2, interval * iv)
...
@@ -894,7 +894,7 @@ PGTYPEStimestamp_sub(timestamp * ts1, timestamp * ts2, interval * iv)
}
}
int
int
PGTYPEStimestamp_defmt_asc
(
char
*
str
,
char
*
fmt
,
timestamp
*
d
)
PGTYPEStimestamp_defmt_asc
(
char
*
str
,
c
onst
c
har
*
fmt
,
timestamp
*
d
)
{
{
int
year
,
int
year
,
month
,
month
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment