mirror of
https://github.com/libretro/libretro-tyrquake.git
synced 2025-02-23 01:11:45 +00:00
fix strict-aliasing warning in byte swap tests
This commit is contained in:
parent
64f6e7da98
commit
1984cd1587
@ -1012,10 +1012,15 @@ COM_Init
|
||||
void
|
||||
COM_Init(char *basedir)
|
||||
{
|
||||
byte swaptest[2] = { 1, 0 };
|
||||
union {
|
||||
byte b[2];
|
||||
short s;
|
||||
} swaptest = {
|
||||
.b = { 1, 0 }
|
||||
};
|
||||
|
||||
// set the byte swapping variables in a portable manner
|
||||
if (*(short *)swaptest == 1) {
|
||||
if (swaptest.s == 1) {
|
||||
bigendien = false;
|
||||
BigShort = ShortSwap;
|
||||
LittleShort = ShortNoSwap;
|
||||
|
@ -1094,10 +1094,15 @@ COM_Init
|
||||
void
|
||||
COM_Init(void)
|
||||
{
|
||||
byte swaptest[2] = { 1, 0 };
|
||||
union {
|
||||
byte b[2];
|
||||
short s;
|
||||
} swaptest = {
|
||||
.b = { 1, 0 }
|
||||
};
|
||||
|
||||
// set the byte swapping variables in a portable manner
|
||||
if (*(short *)swaptest == 1) {
|
||||
if (swaptest.s == 1) {
|
||||
bigendien = false;
|
||||
BigShort = ShortSwap;
|
||||
LittleShort = ShortNoSwap;
|
||||
|
Loading…
x
Reference in New Issue
Block a user