From 0b9c0acd1c871eaf301ad1119493043ef632a996 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 10 Nov 2024 14:48:20 -0800 Subject: ScrollByL: move from XtOffset to XtOffsetOf Clears 13 warnings from clang 13 of the form: ScrollByL.c:67:6: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction] CoreOffset(width), XtRImmediate, (caddr_t) 500}, ^~~~~~~~~~~~~~~~~ ScrollByL.c:63:27: note: expanded from macro 'CoreOffset' #define CoreOffset(field) XtOffset(ScrollByLineWidget, core.field) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Alan Coopersmith Part-of: --- ScrollByL.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ScrollByL.c b/ScrollByL.c index 18eba96..d52c4ad 100644 --- a/ScrollByL.c +++ b/ScrollByL.c @@ -59,8 +59,8 @@ static char defaultTranslations[] = * ****************************************************************/ -#define Offset(field) XtOffset(ScrollByLineWidget, scroll.field) -#define CoreOffset(field) XtOffset(ScrollByLineWidget, core.field) +#define Offset(field) XtOffsetOf(ScrollByLineRec, scroll.field) +#define CoreOffset(field) XtOffsetOf(ScrollByLineRec, core.field) static XtResource resources[] = { {XtNwidth, XtCWidth, XtRDimension, sizeof(Dimension), -- cgit v1.2.3