From 58fd8aa851eac8736815663c3116e2e45b533bad Mon Sep 17 00:00:00 2001 From: Luiz Henrique de Figueiredo Date: Thu, 14 Mar 1996 14:31:15 -0300 Subject: [PATCH] added cast instead of union [lazy?] --- undump.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/undump.c b/undump.c index 6c58dff2..eb8e6634 100644 --- a/undump.c +++ b/undump.c @@ -3,7 +3,7 @@ ** load bytecodes from files */ -char* rcs_undump="$Id: undump.c,v 1.12 1996/03/11 22:01:46 lhf Exp lhf $"; +char* rcs_undump="$Id: undump.c,v 1.13 1996/03/12 20:00:40 lhf Exp lhf $"; #include #include @@ -158,7 +158,7 @@ static int LoadWord(FILE* D) fread(&w,sizeof(w),1,D); if (swapword) { - Byte* p=&w; /* TODO: need union? */ + Byte* p=(Byte*)&w; /* TODO: need union? */ Byte t; t=p[0]; p[0]=p[1]; p[1]=t; } @@ -267,7 +267,7 @@ static void LoadHeader(FILE* D) /* TODO: error handling */ fread(&f,sizeof(f),1,D); /* test float */ if (f!=tf) { - Byte* p=&f; /* TODO: need union? */ + Byte* p=(Byte*)&f; /* TODO: need union? */ Byte t; swapfloat=1; t=p[0]; p[0]=p[3]; p[3]=t;