diff --git a/lib/procs.cpp b/lib/procs.cpp index d2a37a4f..2ed13fd8 100644 --- a/lib/procs.cpp +++ b/lib/procs.cpp @@ -254,7 +254,7 @@ std::string Util::Procs::getOutputOf(char *const *argv, uint64_t maxWait){ } }else{ if (maxWait && waitedFor > maxWait){ - WARN_MSG("Timeout while getting output of '%s', returning %luB of data", (char *)argv, ret.size()); + WARN_MSG("Timeout while getting output of '%s', returning %zuB of data", (char *)argv, ret.size()); break; } else if(maxWait){ @@ -297,7 +297,7 @@ std::string Util::Procs::getLimitedOutputOf(char *const *argv, uint64_t maxWait, } }else{ if (waitedFor > maxWait){ - WARN_MSG("Reached timeout of %lu ms. Killing process with command %s...", maxWait, fullCmd.c_str()); + WARN_MSG("Reached timeout of %" PRIu64 " ms. Killing process with command %s...", maxWait, fullCmd.c_str()); break; } else { @@ -307,7 +307,7 @@ std::string Util::Procs::getLimitedOutputOf(char *const *argv, uint64_t maxWait, } } if (ret.size() > maxValBytes){ - WARN_MSG("Have a limit of %uB, but received %luB of data. Killing process with command %s...", maxValBytes, ret.size(), fullCmd.c_str()); + WARN_MSG("Have a limit of %" PRIu32 "B, but received %zuB of data. Killing process with command %s...", maxValBytes, ret.size(), fullCmd.c_str()); break; } } diff --git a/src/controller/controller_variables.cpp b/src/controller/controller_variables.cpp index cc82709d..b8e49ff7 100644 --- a/src/controller/controller_variables.cpp +++ b/src/controller/controller_variables.cpp @@ -372,7 +372,7 @@ namespace Controller{ uint64_t lastRun = Util::epoch(); Util::stringTrim(newVal); if (newVal.size() > 127){ - WARN_MSG("Truncating response of custom variable %s to 127 bytes (received %lu bytes)", name.c_str(), newVal.size()); + WARN_MSG("Truncating response of custom variable %s to 127 bytes (received %zu bytes)", name.c_str(), newVal.size()); newVal = newVal.substr(0, 127); } // Modify config diff --git a/src/input/input.cpp b/src/input/input.cpp index b456dcad..6e16b783 100644 --- a/src/input/input.cpp +++ b/src/input/input.cpp @@ -1538,14 +1538,14 @@ namespace Mist{ std::string fileName = config->getString("input") + ".dtsh"; HIGH_MSG("Loading metadata for stream '%s' from file '%s'", streamName.c_str(), fileName.c_str()); char *scanBuf; - uint64_t fileSize; + size_t fileSize; HTTP::URIReader inFile(fileName); if (!inFile){return false;} inFile.readAll(scanBuf, fileSize); inFile.close(); if (!fileSize){return false;} DTSC::Packet pkt(scanBuf, fileSize, true); - HIGH_MSG("Retrieved header of %lu bytes", fileSize); + HIGH_MSG("Retrieved header of %zu bytes", fileSize); meta.reInit(config->getBool("realtime") ? "" : streamName, pkt.getScan()); if (meta.version != DTSH_VERSION){ diff --git a/src/output/output.cpp b/src/output/output.cpp index c66b3d71..6f412c0e 100644 --- a/src/output/output.cpp +++ b/src/output/output.cpp @@ -575,7 +575,7 @@ namespace Mist{ // The current line should be a segment path at this point // If we are above the max segment count or age, ignore this segment and reset info fields if (maxEntries && (segmentCount - segmentsRemoved >= maxEntries)){ - HIGH_MSG("Dropping segment #%lu from the playlist due to the playlist reaching it's max size of %lu segments", segmentsRemoved, maxEntries); + HIGH_MSG("Dropping segment #%" PRIu64 " from the playlist due to the playlist reaching it's max size of %" PRIu64 " segments", segmentsRemoved, maxEntries); curDateString = ""; curDurationString = ""; segmentsRemoved++; @@ -590,7 +590,7 @@ namespace Mist{ if (targetAge && curDateString.size() > 25){ uint64_t segmentDiff = Util::getUTCTimeDiff(curDateString.substr(25), curTime); if (segmentDiff > targetAge){ - HIGH_MSG("Dropping segment #%lu from the playlist due to old age (%lu s)", segmentsRemoved, segmentDiff); + HIGH_MSG("Dropping segment #%" PRIu64 " from the playlist due to old age (%" PRIu64 " s)", segmentsRemoved, segmentDiff); // If the segment is too old, ignore and reset fields curDurationString = ""; curDateString = ""; @@ -1425,7 +1425,7 @@ namespace Mist{ } playlistBuffer += "#EXT-X-DISCONTINUITY\n"; INFO_MSG("Appending to existing local playlist file '%s'", playlistLocationString.c_str()); - INFO_MSG("Found %lu prior segments", segmentCount); + INFO_MSG("Found %" PRIu64 " prior segments", segmentCount); }else{ // Remove all segments referenced in the playlist while (std::getline(inFile, line)) { @@ -1475,7 +1475,7 @@ namespace Mist{ playlistBuffer += line + '\n'; } playlistBuffer += "#EXT-X-DISCONTINUITY\n"; - INFO_MSG("Found %lu prior segments", segmentCount); + INFO_MSG("Found %" PRIu64 " prior segments", segmentCount); INFO_MSG("Appending to existing remote playlist file '%s'", playlistLocationString.c_str()); }else{ WARN_MSG("Overwriting existing remote playlist file '%s'", playlistLocationString.c_str()); @@ -1660,7 +1660,7 @@ namespace Mist{ uint64_t unixMs = M.getBootMsOffset() + systemBoot + currentStartTime; playlistBuffer += "#EXT-X-PROGRAM-DATE-TIME:" + Util::getUTCStringMillis(unixMs) + "\n"; } - INFO_MSG("Adding new segment `%s` of %lums to playlist '%s'", segment.c_str(), lastPacketTime - currentStartTime, playlistLocationString.c_str()); + INFO_MSG("Adding new segment `%s` of %" PRIu64 "ms to playlist '%s'", segment.c_str(), lastPacketTime - currentStartTime, playlistLocationString.c_str()); // Append duration & TS filename to playlist file std::stringstream tmp; double segmentDuration = (lastPacketTime - currentStartTime) / 1000.0; @@ -1670,7 +1670,7 @@ namespace Mist{ if (segmentDuration > atoll(targetDuration.c_str())){ // Set the new targetDuration to the ceil of the segment duration targetDuration = JSON::Value(uint64_t(segmentDuration) + 1).asString(); - WARN_MSG("Segment #%lu has a longer duration than the target duration. Adjusting the targetDuration to %s seconds", segmentCount, targetDuration.c_str()); + WARN_MSG("Segment #%" PRIu64 " has a longer duration than the target duration. Adjusting the targetDuration to %s seconds", segmentCount, targetDuration.c_str()); // Round the target split time down to ensure we split on the keyframe for very long keyframe intervals targetParams["split"] = JSON::Value(uint64_t(segmentDuration)).asString(); // Modify the buffer to contain the new targetDuration @@ -1790,7 +1790,7 @@ namespace Mist{ uint64_t unixMs = M.getBootMsOffset() + systemBoot + currentStartTime; playlistBuffer += "#EXT-X-PROGRAM-DATE-TIME:" + Util::getUTCStringMillis(unixMs) + "\n"; } - INFO_MSG("Adding final segment `%s` of %lums to playlist '%s'", segment.c_str(), lastPacketTime - currentStartTime, playlistLocationString.c_str()); + INFO_MSG("Adding final segment `%s` of %" PRIu64 "ms to playlist '%s'", segment.c_str(), lastPacketTime - currentStartTime, playlistLocationString.c_str()); // Append duration & TS filename to playlist file std::stringstream tmp; tmp << "#EXTINF:" << std::fixed << std::setprecision(3) << (lastPacketTime - currentStartTime) / 1000.0 << ",\n"+ segment + "\n";