Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/embryo
Dir : e17/libs/embryo/src/lib
Modified Files:
embryo_amx.c
Log Message:
norty norty! put that code back! it IS used!
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/embryo/src/lib/embryo_amx.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- embryo_amx.c 11 Jul 2004 09:50:42 -0000 1.20
+++ embryo_amx.c 16 Jul 2004 03:20:18 -0000 1.21
@@ -23,11 +23,36 @@
#define JUMPABS(base, ip) ((Embryo_Cell *)(code + (*ip)))
+#ifdef WORDS_BIGENDIAN
+static void _embryo_byte_swap_16 (unsigned short *v);
+static void _embryo_byte_swap_32 (unsigned int *v);
+#endif
static int _embryo_native_call (Embryo_Program *ep, Embryo_Cell index, Embryo_Cell
*result, Embryo_Cell *params);
static int _embryo_func_get (Embryo_Program *ep, int index, char *funcname);
static int _embryo_var_get (Embryo_Program *ep, int index, char *varname,
Embryo_Cell *ep_addr);
static int _embryo_program_init (Embryo_Program *ep, void *code);
+#ifdef WORDS_BIGENDIAN
+static void
+_embryo_byte_swap_16(unsigned short *v)
+{
+ unsigned char *s, t;
+
+ s = (unsigned char *)v;
+ t = s[0]; s[0] = s[1]; s[1] = t;
+}
+
+static void
+_embryo_byte_swap_32(unsigned int *v)
+{
+ unsigned char *s, t;
+
+ s = (unsigned char *)v;
+ t = s[0]; s[0] = s[3]; s[3] = t;
+ t = s[1]; s[1] = s[2]; s[2] = t;
+}
+#endif
+
static int
_embryo_native_call(Embryo_Program *ep, Embryo_Cell index, Embryo_Cell *result,
Embryo_Cell *params)
{
@@ -253,7 +278,9 @@
return NULL;
}
rewind(f);
+#ifdef WORDS_BIGENDIAN
embryo_swap_32((unsigned int *)(&hdr.size));
+#endif
if ((int)hdr.size < program_size) program_size = hdr.size;
program = malloc(program_size);
if (!program)
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs