Mercurial > hg > dmlib
comparison tools/data2inc.c @ 2427:f07e3e66ca58
Cleanup.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 27 Jan 2020 09:40:06 +0200 |
parents | 1361e3883dd8 |
children | c6ee41fd98dd |
comparison
equal
deleted
inserted
replaced
2426:bb7264ddaefd | 2427:f07e3e66ca58 |
---|---|
207 } | 207 } |
208 | 208 |
209 | 209 |
210 static void dmPrintIndentation(FILE *fh) | 210 static void dmPrintIndentation(FILE *fh) |
211 { | 211 { |
212 int level; | |
213 const char *str; | |
214 | |
212 if (optIndentation < 0) | 215 if (optIndentation < 0) |
213 { | 216 { |
214 for (int i = 0; i < -optIndentation; i++) | 217 level = - optIndentation; |
215 fputs("\t", fh); | 218 str = "\t"; |
216 } | 219 } |
217 else | 220 else |
218 if (optIndentation > 0) | 221 { |
219 { | 222 level = optIndentation; |
220 for (int i = 0; i < optIndentation; i++) | 223 str = " "; |
221 fputs(" ", fh); | 224 } |
222 } | 225 |
226 for (int i = 0; i < level; i++) | |
227 fputs(str, fh); | |
223 } | 228 } |
224 | 229 |
225 | 230 |
226 static int dmHandleError(const int res) | 231 static int dmHandleError(const int res) |
227 { | 232 { |