pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:30:   #include "cyclic.h"   #include "pike_security.h"   #include "pike_types.h"   #include "opcodes.h"   #include "version.h"   #include "block_allocator.h"   #include "block_alloc.h"   #include "pikecode.h"   #include "pike_compiler.h"   #include "module_support.h" + #include "bitvector.h"      #include <errno.h>   #include <fcntl.h>      #define sp Pike_sp      #undef ATTRIBUTE   #define ATTRIBUTE(X)      static void low_enter_compiler(struct object *ce, int inherit);
pike.git/src/program.c:7218:    * number entry is stored. The first stored entry (at pc 0) is the    * file and line where the program is defined, if they are known. The    * definition line for a top level program is set to 0.    */      INT_TYPE get_small_number(char **q)   {    /* This is a workaround for buggy cc & Tru64 */    unsigned char *addr = (unsigned char *)*q;    INT_TYPE ret = *((signed char *)addr); -  ret=*(signed char *)*q; +     addr++;    switch(ret)    {    case -127: -  ret = (((signed char *)addr)[0]<<8) | addr[1]; +  ret = (INT16)get_unaligned_be16(addr);    addr += 2;    if (!ret) {    /* 64-bit signed number. */ -  ret = *((signed char *)addr++); -  ret = (ret<<8) | *(addr++); -  ret = (ret<<8) | *(addr++); -  ret = (ret<<8) | *(addr++); -  ret = (ret<<8) | *(addr++); -  ret = (ret<<8) | *(addr++); -  ret = (ret<<8) | *(addr++); -  ret = (ret<<8) | *(addr++); +  ret = get_unaligned_be64(addr); +  addr += 8;    }    break;       case -128: -  ret = (((signed char *)addr)[0]<<24) | (addr[1]<<16) | -  (addr[2]<<8) | addr[3]; +  ret = (INT32)get_unaligned_be32(addr);    addr += 4;    break;      #ifdef PIKE_DEBUG    case 127:    Pike_fatal("get_small_number used on filename entry\n");   #endif    }    *q = (char *)addr;    return ret;