X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=common%2Fpickle.hpp;h=84b643a93ab7301c2e4fdbaa5520fa7bb8e176d9;hb=e7102bf755210f9e215fb048b637dda6bab96334;hp=41667e653783be3bf934ceba9a11afaaba373615;hpb=4647f208f5a2b87391281e0f1202f66c23943bd9;p=apitrace diff --git a/common/pickle.hpp b/common/pickle.hpp index 41667e6..84b643a 100644 --- a/common/pickle.hpp +++ b/common/pickle.hpp @@ -36,6 +36,7 @@ #include #include +#include class PickleWriter @@ -301,7 +302,12 @@ protected: } // Same as l >> (8 * sizeof l), but without the warnings - T sign = l < 0 ? ~0 : 0; + T sign; + if (std::numeric_limits::is_signed) { + sign = l < 0 ? ~0 : 0; + } else { + sign = 0; + } T sl = l; unsigned c = 0;