Skip to content

Commit

Permalink
Fix indentation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
hf committed Feb 12, 2020
1 parent d5d90a1 commit b97673e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
18 changes: 9 additions & 9 deletions src-input/duk_bi_symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ DUK_INTERNAL duk_ret_t duk_bi_symbol_constructor_shared(duk_hthread *thr) {
duk_uint8_t *buf;
duk_uint8_t *p;
duk_int_t magic;
duk_int_t flen;
duk_int_t flen;

magic = duk_get_current_magic(thr);
if (duk_is_undefined(thr, 0) && (magic == 0)) {
Expand Down Expand Up @@ -63,16 +63,16 @@ DUK_INTERNAL duk_ret_t duk_bi_symbol_constructor_shared(duk_hthread *thr) {
thr->heap->sym_counter[1]++;
}

flen = DUK_SNPRINTF((char *) p,
1 + 17 + 1, /* B || format || C for NUL */
"\xFF" "%lx-%lx",
(unsigned long) thr->heap->sym_counter[1],
(unsigned long) thr->heap->sym_counter[0]);
flen = DUK_SNPRINTF((char *) p,
1 + 17 + 1, /* B || format || C for NUL */
"\xFF" "%lx-%lx",
(unsigned long) thr->heap->sym_counter[1],
(unsigned long) thr->heap->sym_counter[0]);

/* make sure that we had enough room to format the symbol */
DUK_ASSERT(flen > 0 && flen <= 1 + 17 /* without + 1 for NUL */);
/* make sure that we had enough room to format the symbol */
DUK_ASSERT(flen > 0 && flen <= 1 + 17 /* without + 1 for NUL */);

p += flen;
p += flen;

if (desc == NULL) {
/* Special case for 'undefined' description, trailing
Expand Down
42 changes: 21 additions & 21 deletions src-input/duk_numconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,35 +95,35 @@ DUK_LOCAL void duk__bi_print(const char *name, duk__bigint *x) {

/* No NUL term checks in this debug code. */
flen = DUK_SNPRINTF(p, 64, "%p n=%ld", (void *) x, (long) x->n);
if (flen > 63) {
p += 63;
} else if (flen > 0) {
p += flen;
}
if (flen > 63) {
p += 63;
} else if (flen > 0) {
p += flen;
}

if (x->n == 0) {
DUK_ASSERT(p - buf < sizeof(buf));
DUK_ASSERT(p - buf < sizeof(buf));

flen = DUK_SNPRINTF(p, 3, " 0");
if (flen > 2) {
p += 2;
} else if (flen > 0) {
p += flen;
}
if (flen > 2) {
p += 2;
} else if (flen > 0) {
p += flen;
}
}
for (i = x->n - 1; i >= 0; i--) {
DUK_ASSERT(p - buf < sizeof(buf));

flen = DUK_SNPRINTF(p, 10, " %08lx", (unsigned long) x->v[i]);
if (flen > 9) {
p += 9;
} else if (flen > 0) {
p += flen;
}
DUK_ASSERT(p - buf < sizeof(buf));

flen = DUK_SNPRINTF(p, 10, " %08lx", (unsigned long) x->v[i]);
if (flen > 9) {
p += 9;
} else if (flen > 0) {
p += flen;
}
}

*p = 0; /* finally, NUL terminate buf regardless of snprintf */
DUK_ASSERT(p - buf < sizeof(buf));
*p = 0; /* finally, NUL terminate buf regardless of snprintf */
DUK_ASSERT(p - buf < sizeof(buf));

DUK_DDD(DUK_DDDPRINT("%s: %s", (const char *) name, (const char *) buf));
}
Expand Down

0 comments on commit b97673e

Please sign in to comment.