Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit59e242a

Browse files
author
Michael Meskes
committed
Mark variables as const in pgtypeslib if they only carry a format string.
1 parent2223283 commit59e242a

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

‎src/interfaces/ecpg/include/pgtypes_date.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ extern void PGTYPESdate_julmdy(date, int *);
2121
externvoidPGTYPESdate_mdyjul(int*,date*);
2222
externintPGTYPESdate_dayofweek(date);
2323
externvoidPGTYPESdate_today(date*);
24-
externintPGTYPESdate_defmt_asc(date*,char*,char*);
25-
externintPGTYPESdate_fmt_asc(date,char*,char*);
24+
externintPGTYPESdate_defmt_asc(date*,constchar*,char*);
25+
externintPGTYPESdate_fmt_asc(date,constchar*,char*);
2626

2727
#ifdef__cplusplus
2828
}

‎src/interfaces/ecpg/include/pgtypes_timestamp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ extern"C"
2222
externtimestampPGTYPEStimestamp_from_asc(char*,char**);
2323
externchar*PGTYPEStimestamp_to_asc(timestamp);
2424
externintPGTYPEStimestamp_sub(timestamp*,timestamp*,interval*);
25-
externintPGTYPEStimestamp_fmt_asc(timestamp*,char*,int,char*);
25+
externintPGTYPEStimestamp_fmt_asc(timestamp*,char*,int,constchar*);
2626
externvoidPGTYPEStimestamp_current(timestamp*);
27-
externintPGTYPEStimestamp_defmt_asc(char*,char*,timestamp*);
27+
externintPGTYPEStimestamp_defmt_asc(char*,constchar*,timestamp*);
2828
externintPGTYPEStimestamp_add_interval(timestamp*tin,interval*span,timestamp*tout);
2929
externintPGTYPEStimestamp_sub_interval(timestamp*tin,interval*span,timestamp*tout);
3030

‎src/interfaces/ecpg/pgtypeslib/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pgtypes_alloc(long size)
1616
}
1717

1818
char*
19-
pgtypes_strdup(char*str)
19+
pgtypes_strdup(constchar*str)
2020
{
2121
char*new= (char*)strdup(str);
2222

‎src/interfaces/ecpg/pgtypeslib/datetime.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ PGTYPESdate_today(date * d)
173173
#definePGTYPES_FMTDATE_YEAR_DIGITS_LONG6
174174

175175
int
176-
PGTYPESdate_fmt_asc(datedDate,char*fmtstring,char*outbuf)
176+
PGTYPESdate_fmt_asc(datedDate,constchar*fmtstring,char*outbuf)
177177
{
178178
staticstruct
179179
{
@@ -335,7 +335,7 @@ PGTYPESdate_fmt_asc(date dDate, char *fmtstring, char *outbuf)
335335

336336
#definePGTYPES_DATE_MONTH_MAXLENGTH20/* probably even less :-) */
337337
int
338-
PGTYPESdate_defmt_asc(date*d,char*fmt,char*str)
338+
PGTYPESdate_defmt_asc(date*d,constchar*fmt,char*str)
339339
{
340340
/*
341341
* token[2] = { 4,6 } means that token 2 starts at position 4 and ends at

‎src/interfaces/ecpg/pgtypeslib/extern.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ union un_fmt_comb
3737
intpgtypes_fmt_replace(unionun_fmt_comb,int,char**,int*);
3838

3939
char*pgtypes_alloc(long);
40-
char*pgtypes_strdup(char*);
40+
char*pgtypes_strdup(constchar*);
4141

4242
#ifndefbool
4343
#definebool char

‎src/interfaces/ecpg/pgtypeslib/timestamp.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include"pgtypes_date.h"
1919

2020

21-
intPGTYPEStimestamp_defmt_scan(char**,char*,timestamp*,int*,int*,int*,
21+
intPGTYPEStimestamp_defmt_scan(char**,constchar*,timestamp*,int*,int*,int*,
2222
int*,int*,int*,int*);
2323

2424
#ifdefHAVE_INT64_TIMESTAMP
@@ -384,12 +384,12 @@ PGTYPEStimestamp_current(timestamp * ts)
384384

385385
staticint
386386
dttofmtasc_replace(timestamp*ts,datedDate,intdow,structtm*tm,
387-
char*output,int*pstr_len,char*fmtstr)
387+
char*output,int*pstr_len,constchar*fmtstr)
388388
{
389389
unionun_fmt_combreplace_val;
390390
intreplace_type;
391391
inti;
392-
char*p=fmtstr;
392+
constchar*p=fmtstr;
393393
char*q=output;
394394

395395
while (*p)
@@ -866,7 +866,7 @@ dttofmtasc_replace(timestamp * ts, date dDate, int dow, struct tm * tm,
866866

867867

868868
int
869-
PGTYPEStimestamp_fmt_asc(timestamp*ts,char*output,intstr_len,char*fmtstr)
869+
PGTYPEStimestamp_fmt_asc(timestamp*ts,char*output,intstr_len,constchar*fmtstr)
870870
{
871871
structtmtm;
872872
fsec_tfsec;
@@ -894,7 +894,7 @@ PGTYPEStimestamp_sub(timestamp * ts1, timestamp * ts2, interval * iv)
894894
}
895895

896896
int
897-
PGTYPEStimestamp_defmt_asc(char*str,char*fmt,timestamp*d)
897+
PGTYPEStimestamp_defmt_asc(char*str,constchar*fmt,timestamp*d)
898898
{
899899
intyear,
900900
month,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp