pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:2743:    if (buf->s->len > max_len) {    buf->s->len = old_len;    return i;    }    old_len = buf->s->len;    }    return i;   }      PMOD_EXPORT void string_builder_append_integer(struct string_builder *s, -  LONGEST val, +  INT64 val,    unsigned int base,    int flags,    size_t min_width,    size_t precision)   { -  unsigned LONGEST tmp; +  unsigned INT64 tmp;    size_t len = 1;    const char *numbers = "0123456789abcdef";    if ((base < 2) || (base > 16)) {    Pike_fatal("string_builder_append_int(): Unsupported base %u.\n", base);    }    if (flags & APPEND_UPPER_CASE) {    numbers = "0123456789ABCDEF";    }    if ((flags & APPEND_SIGNED) && (val < 0)) {    string_builder_putchar(s, '-');
pike.git/src/stralloc.c:2842:    for(delta = 1; (base>>delta) > 1; delta++)    ;       mask = (1<<delta)-1; /* Usually base-1. */       /* Precision is minimum number of digits. */    if (precision) shift = (len = precision) * delta;    else shift = delta;       /* Calculate actual number of digits and initial shift. */ -  for (; shift < SIZEOF_LONGEST * 8 && tmp >> shift; shift += delta, len++) +  for (; shift < SIZEOF_INT64 * 8 && tmp >> shift; shift += delta, len++)    ;       if ((len < min_width) && !(flags & APPEND_LEFT)) {    /* Perform padding.    * Note that APPEND_ZERO_PAD can not be active here, since    * len is at least min_width in that case.    */    string_builder_fill(s, min_width - len, MKPCHARP(" ", 0),    4, 0);    min_width = 0;
pike.git/src/stralloc.c:2883:   #ifdef VA_LIST_IS_STATE_PTR   #define VA_LIST_PTR va_list   #define VA_LIST_ADDR(X) (X)   #define VA_LIST_DEREF(X) (X)   #else   #define VA_LIST_PTR va_list *   #define VA_LIST_ADDR(X) (&(X))   #define VA_LIST_DEREF(X) (*(X))   #endif    - static LONGEST pike_va_int(VA_LIST_PTR args, int flags) + static INT64 pike_va_int(VA_LIST_PTR args, int flags)   {    switch (flags & (APPEND_WIDTH_MASK|APPEND_SIGNED)) {    case APPEND_WIDTH_HALF:    return va_arg(VA_LIST_DEREF(args), unsigned int) & 0xffff;    case APPEND_WIDTH_HALF|APPEND_SIGNED:    return (short)va_arg(VA_LIST_DEREF(args), int);    case 0:    return va_arg(VA_LIST_DEREF(args), unsigned int);    case APPEND_SIGNED:    return va_arg(VA_LIST_DEREF(args), int);