mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-11 08:40:44 +00:00
use cast when masking 64bit value
This commit is contained in:
parent
96dcac7a74
commit
0d6d01bc00
2 changed files with 4 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
|||
2018-02-05 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSPortCoder.m: Remove redundant (always true) conditional.
|
||||
Use cast to mask 64bit values.
|
||||
* Source/NSUnarchiver.m: Remove redundant (always true) conditional.
|
||||
* Source/NSPropertyList.m: Remove dead code
|
||||
* Source/NSDecimal.m: Remove dead code
|
||||
|
|
|
@ -1205,21 +1205,21 @@ scalarSize(char type)
|
|||
switch (size)
|
||||
{
|
||||
case 1:
|
||||
if (big & ~0xff)
|
||||
if (big & (uint64_t)~0xff)
|
||||
{
|
||||
NSLog(@"Loss of information converting decoded value to uint8_t");
|
||||
}
|
||||
*(uint8_t*)address = (uint8_t)big;
|
||||
return;
|
||||
case 2:
|
||||
if (big & ~0xffff)
|
||||
if (big & (uint64_t)~0xffff)
|
||||
{
|
||||
NSLog(@"Loss of information converting decoded value to uint16_t");
|
||||
}
|
||||
*(uint16_t*)address = (uint16_t)big;
|
||||
return;
|
||||
case 4:
|
||||
if (big & ~0xffffffff)
|
||||
if (big & (uint64_t)~0xffffffff)
|
||||
{
|
||||
NSLog(@"Loss of information converting decoded value to uint32_t");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue