From 7c6d02c056a552b3e982e32e8968a66ab9069342 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Fri, 28 Aug 2015 15:09:35 +0100 Subject: [PATCH] Pass signed integer to 'std::setw' to avoid [-Wsign-conversion] warning. --- re2c/src/codegen/output.cc | 5 +++-- re2c/src/codegen/output.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/re2c/src/codegen/output.cc b/re2c/src/codegen/output.cc index 91112f4f..e7e78f4f 100644 --- a/re2c/src/codegen/output.cc +++ b/re2c/src/codegen/output.cc @@ -111,9 +111,10 @@ void OutputFile::write_range (uint32_t l, uint32_t u) printSpan (stream (), l, u); } -void OutputFile::write_uint32_t_width (uint32_t n, uint32_t w) +void OutputFile::write_uint32_t_width (uint32_t n, int w) { - stream () << std::setw (w) << n; + stream () << std::setw (w); + stream () << n; } void OutputFile::write_line_info (uint32_t l, const char * fn) diff --git a/re2c/src/codegen/output.h b/re2c/src/codegen/output.h index 503a24e0..85d79782 100644 --- a/re2c/src/codegen/output.h +++ b/re2c/src/codegen/output.h @@ -74,7 +74,7 @@ public: void write_hex (uint32_t n); void write_char_hex (uint32_t n); void write_range (uint32_t u, uint32_t l); - void write_uint32_t_width (uint32_t n, uint32_t w); + void write_uint32_t_width (uint32_t n, int w); void write_line_info (uint32_t l, const char * fn); void write_version_time (); void write_user_start_label (); -- 2.40.0