diff options
Diffstat (limited to 'Source/DOH/fio.c')
-rw-r--r-- | Source/DOH/fio.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Source/DOH/fio.c b/Source/DOH/fio.c index 71ce30149..7055ffc85 100644 --- a/Source/DOH/fio.c +++ b/Source/DOH/fio.c @@ -46,15 +46,19 @@ static int Writen(DOH *out, void *buffer, int len) { * ----------------------------------------------------------------------------- */ void DohEncoding(const char *name, DOH *(*fn) (DOH *s)) { + DohFuncPtr_t fp; + if (!encodings) encodings = NewHash(); - Setattr(encodings, (void *) name, NewVoid(*(void **)&fn, 0)); + + fp.func = fn; + Setattr(encodings, (void *) name, NewVoid(fp.p, 0)); } /* internal function for processing an encoding */ static DOH *encode(char *name, DOH *s) { DOH *handle, *ns; - DOH *(*fn) (DOH *); + DohFuncPtr_t fp; long pos; char *cfmt = strchr(name, ':'); DOH *tmp = 0; @@ -72,8 +76,9 @@ static DOH *encode(char *name, DOH *s) { s = tmp; pos = Tell(s); Seek(s, 0, SEEK_SET); - *(void **)(&fn) = Data(handle); - ns = (*fn) (s); + + fp.p = Data(handle); + ns = (*fp.func) (s); assert(pos != -1); (void)Seek(s, pos, SEEK_SET); if (tmp) |