Cleaned up some things
This commit is contained in:
parent
f6ea17d9e0
commit
fdcf18e988
|
@ -37,7 +37,7 @@ char *itoa(int i, char *str, int base)
|
|||
*str++ = '0';
|
||||
}
|
||||
|
||||
// compute digits... in reverse order (XXX?)
|
||||
// compute digits... in reverse order
|
||||
while (i > 0) {
|
||||
*str++ = digits[i % base];
|
||||
i /= base;
|
||||
|
|
|
@ -24,16 +24,13 @@ int sprintf(char *str, const char *fmt, ...)
|
|||
return ret;
|
||||
}
|
||||
|
||||
//
|
||||
// Format str according to fmt, using the va_list ap
|
||||
//
|
||||
int vsprintf(char *str, const char *fmt, va_list ap)
|
||||
{
|
||||
return vsnprintf(str, SIZE_T_MAX, fmt, ap);
|
||||
}
|
||||
|
||||
//
|
||||
// sprintf() but with a size limit: no more than n bytes are written in str
|
||||
// (v)sprintf() but with a size limit: no more than n bytes are written in str
|
||||
// XXX null termination behavior?
|
||||
//
|
||||
int snprintf(char *str, size_t n, const char *fmt, ...)
|
||||
|
@ -48,9 +45,6 @@ int snprintf(char *str, size_t n, const char *fmt, ...)
|
|||
return ret;
|
||||
}
|
||||
|
||||
//
|
||||
// snprintf() but arguments
|
||||
//
|
||||
int vsnprintf(char *str, size_t n, const char *fmt, va_list ap)
|
||||
{
|
||||
int ret = 0;
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
//----------------------------------------------------------------------------//
|
||||
// GNU GPL OS/K //
|
||||
// //
|
||||
// Authors: spectral` //
|
||||
// NeoX //
|
||||
// //
|
||||
// Desc: Memory allocation routines //
|
||||
// Only exists to trigger Neox //
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
#include "kernel/mm/malloc.h"
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
//----------------------------------------------------------------------------//
|
||||
// GNU GPL OS/K //
|
||||
// //
|
||||
// Authors: spectral` //
|
||||
// NeoX //
|
||||
// //
|
||||
// Desc: Memory allocation routines //
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
#ifndef _KALKERN_MM_MALLOC_H
|
||||
#define _KALKERN_MM_MALLOC_H
|
||||
|
||||
#include "common/common.h"
|
||||
|
||||
#endif
|
||||
|
|
@ -33,7 +33,6 @@ int main(int argc, char *argv[])
|
|||
#undef strcpy
|
||||
assert(strcmp(strcpy(test2, test1), _osk_strcpy(test3, test1)) == 0);
|
||||
|
||||
|
||||
// tests done
|
||||
printf("2\n");
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
// Desc: Project Tree //
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
// XXX *not* up to date
|
||||
|
||||
src/
|
||||
|
|
||||
+ boot/
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
make
|
||||
cp ../bin/bootloader.bin "~/Documents/GNU OSK/bin/bootloader.bin"
|
||||
qemu-system-x86_64 -hda "~/Documents/GNU OSK/bin/bootloader.bin"
|
||||
qemu-system-i386 -hda "~/Documents/GNU OSK/bin/bootloader.bin"
|
Loading…
Reference in New Issue