From 27c1427b4c5431b6b74a4ad253fdca420cb51522 Mon Sep 17 00:00:00 2001 From: Attila Kovacs Date: Thu, 2 Jan 2025 13:40:00 +0100 Subject: [PATCH] XField.value pointer type (char *) -> (void *) --- include/xchange.h | 2 +- src/xstruct.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/xchange.h b/include/xchange.h index 16297bf..1a2db54 100644 --- a/include/xchange.h +++ b/include/xchange.h @@ -139,7 +139,7 @@ typedef int boolean; ///< boolean TRUE/FALSE data type. typedef struct XField { char *name; ///< Pointer to a designated local name buffer. It may not contain a separator (see X_SEP). ///< NOTE: it should normally be dynamically allocated, to work with xClearField() / xDestroyField(). - char *value; ///< Pointer to designated local string content (or structure)... + void *value; ///< Pointer to designated local string content (or structure)... ///< NOTE: it should normally be dynamically allocated, to work with xClearField() / xDestroyField(). XType type; ///< The underlyng data type char *subtype; ///< (optional) Descriptive subtype, such a a mime type or encoding (if any). It is diff --git a/src/xstruct.c b/src/xstruct.c index 533ed4a..9bbc2c2 100644 --- a/src/xstruct.c +++ b/src/xstruct.c @@ -826,7 +826,7 @@ void *xGetElementAtIndex(const XField *f, int idx) { eSize = xElementSizeOf(f->type); if(eSize < 0) return x_trace_null(fn, NULL); - return f->value + idx * eSize; + return (char *) f->value + idx * eSize; } /**