From: Erwin Janssen Date: Tue, 20 Sep 2016 11:09:17 +0000 (+0200) Subject: Removed redefinitions of `offsetof` X-Git-Tag: untagged-5fc0363bc76319758ff6~1^2^2~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b19d349f0591fca8a27147de55ce2515c0217931;p=graphviz Removed redefinitions of `offsetof` The `offsetof` macro is part of the ANSI C standard, so redefining it is not needed since it's always present. --- diff --git a/lib/cdt/cdt.h b/lib/cdt/cdt.h index 6dc99e5da..8156010cc 100644 --- a/lib/cdt/cdt.h +++ b/lib/cdt/cdt.h @@ -99,12 +99,6 @@ struct _dtdisc_s (dc)->comparf = (cmpf), (dc)->hashf = (hshf), \ (dc)->memoryf = (memf), (dc)->eventf = (evf) ) -#ifdef offsetof -#define DTOFFSET(struct_s, member) offsetof(struct_s, member) -#else -#define DTOFFSET(struct_s, member) ((int)(&((struct_s*)0)->member)) -#endif - /* the dictionary structure itself */ struct _dt_s { Dtsearch_f searchf;/* search function */ diff --git a/lib/cgraph/cghdr.h b/lib/cgraph/cghdr.h index 940337e34..84c728244 100644 --- a/lib/cgraph/cghdr.h +++ b/lib/cgraph/cghdr.h @@ -55,14 +55,6 @@ #ifndef streq #define streq(s,t) ((*s == *t) && !strcmp((s),(t))) #endif -#ifdef offsetof -#undef offsetof -#endif -#ifdef HAVE_INTPTR_T -#define offsetof(typ,fld) ((intptr_t)(&(((typ*)0)->fld))) -#else -#define offsetof(typ,fld) ((int)(&(((typ*)0)->fld))) -#endif #define NOTUSED(var) (void) var #define NILgraph NIL(Agraph_t*) diff --git a/lib/fdpgen/grid.c b/lib/fdpgen/grid.c index 2b3a937d5..639b3694b 100644 --- a/lib/fdpgen/grid.c +++ b/lib/fdpgen/grid.c @@ -94,11 +94,6 @@ static cell *getCell(Grid * g) return cp; } -#ifndef offsetof -#define offsetof(typ,fld) ((int)(&(((typ*)0)->fld))) -#endif - - static int ijcmpf(Dt_t * d, gridpt * p1, gridpt * p2, Dtdisc_t * disc) { int diff;