Skip to content

Commit

Permalink
fix(printf): fix pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
towca authored and Marcin Kościelnicki committed Jul 2, 2018
1 parent 67f5205 commit 57750da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#define VGA_WRITE_START 0xffff8000000b8000ull
#define DEFAULT_FORCOLOR 0x0d
#define DEFAULT_BACKCOLOR 0x0f
#define DEFAULT_BACKCOLOR 0x07
#define WIDTH 80
#define HEIGHT 25

Expand Down Expand Up @@ -58,6 +58,7 @@ void clrscr(void) {
}
}
setcursor(0, 0);
cur_x = cur_y = 0;
}

void putc(uint8_t c) {
Expand Down Expand Up @@ -92,7 +93,7 @@ static void print_str(uint8_t* str) {
static void print_num(uint32_t num, uint8_t base) {
uint32_t tmp;
uint8_t i = 0;
uint8_t digits[8] = { 0 };
uint8_t digits[10] = { 0 };

if (!num) {
putc('0');
Expand All @@ -111,7 +112,7 @@ static void print_num(uint32_t num, uint8_t base) {
}
}

void printf(uint8_t* format, ...) {
void printf(const char* format, ...) {
va_list va;
va_start(va, format);
uint8_t c, b;
Expand Down
2 changes: 1 addition & 1 deletion stdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
void clrscr(void);
void setcursor(unsigned x, unsigned y);
void putc(uint8_t c);
void printf(uint8_t* format, ...);
void printf(const char* format, ...);

#endif

0 comments on commit 57750da

Please sign in to comment.