Branch: Tag:

2003-01-26

2003-01-26 22:10:00 by Mirar (Pontus Hagland) <pike@sort.mirar.org>

(large INT_TYPE saga) F_NUMBER64 edited to handle negative numbers correctly

Rev: src/docode.c:1.162
Rev: src/interpret_functions.h:1.131

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: docode.c,v 1.161 2003/01/26 15:29:23 mirar Exp $ + || $Id: docode.c,v 1.162 2003/01/26 22:10:00 mirar Exp $   */      #include "global.h" - RCSID("$Id: docode.c,v 1.161 2003/01/26 15:29:23 mirar Exp $"); + RCSID("$Id: docode.c,v 1.162 2003/01/26 22:10:00 mirar Exp $");   #include "las.h"   #include "program.h"   #include "pike_types.h"
2045: Inside #if SIZEOF_INT_TYPE > 4
   INT_TYPE i=n->u.sval.u.integer;    if (i != (INT32)i)    { -  INT_TYPE ip=i; +  unsigned INT_TYPE ip=(unsigned INT_TYPE)i;    INT32 a,b; -  -  if (ip<0) ip=-ip; +     a=(INT32)(ip>>32);    b=(INT32)(ip&0xffffffff); -  if (i<0) a=-a; -  +     emit2(F_NUMBER64,a,b);    }    else