Skip to content

Commit 26441f9

Browse files
Add static variables to ignored.tsv.
1 parent 695f58f commit 26441f9

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

Modules/_datetimemodule.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,36 +1761,36 @@ format_utcoffset(char *buf, size_t buflen, const char *sep,
17611761
inline static int
17621762
normalize_century(void)
17631763
{
1764-
static int _normalize_century = -1;
1765-
if (_normalize_century < 0) {
1764+
static int cache = -1;
1765+
if (cache < 0) {
17661766
char year[5];
17671767
struct tm date = {
17681768
.tm_year = -1801,
17691769
.tm_mon = 0,
17701770
.tm_mday = 1
17711771
};
1772-
_normalize_century = (strftime(year, sizeof(year), "%Y", &date) &&
1773-
strcmp(year, "0099") != 0);
1772+
cache = (strftime(year, sizeof(year), "%Y", &date) &&
1773+
strcmp(year, "0099") != 0);
17741774
}
1775-
return _normalize_century;
1775+
return cache;
17761776
}
17771777

17781778
/* Check whether C99-specific strftime specifiers are supported. */
17791779
inline static int
17801780
strftime_c99_support(void)
17811781
{
1782-
static int _strftime_c99_support = -1;
1783-
if (_strftime_c99_support < 0) {
1782+
static int cache = -1;
1783+
if (cache < 0) {
17841784
char full_date[11];
17851785
struct tm date = {
17861786
.tm_year = 0,
17871787
.tm_mon = 0,
17881788
.tm_mday = 1
17891789
};
1790-
_strftime_c99_support = (strftime(full_date, sizeof(full_date), "%F", &date) &&
1791-
strcmp(full_date, "1900-01-01") == 0);
1790+
cache = (strftime(full_date, sizeof(full_date), "%F", &date) &&
1791+
strcmp(full_date, "1900-01-01") == 0);
17921792
}
1793-
return _strftime_c99_support;
1793+
return cache;
17941794
}
17951795

17961796
static PyObject *

Tools/c-analyzer/cpython/ignored.tsv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ Modules/_datetimemodule.c datetime_isoformat specs -
224224
Modules/_datetimemodule.c parse_hh_mm_ss_ff correction -
225225
Modules/_datetimemodule.c time_isoformat specs -
226226
Modules/_datetimemodule.c - capi_types -
227+
Modules/_datetimemodule.c normalize_century cache -
228+
Modules/_datetimemodule.c strftime_c99_support cache -
227229
Modules/_decimal/_decimal.c - cond_map_template -
228230
Modules/_decimal/_decimal.c - dec_signal_string -
229231
Modules/_decimal/_decimal.c - dflt_ctx -

0 commit comments

Comments
 (0)