diff options
author | venaas <venaas> | 2009-03-11 10:38:31 +0000 |
---|---|---|
committer | venaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf> | 2009-03-11 10:38:31 +0000 |
commit | 35cf8fac24bfbc807c0170fa96d7b547d0ce9f4e (patch) | |
tree | 56ff656c7c3e5ecdd1e922c4261e516dca82c9ce | |
parent | 990aada420a31585b609fc2cff4f8734dd516c96 (diff) |
function pointer typedef to work around some va_arg limitations
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/branches/release-1.3@486 e88ac4ed-0b26-0410-9574-a7f39faa03bf
-rw-r--r-- | gconfig.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -383,6 +383,8 @@ void unhex(char *s) { *s = '\0'; } +typedef int (*t_fptr)(struct gconffile **, void *, char *, char *, char *); + /* returns 1 if ok, 0 on error */ /* caller must free returned values also on error */ int getgenericconfig(struct gconffile **cf, char *block, ...) { @@ -391,7 +393,7 @@ int getgenericconfig(struct gconffile **cf, char *block, ...) { uint8_t *bln = NULL; long int *lint = NULL; int type = 0, conftype = 0, n; - int (*cbk)(struct gconffile **, void *, char *, char *, char *) = NULL; + t_fptr cbk = NULL; void *cbkarg = NULL; for (;;) { @@ -435,7 +437,7 @@ int getgenericconfig(struct gconffile **cf, char *block, ...) { goto errparam; break; case CONF_CBK: - cbk = va_arg(ap, int (*)(struct gconffile **, void *, char *, char *, char *)); + cbk = va_arg(ap, t_fptr); if (!cbk) goto errparam; cbkarg = va_arg(ap, void *); |