mirror of
https://github.com/vivier/EMILE.git
synced 2024-12-21 18:30:20 +00:00
gcc-4.6: correct strict aliasing errors.
Use "union" to remove error: "error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]" Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
parent
f2be9d761f
commit
8cde86073a
@ -21,7 +21,7 @@ OSErr SerGetBuf(short refNum, long *count)
|
||||
|
||||
res = PBStatusSync((ParmBlkPtr)¶m);
|
||||
|
||||
*count = *(long*)param.csParam;
|
||||
*count = param.csParamLong;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -48,7 +48,11 @@ struct CntrlParam {
|
||||
COMMON_PARAMS
|
||||
int16_t ioCRefNum;
|
||||
int16_t csCode;
|
||||
union {
|
||||
int16_t csParam[11];
|
||||
long csParamLong;
|
||||
void * csParamPtr;
|
||||
};
|
||||
};
|
||||
typedef struct CntrlParam CntrlParam;
|
||||
typedef CntrlParam* CntrlParamPtr;
|
||||
|
@ -83,7 +83,7 @@ static inline OSErr GetCurrentMode(short refNum, VDSwitchInfoRec *hwMode)
|
||||
|
||||
param.csCode = cscGetCurMode;
|
||||
param.ioCRefNum = refNum;
|
||||
*((VDSwitchInfoRec **)¶m.csParam[0]) = hwMode;
|
||||
param.csParamPtr = hwMode;
|
||||
|
||||
return PBStatusSync((ParmBlkPtr)¶m);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user