pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:1:   /* -*- c -*-   || 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: builtin.cmod,v 1.110 2003/01/26 18:31:19 mirar Exp $ + || $Id: builtin.cmod,v 1.111 2003/01/26 19:00:53 mirar Exp $   */      #include "global.h"   #include "interpret.h"   #include "svalue.h"   #include "opcodes.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"
pike.git/src/builtin.cmod:211:    }    }    if(x->type != T_INT)    SIMPLE_BAD_ARG_ERROR("int2hex", 1, "int");       c=x->u.integer;       len=1;    if(c<0) {    len++; -  n=(-c)&((unsigned int)(-1)); +  n=(-c)&((unsigned INT_TYPE)(-1));    }else{    n=c;    }    while(n>65535) { n>>=16; len+=4; }    while(n>15) { n>>=4; len++; }       s=begin_shared_string(len);    c=x->u.integer;    if(!c)    {    s->str[0]='0';    }else{    if(c<0)    {    s->str[0]='-'; -  n=(-c)&((unsigned int)(-1)); +  n=(-c)&((unsigned INT_TYPE)(-1));    }else{    n=c;    }    while(len && n)    {    s->str[--len]="0123456789abcdef"[n&0xf];    n>>=4;    }    }    RETURN end_shared_string(s);