Merge pull request #126 from vadz/warn-fix

Work around gcc warning about function pointers conversions.
This commit is contained in:
William S Fulton 2014-01-11 09:39:24 -08:00
commit 0c1058511b
2 changed files with 3 additions and 3 deletions

View file

@ -949,7 +949,7 @@ DOH *DohCall(DOH *func, DOH *args) {
DOH *result;
DOH *(*builtin) (DOH *);
builtin = (DOH *(*)(DOH *)) GetVoid(func, "builtin");
*(void **)(&builtin) = GetVoid(func, "builtin");
if (!builtin)
return 0;
result = (*builtin) (args);

View file

@ -48,7 +48,7 @@ static int Writen(DOH *out, void *buffer, int len) {
void DohEncoding(const char *name, DOH *(*fn) (DOH *s)) {
if (!encodings)
encodings = NewHash();
Setattr(encodings, (void *) name, NewVoid((void *) fn, 0));
Setattr(encodings, (void *) name, NewVoid(*(void **)&fn, 0));
}
/* internal function for processing an encoding */
@ -72,7 +72,7 @@ static DOH *encode(char *name, DOH *s) {
s = tmp;
pos = Tell(s);
Seek(s, 0, SEEK_SET);
fn = (DOH *(*)(DOH *)) Data(handle);
*(void **)(&fn) = Data(handle);
ns = (*fn) (s);
assert(pos != -1);
(void)Seek(s, pos, SEEK_SET);