Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef void *HANDLE;
- #if defined(OS_WIN)
- typedef HANDLE PlatformFile;
- #elif defined(OS_POSIX)
- typedef int PlatformFile;
- #endif
- int64 SeekPlatformFile(PlatformFile file,
- PlatformFileWhence whence,
- int64 offset) {
- base::ThreadRestrictions::AssertIOAllowed();
- if (file < 0 || offset < 0)
- return -1;
- LARGE_INTEGER distance, res;
- distance.QuadPart = offset;
- DWORD move_method = static_cast<DWORD>(whence);
- if (!SetFilePointerEx(file, distance, &res, move_method))
- return -1;
- return res.QuadPart;
- }
- This suspicious code was found in Chromium project by PVS-Studio static code analyzer.
- Warning message is:
- V503 This is a nonsensical comparison: pointer < 0. platform_file_win.cc 124
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement