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

Commit20559a8

Browse files
committed
More zic cleanup.
The workaround the IANA guys chose to get rid of the clang warningwe'd silenced in commit23ed2ba turns out not to satisfy Coverity.Go back to the previous solution, ie, remove the useless comparisonto SIZE_MAX. (In principle, there could be machines out there whereit's not useless because ptrdiff_t is wider than size_t. But the wholething is pretty academic anyway, as we could never approach this limitfor any sane estimate of the amount of data that zic will ever be askedto work with.)Also, s/lineno/lineno_t/g, because if we accept their decision to startusing "lineno" as a typedef, it is going to have very unpleasantconsequences in our next pgindent run. Noted that while fooling withpltcl yesterday.
1 parent5c24c61 commit20559a8

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

‎src/timezone/zic.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ static ptrdiff_t const PTRDIFF_MAX = MAXVAL(ptrdiff_t, TYPE_BIT(ptrdiff_t));
4848
#endif
4949

5050
/* The type and printf format for line numbers. */
51-
typedefintlineno;
51+
typedefintlineno_t;
5252
#definePRIdLINENO "d"
5353

5454
structrule
5555
{
5656
constchar*r_filename;
57-
linenor_linenum;
57+
lineno_tr_linenum;
5858
constchar*r_name;
5959

6060
zic_tr_loyear;/* for example, 1986 */
@@ -91,7 +91,7 @@ struct rule
9191
structzone
9292
{
9393
constchar*z_filename;
94-
linenoz_linenum;
94+
lineno_tz_linenum;
9595

9696
constchar*z_name;
9797
zic_tz_gmtoff;
@@ -169,7 +169,7 @@ static intleapcnt;
169169
staticboolleapseen;
170170
staticzic_tleapminyear;
171171
staticzic_tleapmaxyear;
172-
staticlinenolinenum;
172+
staticlineno_tlinenum;
173173
staticintmax_abbrvar_len=PERCENT_Z_LEN_BOUND;
174174
staticintmax_format_len;
175175
staticzic_tmax_year;
@@ -178,7 +178,7 @@ static bool noise;
178178
staticboolprint_abbrevs;
179179
staticzic_tprint_cutoff;
180180
staticconstchar*rfilename;
181-
staticlinenorlinenum;
181+
staticlineno_trlinenum;
182182
staticconstchar*progname;
183183
staticptrdiff_ttimecnt;
184184
staticptrdiff_ttimecnt_alloc;
@@ -276,7 +276,7 @@ static ptrdiff_t nzones_alloc;
276276
structlink
277277
{
278278
constchar*l_filename;
279-
linenol_linenum;
279+
lineno_tl_linenum;
280280
constchar*l_from;
281281
constchar*l_to;
282282
};
@@ -430,14 +430,13 @@ ecpyalloc(char const * str)
430430
}
431431

432432
staticvoid*
433-
growalloc(void*ptr,size_titemsize,ptrdiff_tnitems,ptrdiff_t*nitems_alloc)
433+
growalloc(void*ptr,size_titemsize,ptrdiff_tnitems,ptrdiff_t*nitems_alloc)
434434
{
435435
if (nitems<*nitems_alloc)
436436
returnptr;
437437
else
438438
{
439-
ptrdiff_tnitems_max=PTRDIFF_MAX-WORK_AROUND_QTBUG_53071;
440-
ptrdiff_tamax=nitems_max<SIZE_MAX ?nitems_max :SIZE_MAX;
439+
ptrdiff_tamax=PTRDIFF_MAX-WORK_AROUND_QTBUG_53071;
441440

442441
if ((amax-1) /3*2<*nitems_alloc)
443442
memory_exhausted(_("integer overflow"));
@@ -451,7 +450,7 @@ growalloc(void *ptr, size_t itemsize, ptrdiff_t nitems, ptrdiff_t * nitems_alloc
451450
*/
452451

453452
staticvoid
454-
eats(charconst*name,linenonum,charconst*rname,linenornum)
453+
eats(charconst*name,lineno_tnum,charconst*rname,lineno_trnum)
455454
{
456455
filename=name;
457456
linenum=num;
@@ -460,7 +459,7 @@ eats(char const * name, lineno num, char const * rname, lineno rnum)
460459
}
461460

462461
staticvoid
463-
eat(charconst*name,linenonum)
462+
eat(charconst*name,lineno_tnum)
464463
{
465464
eats(name,num,NULL,-1);
466465
}
@@ -1157,7 +1156,7 @@ infile(const char *name)
11571156
conststructlookup*lp;
11581157
intnfields;
11591158
boolwantcont;
1160-
linenonum;
1159+
lineno_tnum;
11611160
charbuf[BUFSIZ];
11621161

11631162
if (strcmp(name,"-")==0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp