mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-03 10:51:12 +02:00
controlapi.cpp: ensure type compatibility for time_t in multiple methods
- Updated channelEPGformated to use time_t instead of long for _stoptime. - Corrected sscanf format specifier in EpgCGI to handle time_t correctly. - Changed handling of _stoptime in xmltvepgCGI to use time_t. - Ensured gmtime and localtime functions receive time_t arguments. These changes ensure compatibility with _TIME_BITS=64 and maintain proper type usage for time functions, addressing different definitions and maintaining robustness across kernel and library versions.
This commit is contained in:
@@ -1779,7 +1779,7 @@ std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_
|
|||||||
strftime(zbuffer, 20, "%d.%m.%Y", mtime);
|
strftime(zbuffer, 20, "%d.%m.%Y", mtime);
|
||||||
prog += hh->outPair("date", std::string(zbuffer), true);
|
prog += hh->outPair("date", std::string(zbuffer), true);
|
||||||
prog += hh->outPair("stop_sec", string_printf("%ld", eventIterator->startTime + eventIterator->duration), true);
|
prog += hh->outPair("stop_sec", string_printf("%ld", eventIterator->startTime + eventIterator->duration), true);
|
||||||
long _stoptime = eventIterator->startTime + eventIterator->duration;
|
time_t _stoptime = eventIterator->startTime + eventIterator->duration;
|
||||||
mtime = localtime(&_stoptime);
|
mtime = localtime(&_stoptime);
|
||||||
strftime(zbuffer, 20, "%H:%M", mtime);
|
strftime(zbuffer, 20, "%H:%M", mtime);
|
||||||
prog += hh->outPair("stop_t", std::string(zbuffer), true);
|
prog += hh->outPair("stop_t", std::string(zbuffer), true);
|
||||||
@@ -2163,7 +2163,7 @@ void CControlAPI::EpgCGI(CyhookHandler *hh)
|
|||||||
uint64_t epgid = 0;
|
uint64_t epgid = 0;
|
||||||
time_t starttime = 0;
|
time_t starttime = 0;
|
||||||
sscanf(hh->ParamList["fskid"].c_str(), "%" SCNu64 "", &epgid);
|
sscanf(hh->ParamList["fskid"].c_str(), "%" SCNu64 "", &epgid);
|
||||||
sscanf(hh->ParamList["starttime"].c_str(), "%lu", &starttime);
|
sscanf(hh->ParamList["starttime"].c_str(), "%lld", &starttime);
|
||||||
CEPGData longepg;
|
CEPGData longepg;
|
||||||
if (CEitManager::getInstance()->getEPGid(epgid, starttime, &longepg)) {
|
if (CEitManager::getInstance()->getEPGid(epgid, starttime, &longepg)) {
|
||||||
hh->printf("%u\n", longepg.fsk);
|
hh->printf("%u\n", longepg.fsk);
|
||||||
@@ -3402,7 +3402,7 @@ void CControlAPI::xmltvepgCGI(CyhookHandler *hh)
|
|||||||
struct tm *mtime = gmtime(&eventIterator->startTime);
|
struct tm *mtime = gmtime(&eventIterator->startTime);
|
||||||
strftime(zbuffer, 21, "%Y%m%d%H%M%S %z", mtime);
|
strftime(zbuffer, 21, "%Y%m%d%H%M%S %z", mtime);
|
||||||
programmeTag += "start=\""+std::string(zbuffer)+"\" ";
|
programmeTag += "start=\""+std::string(zbuffer)+"\" ";
|
||||||
long _stoptime = eventIterator->startTime + eventIterator->duration;
|
time_t _stoptime = eventIterator->startTime + eventIterator->duration;
|
||||||
mtime = gmtime(&_stoptime);
|
mtime = gmtime(&_stoptime);
|
||||||
strftime(zbuffer, 21, "%Y%m%d%H%M%S %z", mtime);
|
strftime(zbuffer, 21, "%Y%m%d%H%M%S %z", mtime);
|
||||||
programmeTag += "stop=\""+std::string(zbuffer)+"\" ";
|
programmeTag += "stop=\""+std::string(zbuffer)+"\" ";
|
||||||
|
Reference in New Issue
Block a user