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

Commit3a8f24a

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 parent22b1207 commit3a8f24a

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
@@ -57,13 +57,13 @@ static ptrdiff_t const PTRDIFF_MAX = MAXVAL(ptrdiff_t, TYPE_BIT(ptrdiff_t));
5757
#endif
5858

5959
/* The type and printf format for line numbers. */
60-
typedefintlineno;
60+
typedefintlineno_t;
6161
#definePRIdLINENO "d"
6262

6363
structrule
6464
{
6565
constchar*r_filename;
66-
linenor_linenum;
66+
lineno_tr_linenum;
6767
constchar*r_name;
6868

6969
zic_tr_loyear;/* for example, 1986 */
@@ -100,7 +100,7 @@ struct rule
100100
structzone
101101
{
102102
constchar*z_filename;
103-
linenoz_linenum;
103+
lineno_tz_linenum;
104104

105105
constchar*z_name;
106106
zic_tz_gmtoff;
@@ -181,7 +181,7 @@ static intleapcnt;
181181
staticboolleapseen;
182182
staticzic_tleapminyear;
183183
staticzic_tleapmaxyear;
184-
staticlinenolinenum;
184+
staticlineno_tlinenum;
185185
staticintmax_abbrvar_len=PERCENT_Z_LEN_BOUND;
186186
staticintmax_format_len;
187187
staticzic_tmax_year;
@@ -190,7 +190,7 @@ static bool noise;
190190
staticboolprint_abbrevs;
191191
staticzic_tprint_cutoff;
192192
staticconstchar*rfilename;
193-
staticlinenorlinenum;
193+
staticlineno_trlinenum;
194194
staticconstchar*progname;
195195
staticptrdiff_ttimecnt;
196196
staticptrdiff_ttimecnt_alloc;
@@ -288,7 +288,7 @@ static ptrdiff_t nzones_alloc;
288288
structlink
289289
{
290290
constchar*l_filename;
291-
linenol_linenum;
291+
lineno_tl_linenum;
292292
constchar*l_from;
293293
constchar*l_to;
294294
};
@@ -442,14 +442,13 @@ ecpyalloc(char const * str)
442442
}
443443

444444
staticvoid*
445-
growalloc(void*ptr,size_titemsize,ptrdiff_tnitems,ptrdiff_t*nitems_alloc)
445+
growalloc(void*ptr,size_titemsize,ptrdiff_tnitems,ptrdiff_t*nitems_alloc)
446446
{
447447
if (nitems<*nitems_alloc)
448448
returnptr;
449449
else
450450
{
451-
ptrdiff_tnitems_max=PTRDIFF_MAX-WORK_AROUND_QTBUG_53071;
452-
ptrdiff_tamax=nitems_max<SIZE_MAX ?nitems_max :SIZE_MAX;
451+
ptrdiff_tamax=PTRDIFF_MAX-WORK_AROUND_QTBUG_53071;
453452

454453
if ((amax-1) /3*2<*nitems_alloc)
455454
memory_exhausted(_("integer overflow"));
@@ -463,7 +462,7 @@ growalloc(void *ptr, size_t itemsize, ptrdiff_t nitems, ptrdiff_t * nitems_alloc
463462
*/
464463

465464
staticvoid
466-
eats(charconst*name,linenonum,charconst*rname,linenornum)
465+
eats(charconst*name,lineno_tnum,charconst*rname,lineno_trnum)
467466
{
468467
filename=name;
469468
linenum=num;
@@ -472,7 +471,7 @@ eats(char const * name, lineno num, char const * rname, lineno rnum)
472471
}
473472

474473
staticvoid
475-
eat(charconst*name,linenonum)
474+
eat(charconst*name,lineno_tnum)
476475
{
477476
eats(name,num,NULL,-1);
478477
}
@@ -1169,7 +1168,7 @@ infile(const char *name)
11691168
conststructlookup*lp;
11701169
intnfields;
11711170
boolwantcont;
1172-
linenonum;
1171+
lineno_tnum;
11731172
charbuf[BUFSIZ];
11741173

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp