summaryrefslogtreecommitdiff
path: root/legacy/eina
diff options
context:
space:
mode:
Diffstat (limited to 'legacy/eina')
-rw-r--r--legacy/eina/configure.ac20
-rw-r--r--legacy/eina/src/lib/eina_cpu.c4
-rw-r--r--legacy/eina/src/lib/eina_magic.c4
-rw-r--r--legacy/eina/src/lib/eina_simple_xml_parser.c14
-rw-r--r--legacy/eina/src/lib/eina_strbuf.c6
5 files changed, 33 insertions, 15 deletions
diff --git a/legacy/eina/configure.ac b/legacy/eina/configure.ac
index 68c1c50fcd..31e2996ae3 100644
--- a/legacy/eina/configure.ac
+++ b/legacy/eina/configure.ac
@@ -469,7 +469,25 @@ EFL_LINKER_FLAG([-fno-strict-aliasing])
469### Checks for library functions 469### Checks for library functions
470AC_ISC_POSIX 470AC_ISC_POSIX
471AC_FUNC_ALLOCA 471AC_FUNC_ALLOCA
472AC_CHECK_FUNCS([strlcpy dirfd openat fstatat fpathconf execvp]) 472AC_CHECK_FUNCS([strlcpy openat fstatat fpathconf execvp])
473
474AC_MSG_CHECKING([dirfd])
475AC_LINK_IFELSE([
476
477#include <dirent.h>
478
479DIR *dirp;
480
481int
482main(void)
483{
484 return dirfd(dirp);
485}
486], [ AC_MSG_RESULT([yes])
487 AC_DEFINE([HAVE_DIRFD], 1, [ Define to 1 if you have the `dirfd' function or macro. ])
488 ],
489 [ AC_MSG_RESULT([no])]
490)
473 491
474# dlopen and dladdr 492# dlopen and dladdr
475dlopen_libs="" 493dlopen_libs=""
diff --git a/legacy/eina/src/lib/eina_cpu.c b/legacy/eina/src/lib/eina_cpu.c
index 8af550d19b..5b190e45ea 100644
--- a/legacy/eina/src/lib/eina_cpu.c
+++ b/legacy/eina/src/lib/eina_cpu.c
@@ -24,7 +24,7 @@
24# ifdef _WIN32 24# ifdef _WIN32
25# define WIN32_LEAN_AND_MEAN 25# define WIN32_LEAN_AND_MEAN
26# include <windows.h> 26# include <windows.h>
27# elif defined (__SUNPRO_C) || defined(__GNU__) 27# elif defined (__sun) || defined(__GNU__)
28# include <unistd.h> 28# include <unistd.h>
29# elif defined (__FreeBSD__) || defined (__OpenBSD__) || \ 29# elif defined (__FreeBSD__) || defined (__OpenBSD__) || \
30 defined (__NetBSD__) || defined (__DragonFly__) || defined (__MacOSX__) || \ 30 defined (__NetBSD__) || defined (__DragonFly__) || defined (__MacOSX__) || \
@@ -140,7 +140,7 @@ EAPI int eina_cpu_count(void)
140 GetSystemInfo(&sysinfo); 140 GetSystemInfo(&sysinfo);
141 return sysinfo.dwNumberOfProcessors; 141 return sysinfo.dwNumberOfProcessors;
142 142
143# elif defined (__SUNPRO_C) || defined(__GNU__) 143# elif defined (__sun) || defined(__GNU__)
144 /* 144 /*
145 * _SC_NPROCESSORS_ONLN: number of processors that are online, that 145 * _SC_NPROCESSORS_ONLN: number of processors that are online, that
146 is available when sysconf is called. The number 146 is available when sysconf is called. The number
diff --git a/legacy/eina/src/lib/eina_magic.c b/legacy/eina/src/lib/eina_magic.c
index 1adde927ec..08e9964851 100644
--- a/legacy/eina/src/lib/eina_magic.c
+++ b/legacy/eina/src/lib/eina_magic.c
@@ -79,7 +79,7 @@ _eina_magic_strings_sort_cmp(const void *p1, const void *p2)
79static int 79static int
80_eina_magic_strings_find_cmp(const void *p1, const void *p2) 80_eina_magic_strings_find_cmp(const void *p1, const void *p2)
81{ 81{
82 Eina_Magic a = (Eina_Magic)p1; 82 Eina_Magic a = (Eina_Magic)(size_t)p1;
83 const Eina_Magic_String *b = p2; 83 const Eina_Magic_String *b = p2;
84 return a - b->magic; 84 return a - b->magic;
85} 85}
@@ -206,7 +206,7 @@ eina_magic_string_get(Eina_Magic magic)
206 _eina_magic_strings_dirty = 0; 206 _eina_magic_strings_dirty = 0;
207 } 207 }
208 208
209 ems = bsearch((void *)magic, _eina_magic_strings, 209 ems = bsearch((void *)(size_t)magic, _eina_magic_strings,
210 _eina_magic_strings_count, sizeof(Eina_Magic_String), 210 _eina_magic_strings_count, sizeof(Eina_Magic_String),
211 _eina_magic_strings_find_cmp); 211 _eina_magic_strings_find_cmp);
212 if (ems) 212 if (ems)
diff --git a/legacy/eina/src/lib/eina_simple_xml_parser.c b/legacy/eina/src/lib/eina_simple_xml_parser.c
index 08a8259f71..91f6e87207 100644
--- a/legacy/eina/src/lib/eina_simple_xml_parser.c
+++ b/legacy/eina/src/lib/eina_simple_xml_parser.c
@@ -121,7 +121,7 @@ static inline const char *
121_eina_simple_xml_whitespace_find(const char *itr, const char *itr_end) 121_eina_simple_xml_whitespace_find(const char *itr, const char *itr_end)
122{ 122{
123 for (; itr < itr_end; itr++) 123 for (; itr < itr_end; itr++)
124 if (isspace(*itr)) break; 124 if (isspace((unsigned char)*itr)) break;
125 return itr; 125 return itr;
126} 126}
127 127
@@ -129,7 +129,7 @@ static inline const char *
129_eina_simple_xml_whitespace_skip(const char *itr, const char *itr_end) 129_eina_simple_xml_whitespace_skip(const char *itr, const char *itr_end)
130{ 130{
131 for (; itr < itr_end; itr++) 131 for (; itr < itr_end; itr++)
132 if (!isspace(*itr)) break; 132 if (!isspace((unsigned char)*itr)) break;
133 return itr; 133 return itr;
134} 134}
135 135
@@ -137,7 +137,7 @@ static inline const char *
137_eina_simple_xml_whitespace_unskip(const char *itr, const char *itr_start) 137_eina_simple_xml_whitespace_unskip(const char *itr, const char *itr_start)
138{ 138{
139 for (itr--; itr > itr_start; itr--) 139 for (itr--; itr > itr_start; itr--)
140 if (!isspace(*itr)) break; 140 if (!isspace((unsigned char)*itr)) break;
141 return itr + 1; 141 return itr + 1;
142} 142}
143 143
@@ -309,7 +309,7 @@ eina_simple_xml_parse(const char *buf, unsigned buflen, Eina_Bool strip, Eina_Si
309 (!memcmp(itr + 2, "DOCTYPE", 309 (!memcmp(itr + 2, "DOCTYPE",
310 sizeof("DOCTYPE") - 1)) && 310 sizeof("DOCTYPE") - 1)) &&
311 ((itr[2 + sizeof("DOCTYPE") - 1] == '>') || 311 ((itr[2 + sizeof("DOCTYPE") - 1] == '>') ||
312 (isspace(itr[2 + sizeof("DOCTYPE") - 1])))) 312 (isspace((unsigned char)itr[2 + sizeof("DOCTYPE") - 1]))))
313 { 313 {
314 type = EINA_SIMPLE_XML_DOCTYPE; 314 type = EINA_SIMPLE_XML_DOCTYPE;
315 toff = sizeof("!DOCTYPE") - 1; 315 toff = sizeof("!DOCTYPE") - 1;
@@ -455,7 +455,7 @@ eina_simple_xml_tag_attributes_find(const char *buf, unsigned buflen)
455 455
456 for (; itr < itr_end; itr++) 456 for (; itr < itr_end; itr++)
457 { 457 {
458 if (!isspace(*itr)) 458 if (!isspace((unsigned char)*itr))
459 { 459 {
460 /* user skip tagname and already gave it the attributes */ 460 /* user skip tagname and already gave it the attributes */
461 if (*itr == '=') 461 if (*itr == '=')
@@ -492,7 +492,7 @@ eina_simple_xml_attributes_parse(const char *buf, unsigned buflen, Eina_Simple_X
492 492
493 key = p; 493 key = p;
494 for (key_end = key; key_end < itr_end; key_end++) 494 for (key_end = key; key_end < itr_end; key_end++)
495 if ((*key_end == '=') || (isspace(*key_end))) break; 495 if ((*key_end == '=') || (isspace((unsigned char)*key_end))) break;
496 if (key_end == itr_end) return EINA_FALSE; 496 if (key_end == itr_end) return EINA_FALSE;
497 if (key_end == key) continue; 497 if (key_end == key) continue;
498 498
@@ -504,7 +504,7 @@ eina_simple_xml_attributes_parse(const char *buf, unsigned buflen, Eina_Simple_X
504 value++; 504 value++;
505 } 505 }
506 for (; value < itr_end; value++) 506 for (; value < itr_end; value++)
507 if (!isspace(*value)) break; 507 if (!isspace((unsigned char)*value)) break;
508 if (value == itr_end) return EINA_FALSE; 508 if (value == itr_end) return EINA_FALSE;
509 509
510 if ((*value == '"') || (*value == '\'')) 510 if ((*value == '"') || (*value == '\''))
diff --git a/legacy/eina/src/lib/eina_strbuf.c b/legacy/eina/src/lib/eina_strbuf.c
index 74b1eb978c..828d842455 100644
--- a/legacy/eina/src/lib/eina_strbuf.c
+++ b/legacy/eina/src/lib/eina_strbuf.c
@@ -162,9 +162,9 @@ eina_strbuf_insert_vprintf(Eina_Strbuf *buf,
162EAPI void 162EAPI void
163eina_strbuf_trim(Eina_Strbuf *buf) 163eina_strbuf_trim(Eina_Strbuf *buf)
164{ 164{
165 char *c = buf->buf; 165 unsigned char *c = buf->buf;
166 166
167 while (buf->len > 0 && isspace(((unsigned char*)(buf->buf))[buf->len - 1])) 167 while (buf->len > 0 && isspace(c[buf->len - 1]))
168 buf->len--; 168 buf->len--;
169 while (buf->len > 0 && isspace(*c)) 169 while (buf->len > 0 && isspace(*c))
170 { 170 {
@@ -178,7 +178,7 @@ eina_strbuf_trim(Eina_Strbuf *buf)
178EAPI void 178EAPI void
179eina_strbuf_ltrim(Eina_Strbuf *buf) 179eina_strbuf_ltrim(Eina_Strbuf *buf)
180{ 180{
181 char *c = buf->buf; 181 unsigned char *c = buf->buf;
182 182
183 while (buf->len > 0 && isspace(*c)) 183 while (buf->len > 0 && isspace(*c))
184 { 184 {