pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:2092:    prototype;    {}       static void fill_int_buffer()    {    push_int(8);    apply_current(f_RandomInterface_random_string_fun_num, 1);    if( TYPEOF(Pike_sp[-1]) != T_STRING ||    Pike_sp[-1].u.string->len != 8 )    Pike_error("Illegal return value from random_string.\n"); + #if PIKE_BYTEORDER == 1234 +  /* Little endian. */    THIS->int_buffer = ((INT64 *)Pike_sp[-1].u.string->str)[0]; -  + #else +  /* Big endian. */ +  for (int i = 0; i < 8; i++) { +  ((p_wchar0 *)&THIS->int_buffer)[i] = STR0(Pike_sp[-1].u.string)[7-i]; +  } + #endif    THIS->buffer_bits = 64;    pop_stack();    }       static INT_TYPE read_int(INT_TYPE limit)    {    if(limit <= 1) return 0;    int bits = my_log2(limit-1)+1;    INT64 mask = (1L<<bits)-1;    for(int i=0; i<1000; i++)