Enlightenment CVS committal

Author  : tsauerbeck
Project : e17
Module  : libs/embryo

Dir     : e17/libs/embryo/src/lib


Modified Files:
        Embryo.h 


Log Message:
a sane version of the EmbryoCell to float (and vice versa) macros
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/embryo/src/lib/Embryo.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- Embryo.h    13 Oct 2004 19:34:04 -0000      1.8
+++ Embryo.h    13 Oct 2004 19:49:03 -0000      1.9
@@ -48,15 +48,20 @@
 #define EMBRYO_PROGRAM_BUSY  3
 #define EMBRYO_PROGRAM_FAIL  0
 
-/** Float to Embryo_Cell */
-#define EMBRYO_FLOAT_TO_CELL(f) ( *((Embryo_Cell*)&f))
-/** Embryo_Cell to float */
-#define EMBRYO_CELL_TO_FLOAT(c) ( *((float*)&c))
-
    typedef unsigned int                Embryo_UCell;
    typedef int                         Embryo_Cell;
    typedef struct _Embryo_Program      Embryo_Program;
    typedef int                         Embryo_Function;
+
+   typedef union {
+      float f;
+      Embryo_Cell c;
+   } FloatEmbryoCell;
+
+/** Float to Embryo_Cell */
+#define EMBRYO_FLOAT_TO_CELL(f) ((FloatEmbryoCell) f).c
+/** Embryo_Cell to float */
+#define EMBRYO_CELL_TO_FLOAT(c) ((FloatEmbryoCell) c).f
    
    int              embryo_init(void);
    int              embryo_shutdown(void);




-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to