From f8fc1eb94b4ca39e8c330f7fd8abf91aab9a49b9 Mon Sep 17 00:00:00 2001 From: John Birrell Date: Tue, 12 May 1998 23:07:07 +0000 Subject: [PATCH] This code casts double -> int -> char *. Ugh. Take a punt and change the int to a long so that no bits are thrown away on alpha and hope for the best. --- gnu/usr.bin/perl/perl/doio.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/gnu/usr.bin/perl/perl/doio.c b/gnu/usr.bin/perl/perl/doio.c index 0ace3773f9dd..d940ef86d2c9 100644 --- a/gnu/usr.bin/perl/perl/doio.c +++ b/gnu/usr.bin/perl/perl/doio.c @@ -1,4 +1,4 @@ -/* $RCSfile: doio.c,v $$Revision: 1.3 $$Date: 1995/05/30 05:03:00 $ +/* $RCSfile: doio.c,v $$Revision: 1.4 $$Date: 1996/12/03 21:56:13 $ * * Copyright (c) 1991, Larry Wall * @@ -6,6 +6,14 @@ * License or the Artistic License, as specified in the README file. * * $Log: doio.c,v $ + * Revision 1.4 1996/12/03 21:56:13 nate + * Added support for '-T' and '-B' (text and binary) file recognition by + * peeking inside of Chris Torek's stdio library internals. This is + * similar to the code used for other systems, but didn't work on CT's new + * implementation. + * + * Submitted by: Gary Kline + * * Revision 1.3 1995/05/30 05:03:00 rgrimes * Remove trailing whitespace. * @@ -763,12 +771,9 @@ STR *argstr; s[argstr->str_cur] = 17; /* a little sanity check here */ } else { - retval = (int)str_gnum(argstr); -#ifdef DOSISH - s = (char*)(long)retval; /* ouch */ -#else - s = (char*)retval; /* ouch */ -#endif + long lretval = (long)str_gnum(argstr); + retval = (int) lretval; + s = (char*)lretval; /* ouch */ } #ifndef lint