From d95b6765cd3550954fecba3d8ae1bc73792ac008 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Fri, 13 Jul 2012 12:52:11 +0800 Subject: [PATCH] DiskTool - Fixed debugging --- Tools/DiskTool/src/actions.c | 6 ++++-- Tools/DiskTool/src/include/acess.h | 1 + Tools/DiskTool/src/logging.c | 8 +++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Tools/DiskTool/src/actions.c b/Tools/DiskTool/src/actions.c index 51f5cd3f..6cbd7b85 100644 --- a/Tools/DiskTool/src/actions.c +++ b/Tools/DiskTool/src/actions.c @@ -60,8 +60,10 @@ int DiskTool_Copy(const char *Source, const char *Destination) char buf[1024]; size_t len, total = 0; - while( (len = VFS_Read(src, sizeof(buf), buf)) == sizeof(buf) ) - VFS_Write(dst, len, buf), total += len; + while( (len = VFS_Read(src, sizeof(buf), buf)) == sizeof(buf) ) { + VFS_Write(dst, len, buf); + total += len; + } VFS_Write(dst, len, buf), total += len; Log_Notice("DiskTool", "Copied %i from %s to %s", total, Source, Destination); diff --git a/Tools/DiskTool/src/include/acess.h b/Tools/DiskTool/src/include/acess.h index c63582d0..16009a48 100644 --- a/Tools/DiskTool/src/include/acess.h +++ b/Tools/DiskTool/src/include/acess.h @@ -54,6 +54,7 @@ typedef char tShortSpinlock; typedef int64_t tTime; extern tTime now(void); extern int64_t timestamp(int sec, int min, int hr, int day, int month, int year); +extern void format_date(tTime TS, int *year, int *month, int *day, int *hrs, int *mins, int *sec, int *ms); #define PACKED __attribute__((packed)) #define DEPRECATED diff --git a/Tools/DiskTool/src/logging.c b/Tools/DiskTool/src/logging.c index 3a0d9f1e..fde90552 100644 --- a/Tools/DiskTool/src/logging.c +++ b/Tools/DiskTool/src/logging.c @@ -174,9 +174,15 @@ void Debug_TraceLeave(const char *Function, char Type, ...) case 'i': fprintf(stderr, " %i", va_arg(args, int)); break; - case 'p': + case 'x': + fprintf(stderr, " 0x%x", va_arg(args, unsigned int)); + break; + case 's': fprintf(stderr, " \"%s\"", va_arg(args, const char *)); break; + case 'p': + fprintf(stderr, " %p", va_arg(args, const void *)); + break; default: fprintf(stderr, " ?"); break; -- 2.20.1