@@ -51,11 +51,11 @@ */ # define asprintf asprintf_ # define vasprintf vasprintf_ #endif -struct context { +struct Context { const char *format; size_t formatLen; char subformat[maxSubformatLen + 1]; size_t subformatLen; va_list arguments; @@ -146,11 +146,11 @@ return ret; } #endif static bool -appendString(struct context *ctx, const char *append, size_t appendLen) +appendString(struct Context *ctx, const char *append, size_t appendLen) { char *newBuf; if (appendLen == 0) return true; @@ -166,11 +166,11 @@ return true; } static bool -appendSubformat(struct context *ctx, const char *subformat, +appendSubformat(struct Context *ctx, const char *subformat, size_t subformatLen) { if (ctx->subformatLen + subformatLen > maxSubformatLen) return false; @@ -180,11 +180,11 @@ return true; } static bool -stringState(struct context *ctx) +stringState(struct Context *ctx) { if (ctx->format[ctx->i] == '%') { if (ctx->i > 0) if (!appendString(ctx, ctx->format + ctx->last, ctx->i - ctx->last)) @@ -199,11 +199,11 @@ return true; } static bool -formatFlagsState(struct context *ctx) +formatFlagsState(struct Context *ctx) { switch (ctx->format[ctx->i]) { case '-': case '+': case ' ': @@ -226,11 +226,11 @@ return true; } static bool -formatFieldWidthState(struct context *ctx) +formatFieldWidthState(struct Context *ctx) { if ((ctx->format[ctx->i] >= '0' && ctx->format[ctx->i] <= '9') || ctx->format[ctx->i] == '*' || ctx->format[ctx->i] == '.') { if (!appendSubformat(ctx, ctx->format + ctx->i, 1)) return false; @@ -241,11 +241,11 @@ return true; } static bool -formatLengthModifierState(struct context *ctx) +formatLengthModifierState(struct Context *ctx) { /* Only one allowed */ switch (ctx->format[ctx->i]) { case 'h': /* and also hh */ if (ctx->formatLen > ctx->i + 1 && @@ -371,11 +371,11 @@ ctx->state = stateFormatConversionSpecifier; return true; } static bool -formatConversionSpecifierState(struct context *ctx) +formatConversionSpecifierState(struct Context *ctx) { char *tmp = NULL; int tmpLen = 0; #ifndef HAVE_ASPRINTF_L OFString *point; @@ -729,11 +729,11 @@ ctx->state = stateString; return true; } -static bool (*states[])(struct context *) = { +static bool (*states[])(struct Context *) = { stringState, formatFlagsState, formatFieldWidthState, formatLengthModifierState, formatConversionSpecifierState @@ -740,11 +740,11 @@ }; int OFVASPrintF(char **string, const char *format, va_list arguments) { - struct context ctx; + struct Context ctx; ctx.format = format; ctx.formatLen = strlen(format); memset(ctx.subformat, 0, maxSubformatLen + 1); ctx.subformatLen = 0;