From 3095a03ec3cb1f05b49362327d10a767299d7635 Mon Sep 17 00:00:00 2001 From: marha Date: Tue, 1 Jul 2014 14:23:00 +0200 Subject: Synchronised files and solved compilaton errors --- mesalib/src/mesa/drivers/dri/common/xmlconfig.c | 23 +++++++++++++++++++++++ mesalib/src/mesa/drivers/dri/common/xmlconfig.h | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) (limited to 'mesalib/src/mesa') diff --git a/mesalib/src/mesa/drivers/dri/common/xmlconfig.c b/mesalib/src/mesa/drivers/dri/common/xmlconfig.c index 2faaeba17..2639202c4 100644 --- a/mesalib/src/mesa/drivers/dri/common/xmlconfig.c +++ b/mesalib/src/mesa/drivers/dri/common/xmlconfig.c @@ -288,6 +288,29 @@ static float strToF (const XML_Char *string, const XML_Char **tail) { return result; } +#if !defined(HAVE_STRNDUP) + +/* Emulates glibc's strndup() */ +char * +strndup(const char *str, size_t size) +{ + size_t len; + char *result = (char *)NULL; + + if ((char *)NULL == str) return (char *)NULL; + + len = strlen(str); + if (!len) return strdup(""); + if (size > len) size = len; + + result = (char *)malloc((size + 1) * sizeof (char)); + memcpy(result, str, size); + result[size] = 0x0; + return result; +} + +#endif /* _WIN32 should be !HAVE_STRNDUP */ + /** \brief Parse a value of a given type. */ static bool parseValue (driOptionValue *v, driOptionType type, const XML_Char *string) { diff --git a/mesalib/src/mesa/drivers/dri/common/xmlconfig.h b/mesalib/src/mesa/drivers/dri/common/xmlconfig.h index 386ddf19d..9cb831571 100644 --- a/mesalib/src/mesa/drivers/dri/common/xmlconfig.h +++ b/mesalib/src/mesa/drivers/dri/common/xmlconfig.h @@ -60,7 +60,7 @@ typedef struct driOptionInfo { char *name; /**< \brief Name */ driOptionType type; /**< \brief Type */ driOptionRange *ranges; /**< \brief Array of ranges */ - uint nRanges; /**< \brief Number of ranges */ + unsigned int nRanges; /**< \brief Number of ranges */ } driOptionInfo; /** \brief Option cache @@ -78,7 +78,7 @@ typedef struct driOptionCache { * \li Default values in screen * \li Actual values in contexts */ - uint tableSize; + unsigned int tableSize; /**< \brief Size of the arrays * * In the current implementation it's not actually a size but log2(size). -- cgit v1.2.3