From 7ab760809478df17f45b61ec0428dd21245b72fb Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 17 Nov 2022 23:38:22 +0900 Subject: [PATCH] small cosmetic changes. I prefer `i++` style unless absolutely necessary. --- src/codedump.c | 4 ++-- src/debug.c | 6 +++--- src/error.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/codedump.c b/src/codedump.c index 751dd7ad0..35133ce77 100644 --- a/src/codedump.c +++ b/src/codedump.c @@ -102,7 +102,7 @@ codedump(mrb_state *mrb, const mrb_irep *irep) int i; int head = FALSE; - for (i = 1; i < irep->nlocals; ++i) { + for (i = 1; i < irep->nlocals; i++) { char const *s = mrb_sym_dump(mrb, irep->lv[i - 1]); if (s) { if (!head) { @@ -118,7 +118,7 @@ codedump(mrb_state *mrb, const mrb_irep *irep) int i = irep->clen; const struct mrb_irep_catch_handler *e = mrb_irep_catch_handler_table(irep); - for (; i > 0; i --, e ++) { + for (; i > 0; i--,e++) { uint32_t begin = mrb_irep_catch_handler_unpack(e->begin); uint32_t end = mrb_irep_catch_handler_unpack(e->end); uint32_t target = mrb_irep_catch_handler_unpack(e->target); diff --git a/src/debug.c b/src/debug.c index d0f5ab124..11af6fcfb 100644 --- a/src/debug.c +++ b/src/debug.c @@ -202,7 +202,7 @@ mrb_debug_info_append_file(mrb_state *mrb, mrb_irep_debug_info *d, size_t packed_size = 0; uint8_t *p, *pend; - for (i = 0; i < file_pc_count; ++i) { + for (i = 0; i < file_pc_count; i++) { if (lines[start_pos + i] == prev_line) continue; packed_size += mrb_packed_int_len(start_pos+i-prev_pc); prev_pc = start_pos+i; @@ -212,7 +212,7 @@ mrb_debug_info_append_file(mrb_state *mrb, mrb_irep_debug_info *d, f->lines.packed_map = p = (uint8_t*)mrb_malloc(mrb, packed_size); pend = p + packed_size; prev_line = 0; prev_pc = 0; - for (i = 0; i < file_pc_count; ++i) { + for (i = 0; i < file_pc_count; i++) { if (lines[start_pos + i] == prev_line) continue; p += mrb_packed_int_encode(start_pos+i-prev_pc, p, pend); prev_pc = start_pos + i; @@ -232,7 +232,7 @@ mrb_debug_info_free(mrb_state *mrb, mrb_irep_debug_info *d) if (!d) { return; } if (d->files) { - for (i = 0; i < d->flen; ++i) { + for (i = 0; i < d->flen; i++) { if (d->files[i]) { mrb_free(mrb, d->files[i]->lines.ptr); mrb_free(mrb, d->files[i]); diff --git a/src/error.c b/src/error.c index 8773f1347..1f2788729 100644 --- a/src/error.c +++ b/src/error.c @@ -278,7 +278,7 @@ mrb_vformat(mrb_state *mrb, const char *format, va_list ap) if (c == '%') { if (*p == '!') { inspect = TRUE; - ++p; + p++; } if (!*p) break; switch (*p) {