mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 22:16:13 +00:00
win: Add static_cast to AssignIfInRange
Otherwise, when assigning to a smaller type, MSVC warns e.g. d:\src\crashpad\crashpad\util\numeric\safe_assignment.h(38) : error C2220: warning treated as error - no 'object' file generated d:\src\crashpad\crashpad\util\file\string_file_writer.cc(127) : see reference to function template instantiation 'bool crashpad::AssignIfInRange<size_t,FileOffset>(Destination *,Source)' being compiled with [ Destination=size_t , Source=FileOffset ] d:\src\crashpad\crashpad\util\numeric\safe_assignment.h(38) : warning C4244: '=' : conversion from 'FileOffset' to 'size_t', possible loss of data R=mark@chromium.org BUG=crashpad:1 Review URL: https://codereview.chromium.org/809303003
This commit is contained in:
parent
10165ce449
commit
ec38bf152d
@ -35,7 +35,7 @@ bool AssignIfInRange(Destination* destination, Source source) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
*destination = source;
|
*destination = static_cast<Destination>(source);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user