diff options
author | Victor Stinner <vstinner@python.org> | 2024-02-20 22:16:37 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-20 22:16:37 (GMT) |
commit | 52d14775665a6fde518ee3da88a73f39b09d993f (patch) | |
tree | 7aa83b307d5af59761a769d4a54746b7a7c81fc2 /Modules/timemodule.c | |
parent | e1fdc3c323bd605f92622b7ee18805885ff0bb4e (diff) | |
download | cpython-52d14775665a6fde518ee3da88a73f39b09d993f.zip cpython-52d14775665a6fde518ee3da88a73f39b09d993f.tar.gz cpython-52d14775665a6fde518ee3da88a73f39b09d993f.tar.bz2 |
gh-110850: Rename internal PyTime C API functions (#115734)
Rename functions:
* _PyTime_GetSystemClock() => _PyTime_TimeUnchecked()
* _PyTime_GetPerfCounter() => _PyTime_PerfCounterUnchecked()
* _PyTime_GetMonotonicClock() => _PyTime_MonotonicUnchecked()
* _PyTime_GetSystemClockWithInfo() => _PyTime_TimeWithInfo()
* _PyTime_GetMonotonicClockWithInfo() => _PyTime_MonotonicWithInfo()
* _PyTime_GetMonotonicClockWithInfo() => _PyTime_MonotonicWithInfo()
Changes:
* Remove "typedef PyTime_t PyTime_t;" which was
"typedef PyTime_t _PyTime_t;" before a previous rename.
* Update comments of "Unchecked" functions.
* Remove invalid PyTime_Time() comment.
Diffstat (limited to 'Modules/timemodule.c')
-rw-r--r-- | Modules/timemodule.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 73b9fc0..28dba90 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -106,8 +106,8 @@ _PyFloat_FromPyTime(PyTime_t t) static int get_system_time(PyTime_t *t) { - // Avoid _PyTime_GetSystemClock() which silently ignores errors. - return _PyTime_GetSystemClockWithInfo(t, NULL); + // Avoid _PyTime_TimeUnchecked() which silently ignores errors. + return _PyTime_TimeWithInfo(t, NULL); } @@ -1159,8 +1159,8 @@ should not be relied on."); static int get_monotonic(PyTime_t *t) { - // Avoid _PyTime_GetMonotonicClock() which silently ignores errors. - return _PyTime_GetMonotonicClockWithInfo(t, NULL); + // Avoid _PyTime_MonotonicUnchecked() which silently ignores errors. + return _PyTime_MonotonicWithInfo(t, NULL); } @@ -1198,8 +1198,8 @@ Monotonic clock, cannot go backward, as nanoseconds."); static int get_perf_counter(PyTime_t *t) { - // Avoid _PyTime_GetPerfCounter() which silently ignores errors. - return _PyTime_GetPerfCounterWithInfo(t, NULL); + // Avoid _PyTime_PerfCounterUnchecked() which silently ignores errors. + return _PyTime_PerfCounterWithInfo(t, NULL); } @@ -1615,17 +1615,17 @@ time_get_clock_info(PyObject *module, PyObject *args) #endif if (strcmp(name, "time") == 0) { - if (_PyTime_GetSystemClockWithInfo(&t, &info) < 0) { + if (_PyTime_TimeWithInfo(&t, &info) < 0) { return NULL; } } else if (strcmp(name, "monotonic") == 0) { - if (_PyTime_GetMonotonicClockWithInfo(&t, &info) < 0) { + if (_PyTime_MonotonicWithInfo(&t, &info) < 0) { return NULL; } } else if (strcmp(name, "perf_counter") == 0) { - if (_PyTime_GetPerfCounterWithInfo(&t, &info) < 0) { + if (_PyTime_PerfCounterWithInfo(&t, &info) < 0) { return NULL; } } |