From 5da40cbf6daae35ad4948476bac7827f81ee7904 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 21 Dec 2010 11:35:28 +0100 Subject: Correct size scaling functions --- nios2sim-ng.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/nios2sim-ng.h b/nios2sim-ng.h index 9be1d0d..40cb2dd 100644 --- a/nios2sim-ng.h +++ b/nios2sim-ng.h @@ -26,15 +26,17 @@ extern bool verbose; do { if (verbose) fprintf(stdout, fmt, ##args); } while (0) #ifdef DEBUG # define dbg(fmt, args...) fprintf(stdout, fmt, ##args) +# define trace(fmt, args...) dbg("%s: " fmt, __func__, ##args) #else # define dbg(fmt, args...) +# define trace(fmt, args...) #endif static inline size_t size_scale(size_t size) { - if (size > 1024 * 1024) + if (size >= 1024 * 1024) size /= 1024 * 1024; - else if (size > 1024) + else if (size >= 1024) size /= 1024; return size; @@ -44,9 +46,9 @@ static inline char *size_postfix(size_t size) { char *ret = ""; - if (size > 1024 * 1024) + if (size >= 1024 * 1024) ret = "M"; - else if (size > 1024) + else if (size >= 1024) ret = "K"; return ret; -- cgit v1.2.3-54-g00ecf option value='master'>master net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
path: root/Documentation
ModeNameSize