Commit 07b8f838 authored by Albert Astals Cid's avatar Albert Astals Cid

cast to void * to bypass new gcc -Wclass-memaccess warning

Yes what we're doing there is a bit nasty but it works :D
parent 2e750862
...@@ -112,7 +112,7 @@ void Array::remove(int i) { ...@@ -112,7 +112,7 @@ void Array::remove(int i) {
#endif #endif
} }
--length; --length;
memmove( elems + i, elems + i + 1, sizeof(elems[0]) * (length - i) ); memmove( static_cast<void*>(elems + i), elems + i + 1, sizeof(elems[0]) * (length - i) );
} }
Object Array::get(int i, int recursion) const { Object Array::get(int i, int recursion) const {
......
...@@ -201,7 +201,7 @@ void Dict::remove(const char *key) { ...@@ -201,7 +201,7 @@ void Dict::remove(const char *key) {
gfree(entries[pos].key); gfree(entries[pos].key);
entries[pos].val.free(); entries[pos].val.free();
if (pos != length) { if (pos != length) {
memmove(&entries[pos], &entries[pos + 1], (length - pos) * sizeof(DictEntry)); memmove(static_cast<void*>(&entries[pos]), &entries[pos + 1], (length - pos) * sizeof(DictEntry));
} }
} }
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment