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:
Scott Graham 2014-12-18 08:42:26 -08:00
parent 10165ce449
commit ec38bf152d

View File

@ -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;
} }