pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: stralloc.c,v 1.177 2004/11/06 15:28:49 grubba Exp $ + || $Id: stralloc.c,v 1.178 2004/11/06 15:33:17 grubba Exp $   */      #include "global.h"   #include "stralloc.h"   #include "pike_macros.h"   #include "dynamic_buffer.h"   #include "pike_macros.h"   #include "pike_memory.h"   #include "pike_error.h"   #include "gc.h"
pike.git/src/stralloc.c:2317:    size_t min_width = 0;    size_t precision = 0;    int state = 0;       fmt++;    while (1) {    switch (*(fmt++)) {    case '%':    string_builder_putchar(s, '%');    break; +     case '+':    flags |= APPEND_POSITIVE; -  break; +  continue;    case '-':    flags |= APPEND_LEFT; -  break; +  continue;       case '0':    if (!state) {    flags |= APPEND_ZERO_PAD;    }    /* FALL_THROUGH */    case '1': case '2': case '3':    case '4': case '5': case '6':    case '7': case '8': case '9':    if (state = STATE_PRECISION) {    precision = precision * 10 + fmt[-1] - '0';    } else {    state = STATE_MIN_WIDTH;    min_width = min_width * 10 + fmt[-1] - '0';    } -  break; +  continue;    case '.':    state = STATE_PRECISION; -  break; +  continue;       case 'O':    {    /* FIXME: Doesn't care about field widths yet. */    dynamic_buffer old_buf;    init_buf(&old_buf);    describe_svalue(va_arg(args, struct svalue *), 0, NULL);    string_builder_binary_strcat(s, pike_global_buffer.s.str,    pike_global_buffer.s.len);    toss_buffer(&pike_global_buffer);