lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 58fd8aa851eac8736815663c3116e2e45b533bad
parent 3226ac2da8477456aaa38443507d3f276ebd74b7
Author: Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>
Date:   Thu, 14 Mar 1996 14:30:55 -0300

added cast instead of union [lazy?]

Diffstat:
Mundump.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 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 <stdio.h> #include <string.h> @@ -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;