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 15011af..306f1da 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)
-- 
1.7.9.2


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel

Reply via email to