git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Correctness in ATA driver
[tpg/acess2.git]
/
Kernel
/
debug.c
diff --git
a/Kernel/debug.c
b/Kernel/debug.c
index
f71e889
..
4b3aeb7
100644
(file)
--- a/
Kernel/debug.c
+++ b/
Kernel/debug.c
@@
-90,6
+90,7
@@
void Debug_Fmt(const char *format, va_list *args)
char *p = NULL;
int isLongLong = 0;
Uint64 arg;
char *p = NULL;
int isLongLong = 0;
Uint64 arg;
+ int bPadLeft = 0;
while((c = *format++) != 0)
{
while((c = *format++) != 0)
{
@@
-119,6
+120,12
@@
void Debug_Fmt(const char *format, va_list *args)
// Get Argument
arg = va_arg(*args, Uint);
// Get Argument
arg = va_arg(*args, Uint);
+ // - Padding Side Flag
+ if(c == '+') {
+ bPadLeft = 1;
+ c = *format++;
+ }
+
// Padding
if(c == '0') {
pad = '0';
// Padding
if(c == '0') {
pad = '0';
@@
-175,6
+182,11
@@
void Debug_Fmt(const char *format, va_list *args)
itoa(p, arg, 2, minSize, pad);
goto printString;
itoa(p, arg, 2, minSize, pad);
goto printString;
+ printString:
+ if(!p) p = "(null)";
+ while(*p) Debug_Putchar(*p++);
+ break;
+
case 'B': //Boolean
if(arg) Debug_Puts("True");
else Debug_Puts("False");
case 'B': //Boolean
if(arg) Debug_Puts("True");
else Debug_Puts("False");
@@
-184,10
+196,9
@@
void Debug_Fmt(const char *format, va_list *args)
p = (char*)(Uint)arg;
if(!p) p = "(null)";
len = strlen(p);
p = (char*)(Uint)arg;
if(!p) p = "(null)";
len = strlen(p);
- while(len++ < minSize) Debug_Putchar(pad);
- printString:
- if(!p) p = "(null)";
+ if( !bPadLeft ) while(len++ < minSize) Debug_Putchar(pad);
while(*p) Debug_Putchar(*p++);
while(*p) Debug_Putchar(*p++);
+ if( bPadLeft ) while(len++ < minSize) Debug_Putchar(pad);
break;
// Single Character / Array
break;
// Single Character / Array
@@
-264,7
+275,7
@@
void Debug_SetKTerminal(char *File)
if(giDebug_KTerm != -1)
VFS_Close(giDebug_KTerm);
giDebug_KTerm = VFS_Open(File, VFS_OPENFLAG_WRITE);
if(giDebug_KTerm != -1)
VFS_Close(giDebug_KTerm);
giDebug_KTerm = VFS_Open(File, VFS_OPENFLAG_WRITE);
- Log
(
"Opened '%s' as 0x%x", File, giDebug_KTerm);
+ Log
_Log("Debug",
"Opened '%s' as 0x%x", File, giDebug_KTerm);
}
void Debug_Enter(char *FuncName, char *ArgTypes, ...)
}
void Debug_Enter(char *FuncName, char *ArgTypes, ...)
UCC
git Repository :: git.ucc.asn.au