From 3a246dfb9bac6080d10717121a55ae4dea3207a3 Mon Sep 17 00:00:00 2001 From: Marcin Cieslak Date: Mon, 24 Sep 2012 13:36:13 +0200 Subject: [PATCH] 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. --- cde/programs/dtmail/dtmail/DmxPrintOptions.C | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cde/programs/dtmail/dtmail/DmxPrintOptions.C b/cde/programs/dtmail/dtmail/DmxPrintOptions.C index 15011af2..306f1da1 100644 --- a/cde/programs/dtmail/dtmail/DmxPrintOptions.C +++ b/cde/programs/dtmail/dtmail/DmxPrintOptions.C @@ -672,11 +672,8 @@ DmxPrintOptions::isValidMarginSpec(PropUiItem* pui, void* data) char *marginSpec = NULL; XtEnum parseError; Widget text; -#if defined(linux) || defined(CSRG_BASED) - _DtPrintMarginEnum which = *((_DtPrintMarginEnum *) data); -#else - _DtPrintMarginEnum which = (_DtPrintMarginEnum) data; -#endif + + _DtPrintMarginEnum which = (_DtPrintMarginEnum)(long)data; text = pui->getWidget(); if (text) -- 2.25.1