From a830ea76270b7894a03922a172d58bfaefbc827f Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Tue, 1 Mar 2016 06:45:41 +1100 Subject: * Support *n conversion in stream_format/string_format * Make stream_format return characters printed * Add iostreams with std::vector storage * Move to type-safe templates for logerror and popmessage * Remove now-unnecessary I64FMT from calls to logerror/popmessage * Put some lib/util stuff in util:: namespace * Some fixes to Japanese translation --- src/tools/src2html.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/tools/src2html.cpp') diff --git a/src/tools/src2html.cpp b/src/tools/src2html.cpp index a93d7de73b8..557313f1b3e 100644 --- a/src/tools/src2html.cpp +++ b/src/tools/src2html.cpp @@ -549,7 +549,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, std::stri { // start with the line number dstline.str(""); - stream_format(dstline, "%5d  ", linenum++); + util::stream_format(dstline, "%5d  ", linenum++); // iterate over characters in the source line bool escape = false; @@ -569,7 +569,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, std::stri { if (!in_comment && ch == comment_start[0] && strncmp(srcptr - 1, comment_start, strlen(comment_start)) == 0) { - stream_format(dstline, "%s", comment_start_esc); + util::stream_format(dstline, "%s", comment_start_esc); curcol += strlen(comment_start); srcptr += strlen(comment_start) - 1; ch = 0; @@ -577,7 +577,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, std::stri } else if (in_comment && ch == comment_end[0] && strncmp(srcptr - 1, comment_end, strlen(comment_end)) == 0) { - stream_format(dstline, "%s", comment_end_esc); + util::stream_format(dstline, "%s", comment_end_esc); curcol += strlen(comment_end); srcptr += strlen(comment_end) - 1; ch = 0; @@ -588,7 +588,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, std::stri // track whether or not we are within an inline (C++-style) comment if (!in_quotes && !in_comment && !in_inline_comment && ch == comment_inline[0] && strncmp(srcptr - 1, comment_inline, strlen(comment_inline)) == 0) { - stream_format(dstline, "%s", comment_inline_esc); + util::stream_format(dstline, "%s", comment_inline_esc); curcol += strlen(comment_inline); srcptr += strlen(comment_inline) - 1; ch = 0; @@ -612,7 +612,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, std::stri for (curtoken = token_table; curtoken->token != nullptr; curtoken++) if (strncmp(srcptr - 1, curtoken->token, toklength) == 0 && strlen(curtoken->token) == toklength) { - stream_format(dstline, "%s", curtoken->color, curtoken->token); + util::stream_format(dstline, "%s", curtoken->color, curtoken->token); curcol += strlen(curtoken->token); srcptr += strlen(curtoken->token) - 1; ch = 0; @@ -644,7 +644,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, std::stri if (!in_comment && !in_inline_comment && !in_quotes && (ch == '"' || ch == '\'')) { if (color_quotes) - stream_format(dstline, "%c", ch); + util::stream_format(dstline, "%c", ch); else dstline.put(ch); in_quotes = true; @@ -660,7 +660,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, std::stri std::string target; if (find_include_file(target, srcrootlen, dstrootlen, srcfile, dstfile, filename)) { - stream_format(dstline, "", target.c_str()); + util::stream_format(dstline, "", target.c_str()); quotes_are_linked = true; } } @@ -673,7 +673,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, std::stri if (quotes_are_linked) dstline << ""; if (color_quotes) - stream_format(dstline, "%c", ch); + util::stream_format(dstline, "%c", ch); else dstline.put(ch); in_quotes = false; -- cgit v1.2.3-70-g09d2