pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:2918: Inside #if defined(INT64)
   return va_arg(VA_LIST_DEREF(args), unsigned INT64);    case APPEND_WIDTH_LONG_LONG|APPEND_SIGNED:    return va_arg(VA_LIST_DEREF(args), INT64);   #endif /* INT64 */    }    Pike_fatal("string_builder_append_integerv(): Unsupported flags: 0x%04x\n",    flags);    return 0;   }    + /* Standard formats supported by string_builder_{v,}sprintf(): +  * +  * '%' Insert %. +  * 'a' Insert double. +  * 'c' Insert character. +  * 'd' Insert decimal integer. +  * 'e' Insert double. +  * 'f' Insert double. +  * 'g' Insert double. +  * 'o' Insert octal integer. +  * 's' Insert string. +  * 'u' Insert unsigned decimal integer. +  * 'x' Insert lower-case hexadecimal integer. +  * 'E' Insert double. +  * 'G' Insert double. +  * 'X' Insert upper-case hexadecimal integer. +  * +  * Format modifiers supported by string_builder_{v,}sprintf(): +  * +  * '+' Explicit sign for non-negative numeric values. +  * '-' Align left. +  * '0' Zero pad. +  * '0'..'9' Field width. +  * '.' Precision field width follows. +  * 'h' Half-width input. +  * 'l' Long(-er) input. +  * 't' Pointer-width input (ptrdiff_t). +  * 'w' Wide input (same as 'l', but only for strings). +  * 'z' Pointer-width input (size_t). +  * +  * Extended formats supported by string_builder_{v,}sprintf(): +  * +  * 'b' Insert binary integer. +  * 'O' Insert description of svalue. +  * 'S' Insert pike_string. +  * 'T' Insert pike_type. +  */ +    /* Values used internally in string_builder_vsprintf() */   #define STATE_MIN_WIDTH 1   #define STATE_PRECISION 2      PMOD_EXPORT void string_builder_vsprintf(struct string_builder *s,    const char *fmt,    va_list args)   {    while (*fmt) {    if (*fmt == '%') {
pike.git/src/stralloc.c:3129:    char nfmt[] = { '%', fmt[-1], 0 };       if (PIKE_ISNAN(val)) {    /* NaN */    string_builder_strcat(s, "nan");    break;    }    if (val < 0.0) {    string_builder_putchar(s, '-');    val = -val; -  } else if (flags & APPEND_SIGNED) { +  } else if (flags & APPEND_POSITIVE) {    string_builder_putchar(s, '+');    }    if ((val+val == val) && (val > 0.0)) {    /* Infinity */    string_builder_strcat(s, "inf");    break;    }    /* FIXME: Field lengths and precision. */    if ((bytes = snprintf(NULL, 0, nfmt, val))) {    p_wchar0 *p = string_builder_allocate(s, bytes, 0);