diff --git a/source/App/Parcat/parcat.cpp b/source/App/Parcat/parcat.cpp index 5746f4695aa3e1850d22a6754f50737834ad2723..d2a2be59d25927a5e9347e65025b3328026099a5 100644 --- a/source/App/Parcat/parcat.cpp +++ b/source/App/Parcat/parcat.cpp @@ -373,7 +373,7 @@ std::vector<uint8_t> process_segment(const char * path, int idx, int * poc_base, } fseek(fdi, 0, SEEK_END); - int full_sz = ftell(fdi); + long full_sz = ftell(fdi); fseek(fdi, 0, SEEK_SET); std::vector<uint8_t> v(full_sz); diff --git a/source/Lib/CommonLib/Quant.cpp b/source/Lib/CommonLib/Quant.cpp index b75f57ea019522e5ef4c619da3d703899bdd47b9..249df2fe57ef9760ec862b673c5d487dc6fbdb45 100644 --- a/source/Lib/CommonLib/Quant.cpp +++ b/source/Lib/CommonLib/Quant.cpp @@ -1104,7 +1104,8 @@ void Quant::transformSkipQuantOneSample(TransformUnit &tu, const ComponentID &co */ const int iQBits = QUANT_SHIFT + cQP.per(useTransformSkip) + (useTransformSkip ? 0 : iTransformShift); // QBits will be OK for any internal bit depth as the reduction in transform shift is balanced by an increase in Qp_per due to QpBDOffset - const int iAdd = int64_t(bUseHalfRoundingPoint ? 256 : (tu.cs->slice->isIRAP() ? 171 : 85)) << int64_t(iQBits - 9); + const int64_t iAdd = int64_t(bUseHalfRoundingPoint ? 256 : (tu.cs->slice->isIRAP() ? 171 : 85)) + << int64_t(iQBits - 9); TCoeff transformedCoefficient; // transform-skip diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index da8efde648a46797df243e3a8af47e36b0de9175..38c36ee8fe07f32c9f03496b05768f2d74c0d88b 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -42,6 +42,7 @@ #error Include CommonDef.h not TypeDef.h #endif +#include <array> #include <vector> #include <utility> #include <sstream> diff --git a/source/Lib/DecoderLib/SEIread.cpp b/source/Lib/DecoderLib/SEIread.cpp index 10cf16d6925c9711a45fc9058380bc2f2b6ecfe7..2abafca5f3d00e3338b5f0b97bdd28d9ea6c5b20 100644 --- a/source/Lib/DecoderLib/SEIread.cpp +++ b/source/Lib/DecoderLib/SEIread.cpp @@ -110,7 +110,10 @@ static inline void output_sei_message_header(SEI &sei, std::ostream *pDecodedMes if (pDecodedMessageOutputStream) { std::string seiMessageHdr(SEI::getSEIMessageString(sei.payloadType())); seiMessageHdr+=" SEI message"; - (*pDecodedMessageOutputStream) << std::setfill('-') << std::setw(seiMessageHdr.size()) << "-" << std::setfill(' ') << "\n" << seiMessageHdr << " (" << payloadSize << " bytes)"<< "\n"; + (*pDecodedMessageOutputStream) << std::setfill('-') << std::setw((int) seiMessageHdr.size()) << "-" + << std::setfill(' ') << "\n" + << seiMessageHdr << " (" << payloadSize << " bytes)" + << "\n"; } } diff --git a/source/Lib/Utilities/program_options_lite.h b/source/Lib/Utilities/program_options_lite.h index 2b1f4cfb11fa416e360084f581c22fb22fda611d..7324b7e09ca263b77feb9a45adf79b0bc1e24f42 100644 --- a/source/Lib/Utilities/program_options_lite.h +++ b/source/Lib/Utilities/program_options_lite.h @@ -264,15 +264,15 @@ namespace df std::string cNameBuffer; std::string cDescriptionBuffer; - for (unsigned int uiK = 0; uiK < uiMaxNum; uiK++) + for (unsigned int k = 0; k < uiMaxNum; k++) { // it needs to be reset when extra digit is added, e.g. number 10 and above cNameBuffer.resize(name.size() + 10); cDescriptionBuffer.resize(desc.size() + 10); // isn't there are sprintf function for string?? - sprintf((char*)cNameBuffer.c_str(), name.c_str(), uiK, uiK); - sprintf((char*)cDescriptionBuffer.c_str(), desc.c_str(), uiK, uiK); + snprintf((char *) cNameBuffer.c_str(), cNameBuffer.size(), name.c_str(), k, k); + snprintf((char *) cDescriptionBuffer.c_str(), cDescriptionBuffer.size(), desc.c_str(), k, k); size_t pos = cNameBuffer.find_first_of('\0'); if (pos != std::string::npos) @@ -280,7 +280,7 @@ namespace df cNameBuffer.resize(pos); } - parent.addOption(new Option<T>(cNameBuffer, (storage[uiK]), default_val, cDescriptionBuffer)); + parent.addOption(new Option<T>(cNameBuffer, (storage[k]), default_val, cDescriptionBuffer)); } return *this; @@ -293,21 +293,21 @@ namespace df std::string cNameBuffer; std::string cDescriptionBuffer; - for (unsigned int uiK = 0; uiK < uiMaxNum; uiK++) + for (unsigned int k = 0; k < uiMaxNum; k++) { // it needs to be reset when extra digit is added, e.g. number 10 and above cNameBuffer.resize(name.size() + 10); cDescriptionBuffer.resize(desc.size() + 10); // isn't there are sprintf function for string?? - sprintf((char*)cNameBuffer.c_str(), name.c_str(), uiK, uiK); - sprintf((char*)cDescriptionBuffer.c_str(), desc.c_str(), uiK, uiK); + snprintf((char *) cNameBuffer.c_str(), cNameBuffer.size(), name.c_str(), k, k); + snprintf((char *) cDescriptionBuffer.c_str(), cDescriptionBuffer.size(), desc.c_str(), k, k); size_t pos = cNameBuffer.find_first_of('\0'); if (pos != std::string::npos) cNameBuffer.resize(pos); - parent.addOption(new Option<T>(cNameBuffer, *(storage[uiK]), default_val, cDescriptionBuffer)); + parent.addOption(new Option<T>(cNameBuffer, *(storage[k]), default_val, cDescriptionBuffer)); } return *this;