Enlightenment CVS committal
Author : tsauerbeck
Project : e17
Module : libs/embryo
Dir : e17/libs/embryo/src/bin
Modified Files:
embryo_cc_sc2.c
Log Message:
use EMBRYO_FLOAT_TO_CELL/CELL_TO_FLOAT macros in the sanity checks. not sure we need
this anymore at all since we now use a union to do the casting.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/embryo/src/bin/embryo_cc_sc2.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- embryo_cc_sc2.c 11 Oct 2004 17:49:59 -0000 1.13
+++ embryo_cc_sc2.c 15 Oct 2004 15:11:26 -0000 1.14
@@ -21,7 +21,7 @@
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
- * Version: $Id: embryo_cc_sc2.c,v 1.13 2004/10/11 17:49:59 tsauerbeck Exp $
+ * Version: $Id: embryo_cc_sc2.c,v 1.14 2004/10/15 15:11:26 tsauerbeck Exp $
*/
#include <assert.h>
#include <stdio.h>
@@ -31,6 +31,7 @@
#include <math.h>
#include "embryo_cc_osdefs.h"
#include "embryo_cc_sc.h"
+#include "Embryo.h"
static int match(char *st, int end);
static cell litchar(char **lptr, int rawmode);
@@ -633,17 +634,17 @@
else if (rational_digits == 0)
{
/* floating point */
- float value = (float)fnum;
-
- *val = *((cell *) & value);
+ *val = EMBRYO_FLOAT_TO_CELL((float) fnum);
#if !defined NDEBUG
/* I assume that the C/C++ compiler stores "float" values in IEEE 754
* format (as mandated in the ANSI standard). Test this assumption anyway.
*/
{
- float test1 = 0.0, test2 = 50.0;
+ float test1 = 0.0, test2 = 50.0;
+ Embryo_Cell c1 = EMBRYO_FLOAT_TO_CELL(test1);
+ Embryo_Cell c2 = EMBRYO_FLOAT_TO_CELL(test2);
- if (*(int *)&test1 != 0x00000000L)
+ if (c1 != 0x00000000L)
{
fprintf(stderr,
"embryo_cc: WARNING! you compiler does not SEEM to interpret
IEEE floating\n"
@@ -653,10 +654,9 @@
"\n"
"this could be an issue with you compiling embryo with gcc
3.2.x that seems\n"
"to trigger this sanity check. we are not sure why yet, but
gcc 3.3.x works\n"
- , (int)(*(int *)&test1)
- );
+ , c1);
}
- else if (*(int *)&test2 != 0x42480000L)
+ else if (c2 != 0x42480000L)
{
fprintf(stderr,
"embryo_cc: WARNING! you compiler does not SEEM to interpret
IEEE floating\n"
@@ -666,10 +666,8 @@
"\n"
"this could be an issue with you compiling embryo with gcc
3.2.x that seems\n"
"to trigger this sanity check. we are not sure why yet, but
gcc 3.3.x works\n"
- , (int)(*(int *)&test2)
- );
+ , c2);
}
-
}
#endif
}
-------------------------------------------------------
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