8000 Remove unnecessary includes of <ctime> by ulmus-scott · Pull Request #1142 · MythTV/mythtv · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove unnecessary 8000 includes of <ctime> #1142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

ulmus-scott
Copy link
Contributor
@ulmus-scott ulmus-scott commented Jul 8, 2025

Most uses had already been replaced.

For libmythtv/mpeg, I would prefer to use C++20 for gps_clock and utc_clock to replace time_t.

Checklist

The only user in MythTV code of gmtime_r() and localtime_r() is
mythtv/libs/libmythtv/recorders/dvbdev/dvbci.cpp, which uses a
Linux kernel driver, so will not compile on Windows, and does
not include compat.h anyways.
Since std::chrono::seconds::rep is an integer type of at least 35 bits,
it is almost certainly a long long.
These files use time_t.

C++20 with <format> could replace these uses with
std::chrono:system_clock, which is specified as Unix time
starting in C++20.
mythzmserver/zmserver.h: has unused time_t members in unions, but does not
directly include <ctime> (via <chrono> probably).

mytharchivehelper/external/pxsup2dast.c: uses time_t and time() from <time.h>.

libmythtv/recorders/dvbdev/dvbci.cpp: uses time_t, time(), struct tm, gmtime_r(),
and localtime_r() via <ctime>.

A few files in libmythtv/mpeg use time_t from <ctime>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0