diff --git a/src/EbmlMaster.cpp b/src/EbmlMaster.cpp index ea2d63a..5735ac9 100644 --- a/src/EbmlMaster.cpp +++ b/src/EbmlMaster.cpp @@ -65,7 +65,7 @@ EbmlMaster::EbmlMaster(const EbmlMaster & ElementToClone) while (Itr != ElementToClone.ElementList.end()) { *myItr = (*Itr)->Clone(); - Itr++; myItr++; + ++Itr; ++myItr; } } @@ -524,7 +524,7 @@ bool EbmlMaster::InsertElement(EbmlElement & element, size_t position) std::vector::iterator Itr = ElementList.begin(); while (Itr != ElementList.end() && position--) { - Itr++; + ++Itr; } if ((Itr == ElementList.end()) && position) return false; @@ -538,7 +538,7 @@ bool EbmlMaster::InsertElement(EbmlElement & element, const EbmlElement & before std::vector::iterator Itr = ElementList.begin(); while (Itr != ElementList.end() && *Itr != &before) { - Itr++; + ++Itr; } if (Itr == ElementList.end()) return false; diff --git a/src/platform/win32/WinIOCallback.cpp b/src/platform/win32/WinIOCallback.cpp index 9ac1190..bf592d6 100644 --- a/src/platform/win32/WinIOCallback.cpp +++ b/src/platform/win32/WinIOCallback.cpp @@ -153,10 +153,11 @@ bool WinIOCallback::open(const wchar_t* Path, const open_mode aMode, DWORD dwFla mFile = CreateFileW(Path, AccessMode, ShareMode, NULL, Disposition, dwFlags, NULL); } else { int errCode; - unsigned int bufferSize = wcslen(Path) + sizeof(wchar_t) * 2; + int pathSize = wcslen(Path); + unsigned int bufferSize = pathSize + sizeof(wchar_t) * 2; std::string PathA; PathA.resize(bufferSize); - errCode = WideCharToMultiByte(CP_ACP, 0, Path, wcslen(Path), (char *)PathA.c_str(), bufferSize, NULL, NULL); + errCode = WideCharToMultiByte(CP_ACP, 0, Path, pathSize, (char *)PathA.c_str(), bufferSize, NULL, NULL); if (errCode == 0) errCode = GetLastError(); #ifdef _DEBUG @@ -168,7 +169,7 @@ bool WinIOCallback::open(const wchar_t* Path, const open_mode aMode, DWORD dwFla // Increase the buffer size bufferSize += MAX_PATH; PathA.resize(bufferSize); - errCode = WideCharToMultiByte(CP_ACP, WC_SEPCHARS, Path, wcslen(Path), (char *)PathA.c_str(), bufferSize, NULL, NULL); + errCode = WideCharToMultiByte(CP_ACP, WC_SEPCHARS, Path, pathSize, (char *)PathA.c_str(), bufferSize, NULL, NULL); if (errCode == 0) errCode = GetLastError(); } @@ -251,7 +252,7 @@ void WinIOCallback::setFilePointer(int64 Offset, seek_mode Mode) } else { - mCurrentPosition |= uint64(High<<32); + mCurrentPosition |= uint64(High)<<32; } }