From 0a28e3002be24dad4aa9263817fb96f3ad94a9b5 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Thu, 19 Sep 2024 11:23:50 -0400 Subject: [PATCH] Fix incompatible pointer types warning --- nuklear.h | 16 ++++++++-------- src/nuklear_util.c | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/nuklear.h b/nuklear.h index 19553b4..3bac6c2 100644 --- a/nuklear.h +++ b/nuklear.h @@ -3834,11 +3834,11 @@ NK_API struct nk_vec2 nk_rect_size(struct nk_rect); NK_API int nk_strlen(const char *str); NK_API int nk_stricmp(const char *s1, const char *s2); NK_API int nk_stricmpn(const char *s1, const char *s2, int n); -NK_API int nk_strtoi(const char *str, const char **endptr); -NK_API float nk_strtof(const char *str, const char **endptr); +NK_API int nk_strtoi(const char *str, char **endptr); +NK_API float nk_strtof(const char *str, char **endptr); #ifndef NK_STRTOD #define NK_STRTOD nk_strtod -NK_API double nk_strtod(const char *str, const char **endptr); +NK_API double nk_strtod(const char *str, char **endptr); #endif NK_API int nk_strfilter(const char *text, const char *regexp); NK_API int nk_strmatch_fuzzy_string(char const *str, char const *pattern, int *out_score); @@ -6753,7 +6753,7 @@ nk_strlen(const char *str) return siz; } NK_API int -nk_strtoi(const char *str, const char **endptr) +nk_strtoi(const char *str, char **endptr) { int neg = 1; const char *p = str; @@ -6773,15 +6773,15 @@ nk_strtoi(const char *str, const char **endptr) p++; } if (endptr) - *endptr = p; + *endptr = (char *)p; return neg*value; } NK_API double -nk_strtod(const char *str, const char **endptr) +nk_strtod(const char *str, char **endptr) { double m; double neg = 1.0; - const char *p = str; + char *p = (char *)str; double value = 0; double number = 0; @@ -6834,7 +6834,7 @@ nk_strtod(const char *str, const char **endptr) return number; } NK_API float -nk_strtof(const char *str, const char **endptr) +nk_strtof(const char *str, char **endptr) { float float_value; double double_value; diff --git a/src/nuklear_util.c b/src/nuklear_util.c index 364753b..f6ecfa7 100644 --- a/src/nuklear_util.c +++ b/src/nuklear_util.c @@ -161,7 +161,7 @@ nk_strtoi(const char *str, char **endptr) p++; } if (endptr) - *endptr = p; + *endptr = (char *)p; return neg*value; } NK_API double @@ -169,7 +169,7 @@ nk_strtod(const char *str, char **endptr) { double m; double neg = 1.0; - const char *p = str; + char *p = (char *)str; double value = 0; double number = 0;