diff options
author | Nigel Stewart <nigels@users.sourceforge.net> | 2013-07-03 14:10:51 -0500 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2013-07-08 13:28:41 +0100 |
commit | 2f51c030a4806acf8c74199e39afb8d1a7b1f200 (patch) | |
tree | b8d4eaae6df8ab25e43a09ded43d82dbd8d14544 /common | |
parent | 7eb579d3067914cd8c370ffb577a5917c9616854 (diff) |
Resolve C4267 MS compiler warnings
warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
Diffstat (limited to 'common')
-rw-r--r-- | common/trace_file_zlib.cpp | 6 | ||||
-rw-r--r-- | common/trace_loader.cpp | 2 | ||||
-rw-r--r-- | common/trace_profiler.cpp | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/common/trace_file_zlib.cpp b/common/trace_file_zlib.cpp index c4eed33d..a432ccde 100644 --- a/common/trace_file_zlib.cpp +++ b/common/trace_file_zlib.cpp @@ -105,12 +105,12 @@ bool ZLibFile::rawOpen(const std::string &filename, File::Mode mode) bool ZLibFile::rawWrite(const void *buffer, size_t length) { - return gzwrite(m_gzFile, buffer, length) != -1; + return gzwrite(m_gzFile, buffer, unsigned(length)) != -1; } size_t ZLibFile::rawRead(void *buffer, size_t length) { - int ret = gzread(m_gzFile, buffer, length); + int ret = gzread(m_gzFile, buffer, unsigned(length)); return ret < 0 ? 0 : ret; } @@ -150,7 +150,7 @@ bool ZLibFile::rawSkip(size_t) int ZLibFile::rawPercentRead() { gz_state *state = (gz_state *)m_gzFile; - return 100 * (lseek(state->fd, 0, SEEK_CUR) / m_endOffset); + return int(100 * (lseek(state->fd, 0, SEEK_CUR) / m_endOffset)); } diff --git a/common/trace_loader.cpp b/common/trace_loader.cpp index e091dce3..6a3d7de0 100644 --- a/common/trace_loader.cpp +++ b/common/trace_loader.cpp @@ -25,7 +25,7 @@ void Loader::setFrameMarker(Loader::FrameMarker marker) unsigned Loader::numberOfFrames() const { - return m_frameBookmarks.size(); + return unsigned(m_frameBookmarks.size()); } unsigned Loader::numberOfCallsInFrame(unsigned frameIdx) const diff --git a/common/trace_profiler.cpp b/common/trace_profiler.cpp index e9ed707e..b7653409 100644 --- a/common/trace_profiler.cpp +++ b/common/trace_profiler.cpp @@ -232,7 +232,7 @@ void Profiler::parseLine(const char* in, Profile* profile) } } else if (type.compare("frame_end") == 0) { Profile::Frame frame; - frame.no = profile->frames.size(); + frame.no = unsigned(profile->frames.size()); if (frame.no == 0) { frame.gpuStart = 0; |