From 7ab0915a6c8bab76273085ac563102e7ef8a6756 Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Sat, 31 Oct 2020 20:08:44 +0100 Subject: [PATCH] Remove unnecessary trailing semicolon on macros --- Object.h | 2 +- RichString.h | 6 +++--- linux/LinuxProcessList.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Object.h b/Object.h index caa3e919..05a9a72d 100644 --- a/Object.h +++ b/Object.h @@ -33,7 +33,7 @@ typedef void(*Object_Delete)(Object*); #define Class(class_) ((const ObjectClass*)(&(class_ ## _class))) -#define AllocThis(class_) (class_*) xMalloc(sizeof(class_)); Object_setClass(this, Class(class_)); +#define AllocThis(class_) (class_*) xMalloc(sizeof(class_)); Object_setClass(this, Class(class_)) typedef struct ObjectClass_ { const void* const extends; diff --git a/RichString.h b/RichString.h index aab2d891..3fb85279 100644 --- a/RichString.h +++ b/RichString.h @@ -15,9 +15,9 @@ in the source distribution for its full text. #define RichString_size(this) ((this)->chlen) #define RichString_sizeVal(this) ((this).chlen) -#define RichString_begin(this) RichString (this); RichString_beginAllocated(this); -#define RichString_beginAllocated(this) memset(&(this), 0, sizeof(RichString)); (this).chptr = (this).chstr; -#define RichString_end(this) RichString_prune(&(this)); +#define RichString_begin(this) RichString (this); RichString_beginAllocated(this) +#define RichString_beginAllocated(this) memset(&(this), 0, sizeof(RichString)); (this).chptr = (this).chstr +#define RichString_end(this) RichString_prune(&(this)) #ifdef HAVE_LIBNCURSESW #define RichString_printVal(this, y, x) mvadd_wchstr(y, x, (this).chptr) diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index 5e06e8c9..d40249fc 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -778,8 +778,8 @@ static int handleNetlinkMsg(struct nl_msg *nlmsg, void *linuxProcess) { assert(lp->super.pid == (pid_t)stats.ac_pid); timeDelta = (stats.ac_etime*1000 - lp->delay_read_time); - #define BOUNDS(x) isnan(x) ? 0.0 : ((x) > 100) ? 100.0 : (x); - #define DELTAPERC(x,y) BOUNDS((float) ((x) - (y)) / timeDelta * 100); + #define BOUNDS(x) isnan(x) ? 0.0 : ((x) > 100) ? 100.0 : (x) + #define DELTAPERC(x,y) BOUNDS((float) ((x) - (y)) / timeDelta * 100) lp->cpu_delay_percent = DELTAPERC(stats.cpu_delay_total, lp->cpu_delay_total); lp->blkio_delay_percent = DELTAPERC(stats.blkio_delay_total, lp->blkio_delay_total); lp->swapin_delay_percent = DELTAPERC(stats.swapin_delay_total, lp->swapin_delay_total);