Get rid of unpleasant cast, it causes SIGSEGV
Having a difficult choice between unplasant cast to get a void * into an enumeration type and "Something's wrong here" double cast I decided for the latter. At least it does not crash when the legal value of zero is passed as the argument.
This commit is contained in:
committed by
Jon Trulson
parent
86cb67de90
commit
3a246dfb9b
@@ -672,11 +672,8 @@ DmxPrintOptions::isValidMarginSpec(PropUiItem* pui, void* data)
|
|||||||
char *marginSpec = NULL;
|
char *marginSpec = NULL;
|
||||||
XtEnum parseError;
|
XtEnum parseError;
|
||||||
Widget text;
|
Widget text;
|
||||||
#if defined(linux) || defined(CSRG_BASED)
|
|
||||||
_DtPrintMarginEnum which = *((_DtPrintMarginEnum *) data);
|
_DtPrintMarginEnum which = (_DtPrintMarginEnum)(long)data;
|
||||||
#else
|
|
||||||
_DtPrintMarginEnum which = (_DtPrintMarginEnum) data;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
text = pui->getWidget();
|
text = pui->getWidget();
|
||||||
if (text)
|
if (text)
|
||||||
|
|||||||
Reference in New Issue
Block a user