diff options
author | David Robillard <d@drobilla.net> | 2018-12-31 11:48:42 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-01-05 17:12:38 +0100 |
commit | e7f88b4e0e3a88ff79a956b67590cb2b0c4fd16b (patch) | |
tree | d965e7117fbc6a0091e1070da5b6ef0f6b90b3cf /src/writer.c | |
parent | 31b57fdf337fc906151bb597a0e6ceede374620b (diff) | |
download | serd-e7f88b4e0e3a88ff79a956b67590cb2b0c4fd16b.tar.gz serd-e7f88b4e0e3a88ff79a956b67590cb2b0c4fd16b.tar.bz2 serd-e7f88b4e0e3a88ff79a956b67590cb2b0c4fd16b.zip |
Fix implicit signed conversions for writer indent
Diffstat (limited to 'src/writer.c')
-rw-r--r-- | src/writer.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/writer.c b/src/writer.c index ad9d3ccc..6e3f5d7e 100644 --- a/src/writer.c +++ b/src/writer.c @@ -112,7 +112,7 @@ struct SerdWriterImpl { SerdMessageSink msg_sink; void* msg_handle; WriteContext context; - unsigned indent; + int indent; char* bprefix; size_t bprefix_len; Sep last_sep; @@ -381,7 +381,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); } } @@ -393,7 +393,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); |