replaced unions by memcpy

This commit is contained in:
Luiz Henrique de Figueiredo
1996-11-07 11:59:51 -02:00
parent fd379b38f7
commit 8d50122af0

View File

@@ -3,7 +3,7 @@
** load bytecodes from files ** load bytecodes from files
*/ */
char* rcs_undump="$Id: undump.c,v 1.13 1996/03/12 20:00:40 lhf Exp lhf $"; char* rcs_undump="$Id: undump.c,v 1.14 1996/03/14 17:31:15 lhf Exp $";
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@@ -142,13 +142,14 @@ static void Unthread(Byte* code, int i, int v)
{ {
while (i!=0) while (i!=0)
{ {
CodeWord c; Word w;
Byte* p=code+i; Byte* p=code+i;
get_word(c,p); Byte* c=&w;
i=c.w; get_word(w,p);
c.w=v; i=w;
p[-2]=c.m.c1; w=v;
p[-1]=c.m.c2; p[-2]=c[0];
p[-1]=c[1];
} }
} }
@@ -208,13 +209,9 @@ static void LoadFunction(FILE* D)
} }
else /* fix PUSHFUNCTION */ else /* fix PUSHFUNCTION */
{ {
CodeCode c;
Byte* p;
tf->marked=LoadWord(D); tf->marked=LoadWord(D);
tf->fileName=Main->fileName; tf->fileName=Main->fileName;
p=Main->code+tf->marked; memcpy(Main->code+tf->marked,&tf,sizeof(tf));
c.tf=tf;
*p++=c.m.c1; *p++=c.m.c2; *p++=c.m.c3; *p++=c.m.c4;
lastF=lastF->next=tf; lastF=lastF->next=tf;
} }
tf->code=LoadBlock(tf->size,D); tf->code=LoadBlock(tf->size,D);