From 56ce0b02736a455abfc3ea7cb8671e9068c2c4bc Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 31 Dec 2018 11:48:42 -0500 Subject: Fix implicit signed conversions for writer indent --- src/writer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/writer.c b/src/writer.c index 8000e85a..b596638e 100644 --- a/src/writer.c +++ b/src/writer.c @@ -113,7 +113,7 @@ struct SerdWriterImpl { SerdMessageFunc msg_func; void* msg_handle; WriteContext context; - unsigned indent; + int indent; char* bprefix; size_t bprefix_len; Sep last_sep; @@ -382,7 +382,7 @@ static void write_newline(SerdWriter* writer) { sink("\n", 1, writer); - for (unsigned i = 0; i < writer->indent; ++i) { + for (int i = 0; i < writer->indent; ++i) { sink("\t", 1, writer); } } @@ -394,7 +394,7 @@ write_sep(SerdWriter* writer, const Sep sep) // Adjust indent, but tolerate if it would become negative writer->indent = - ((rule->indent >= 0 || writer->indent >= (unsigned)-rule->indent) + ((rule->indent >= 0 || writer->indent >= -rule->indent) ? writer->indent + rule->indent : 0); -- cgit v1.2.1