Skip to content

Commit 26c34ef

Browse files
jservG36maid
authored andcommitted
Ensure consistent indention
1 parent 94fa172 commit 26c34ef

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

kernel/error.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ static const struct error_code error_desc[] = {
3636
{ERR_UNKNOWN, "unknown error"},
3737
};
3838

39+
3940
const struct error_code *const perror = error_desc;

lib/libc.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -463,15 +463,16 @@ int32_t strtol(const char *s, char **end, int32_t base)
463463
}
464464

465465
/* Base-10 string conversion without division or multiplication */
466-
static char* __str_base10(uint32_t value, char* buffer, int* length)
466+
static char *__str_base10(uint32_t value, char *buffer, int *length)
467467
{
468468
if (value == 0) {
469469
buffer[0] = '0';
470470
*length = 1;
471471
return buffer;
472472
}
473473

474-
char temp[12]; /* Max digits for 32-bit: 4,294,967,295 (10 digits) + sign + null */
474+
/* Max digits for 32-bit: 4,294,967,295 (10 digits) + sign + null */
475+
char tmp[12];
475476
int pos = 0;
476477

477478
while (value > 0) {
@@ -487,29 +488,29 @@ static char* __str_base10(uint32_t value, char* buffer, int* length)
487488
q += t;
488489
r -= (((t << 2) + t) << 1);
489490

490-
temp[pos++] = '0' + r;
491+
tmp[pos++] = '0' + r;
491492
value = q;
492493
}
493494

494495
/* Reverse digits into output buffer */
495496
*length = pos;
496497
for (int i = 0; i < pos; i++) {
497-
buffer[i] = temp[pos - 1 - i];
498+
buffer[i] = tmp[pos - 1 - i];
498499
}
499500

500501
return buffer;
501502
}
502503

503504
/* Handle signed integers */
504-
static char* __str_base10_signed(int32_t value, char* buffer, int* length) {
505+
static char *__str_base10_signed(int32_t value, char *buffer, int *length)
506+
{
505507
if (value < 0) {
506508
buffer[0] = '-';
507-
__str_base10((uint32_t)(-value), buffer + 1, length);
509+
__str_base10((uint32_t) (-value), buffer + 1, length);
508510
(*length)++;
509511
return buffer;
510-
} else {
511-
return __str_base10((uint32_t)value, buffer, length);
512512
}
513+
return __str_base10((uint32_t) value, buffer, length);
513514
}
514515

515516
/* Converts string @s to an integer. */

0 commit comments

Comments
 (0)