From: Ralph Boehme Date: Fri, 24 May 2019 15:50:52 +0000 (+0200) Subject: vfs_fruit: convert adouble accessor macros to functions X-Git-Tag: talloc-2.3.0~111 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c7bb524438afd08ed25e121ef2a8afd70777f2d4;p=thirdparty%2Fsamba.git vfs_fruit: convert adouble accessor macros to functions The functions will be moved to a different compilation unit in a subsequent commit and struct adouble will become a private struct so callers can't access it directly. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index 0be7f20e9af..dc44ebdfbca 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -367,12 +367,6 @@ typedef enum {ADOUBLE_META, ADOUBLE_RSRC} adouble_type_t; #define AD_XATTR_HDR_SIZE 36 #define AD_XATTR_MAX_HDR_SIZE 65536 -/* Accessor macros */ -#define ad_getentrylen(ad,eid) ((ad)->ad_eid[(eid)].ade_len) -#define ad_getentryoff(ad,eid) ((ad)->ad_eid[(eid)].ade_off) -#define ad_setentrylen(ad,eid,len) ((ad)->ad_eid[(eid)].ade_len = (len)) -#define ad_setentryoff(ad,eid,off) ((ad)->ad_eid[(eid)].ade_off = (off)) - /* * Both struct ad_xattr_header and struct ad_xattr_entry describe the in memory * representation as well as the on-disk format. @@ -538,6 +532,25 @@ static AfpInfo *afpinfo_new(TALLOC_CTX *ctx); static ssize_t afpinfo_pack(const AfpInfo *ai, char *buf); static AfpInfo *afpinfo_unpack(TALLOC_CTX *ctx, const void *data); +static size_t ad_getentrylen(const struct adouble *ad, int eid) +{ + return ad->ad_eid[eid].ade_len; +} + +static size_t ad_getentryoff(const struct adouble *ad, int eid) +{ + return ad->ad_eid[eid].ade_off; +} + +static size_t ad_setentrylen(struct adouble *ad, int eid, size_t len) +{ + return ad->ad_eid[eid].ade_len = len; +} + +static size_t ad_setentryoff(struct adouble *ad, int eid, size_t off) +{ + return ad->ad_eid[eid].ade_off = off; +} /** * Return a pointer to an AppleDouble entry