From: John Hodge Date: Fri, 13 Jul 2012 04:52:11 +0000 (+0800) Subject: DiskTool - Fixed debugging X-Git-Tag: rel0.15~611^2~41^2~10 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=d95b6765cd3550954fecba3d8ae1bc73792ac008;p=tpg%2Facess2.git DiskTool - Fixed debugging --- 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;