aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-12-31 11:48:42 -0500
committerDavid Robillard <d@drobilla.net>2019-04-13 19:48:23 +0200
commit56ce0b02736a455abfc3ea7cb8671e9068c2c4bc (patch)
tree019d17caad6d2665858b137d8fa53869166ec631
parentb30f33eee72c8900228d4406eecce0b404b6e827 (diff)
downloadserd-56ce0b02736a455abfc3ea7cb8671e9068c2c4bc.tar.gz
serd-56ce0b02736a455abfc3ea7cb8671e9068c2c4bc.tar.bz2
serd-56ce0b02736a455abfc3ea7cb8671e9068c2c4bc.zip
Fix implicit signed conversions for writer indent
-rw-r--r--src/writer.c6
1 files 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);