Author: tfaber Date: Thu Nov 14 21:44:47 2013 New Revision: 60993
URL: http://svn.reactos.org/svn/reactos?rev=60993&view=rev Log: [PSDK] - Fix (nt)intsafe.h signed to unsigned conversions. Based on a patch by Timo. CORE-7578 #resolve
Modified: trunk/reactos/include/psdk/intsafe.h
Modified: trunk/reactos/include/psdk/intsafe.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/intsafe.h?rev=... ============================================================================== --- trunk/reactos/include/psdk/intsafe.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/intsafe.h [iso-8859-1] Thu Nov 14 21:44:47 2013 @@ -343,7 +343,8 @@ _In_ _TypeFrom Input, \ _Out_ _Deref_out_range_(==, Input) _TypeTo *pOutput) \ { \ - if ((Input >= 0) && ((_TypeTo)Input <= _TypeTo ## _MAX)) \ + if ((Input >= 0) && \ + ((sizeof(_TypeFrom) <= sizeof(_TypeTo)) || (Input <= (_TypeFrom)_TypeTo ## _MAX))) \ { \ *pOutput = (_TypeTo)Input; \ return INTSAFE_SUCCESS; \