pike.git / src / opcodes.c

version» Context lines:

pike.git/src/opcodes.c:19:   #include "pike_types.h"   #include "pike_memory.h"   #include "fd_control.h"   #include "cyclic.h"   #include "builtin_functions.h"   #include "module_support.h"   #include "security.h"   #include "bignum.h"   #include "operators.h"    - RCSID("$Id: opcodes.c,v 1.84 2000/08/13 19:34:34 grubba Exp $"); + RCSID("$Id: opcodes.c,v 1.85 2000/08/14 20:29:14 grubba Exp $");      void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind)   {    INT32 i;      #ifdef PIKE_SECURITY    if(what->type <= MAX_COMPLEX)    if(!CHECK_DATA_SECURITY(what->u.array, SECURITY_BIT_INDEX))    error("Index permission denied.\n");   #endif
pike.git/src/opcodes.c:659:      /* FIXME:    * This implementation will break in certain cases, especially cases    * like this [\1000-\1002\1001] (ie, there is a single character which    * is also a part of a range    * /Hubbe    */         #define MKREADSET(SIZE) \ - static int PIKE_CONCAT(read_set,SIZE) ( \ + static ptrdiff_t PIKE_CONCAT(read_set,SIZE) ( \    PIKE_CONCAT(p_wchar,SIZE) *match, \ -  int cnt, \ +  ptrdiff_t cnt, \    struct sscanf_set *set, \ -  int match_len) \ +  ptrdiff_t match_len) \   { \ -  unsigned long e,last=0; \ +  size_t e, last = 0; \    CHAROPT( int set_size=0; ) \    \    if(cnt>=match_len) \    error("Error in sscanf format string.\n"); \    \    MEMSET(set->c, 0, sizeof(set->c)); \    set->a=0; \    \    if(match[cnt]=='^') \    { \
pike.git/src/opcodes.c:710:    if(match[cnt]==']') \    { \    set->c['-']=1; \    break; \    } \    \    if(last >= match[cnt]) \    error("Error in sscanf format string.\n"); \    \   CHAROPT( \ -  if(last < (unsigned long)sizeof(set->c)) \ +  if(last < (size_t)sizeof(set->c)) \    { \ -  if(match[cnt] < (unsigned long)sizeof(set->c)) \ +  if(match[cnt] < (size_t)sizeof(set->c)) \    { \   ) \    for(e=last;e<=match[cnt];e++) set->c[e]=1; \   CHAROPT( \    }else{ \ -  for(e=last;e<(unsigned long)sizeof(set->c);e++) \ +  for(e=last;e<(size_t)sizeof(set->c);e++) \    set->c[e]=1; \    \    check_stack(2); \    push_int(256); \    push_int(match[cnt]); \    set_size++; \    } \    } \    else \    { \    sp[-1].u.integer=match[cnt]; \    } \   ) \    continue; \    } \    last=match[cnt]; \ -  if(last < (unsigned long)sizeof(set->c)) \ +  if(last < (size_t)sizeof(set->c)) \    set->c[last]=1; \   CHAROPT( \    else{ \    if(set_size && \ -  ((unsigned long)sp[-1].u.integer) == last-1) \ +  ((size_t)sp[-1].u.integer) == last-1) \    { \    sp[-1].u.integer++; \    }else{ \    check_stack(2); \    push_int(last); \    push_int(last); \    set_size++; \    } \    } \   ) \    } \    \   CHAROPT( \    if(set_size) \    { \    INT32 *order; \    set->a=aggregate_array(set_size*2); \    order=get_switch_order(set->a); \ -  for(e=0;e<(unsigned long)set->a->size;e+=2) \ +  for(e=0;e<(size_t)set->a->size;e+=2) \    { \    if(order[e]+1 != order[e+1]) \    { \    free_array(set->a); \    set->a=0; \    free((char *)order); \    error("Overlapping ranges in sscanf not supported.\n"); \    } \    } \    \
pike.git/src/opcodes.c:933:    do { \    double d; \    ((char *)&d)[0] = *((INPUT)); \    ((char *)&d)[1] = *((INPUT)+1); \    ((char *)&d)[2] = *((INPUT)+2); \    ((char *)&d)[3] = *((INPUT)+3); \    ((char *)&d)[4] = *((INPUT)+4); \    ((char *)&d)[5] = *((INPUT)+5); \    ((char *)&d)[6] = *((INPUT)+6); \    ((char *)&d)[7] = *((INPUT)+7); \ -  (SVAL).u.float_number = (float)d; \ +  (SVAL).u.float_number = (FLOAT_TYPE)d; \    } while(0)   #else   #ifdef DOUBLE_IS_IEEE_LITTLE   #define EXTRACT_DOUBLE(SVAL, INPUT, SHIFT) \    do { \    double d; \    ((char *)&d)[7] = *((INPUT)); \    ((char *)&d)[6] = *((INPUT)+1); \    ((char *)&d)[5] = *((INPUT)+2); \    ((char *)&d)[4] = *((INPUT)+3); \    ((char *)&d)[3] = *((INPUT)+4); \    ((char *)&d)[2] = *((INPUT)+5); \    ((char *)&d)[1] = *((INPUT)+6); \    ((char *)&d)[0] = *((INPUT)+7); \ -  (SVAL).u.float_number = (float)d; \ +  (SVAL).u.float_number = (FLOAT_TYPE)d; \    } while(0)   #else   #define EXTRACT_DOUBLE(SVAL, INPUT, SHIFT) \    do { \    char x[8]; \    x[0] = (INPUT)[0]; \    x[1] = (INPUT)[1]; \    x[2] = (INPUT)[2]; \    x[3] = (INPUT)[3]; \    x[4] = (INPUT)[4]; \
pike.git/src/opcodes.c:978:   static INT32 PIKE_CONCAT4(very_low_sscanf_,INPUT_SHIFT,_,MATCH_SHIFT)( \    PIKE_CONCAT(p_wchar, INPUT_SHIFT) *input, \    ptrdiff_t input_len, \    PIKE_CONCAT(p_wchar, MATCH_SHIFT) *match, \    ptrdiff_t match_len, \    ptrdiff_t *chars_matched, \    int *success) \   { \    struct svalue sval; \    INT32 matches, arg; \ -  ptrdiff_t cnt, eye, e; \ -  int no_assign = 0, field_length = 0, minus_flag = 0; \ +  ptrdiff_t cnt, eye, e, field_length = 0; \ +  int no_assign = 0, minus_flag = 0; \    struct sscanf_set set; \    struct svalue *argp; \    \    \    set.a = 0; \    success[0] = 0; \    \    eye = arg = matches = 0; \    \    for(cnt = 0; cnt < match_len; cnt++) \