summaryrefslogtreecommitdiffstats
path: root/source/tdb/tdbutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/tdb/tdbutil.c')
-rw-r--r--source/tdb/tdbutil.c50
1 files changed, 2 insertions, 48 deletions
diff --git a/source/tdb/tdbutil.c b/source/tdb/tdbutil.c
index 27aac560e0a..d683d70c469 100644
--- a/source/tdb/tdbutil.c
+++ b/source/tdb/tdbutil.c
@@ -120,44 +120,21 @@ TDB_DATA tdb_fetch_by_string(TDB_CONTEXT *tdb, char *keystr)
/* useful pair of routines for packing/unpacking data consisting of
integers and strings */
-#ifdef HAVE_STDARG_H
size_t tdb_pack(char *buf, int bufsize, char *fmt, ...)
{
-#else /* HAVE_STDARG_H */
- size_t tdb_pack(va_alist)
-va_dcl
-{
- char *buf, *fmt;
- int bufsize;
-#endif /* HAVE_STDARG_H */
va_list ap;
uint16 w;
uint32 d;
int i;
void *p;
- int len = 0;
+ int len;
char *s;
char c;
-#ifdef HAVE_STDARG_H
char *buf0 = buf;
char *fmt0 = fmt;
int bufsize0 = bufsize;
va_start(ap, fmt);
-#else /* HAVE_STDARG_H */
- char *buf0;
- char *fmt0;
- int bufsize0;
-
- va_start(ap);
- buf = va_arg(ap,char *);
- bufsize = va_arg(ap,int);
- fmt = va_arg(ap,char *);
-
- buf0 = buf;
- fmt0 = fmt;
- bufsize0 = bufsize;
-#endif /* HAVE_STDARG_H */
while (*fmt) {
switch ((c = *fmt++)) {
@@ -230,44 +207,21 @@ va_dcl
/* useful pair of routines for packing/unpacking data consisting of
integers and strings */
-#ifdef HAVE_STDARG_H
int tdb_unpack(char *buf, int bufsize, char *fmt, ...)
{
-#else /* HAVE_STDARG_H */
- int tdb_unpack(va_alist)
-va_dcl
-{
- char *buf, *fmt;
- int bufsize;
-#endif /* HAVE_STDARG_H */
va_list ap;
uint16 *w;
uint32 *d;
- int len = 0;
+ int len;
int *i;
void **p;
char *s, **b;
char c;
-#ifdef HAVE_STDARG_H
char *buf0 = buf;
char *fmt0 = fmt;
int bufsize0 = bufsize;
va_start(ap, fmt);
-#else /* HAVE_STDARG_H */
- char *buf0;
- char *fmt0;
- int bufsize0;
-
- va_start(ap);
- buf = va_arg(ap,char *);
- bufsize = va_arg(ap,int);
- fmt = va_arg(ap,char *);
-
- buf0 = buf;
- fmt0 = fmt;
- bufsize0 = bufsize;
-#endif /* HAVE_STDARG_H */
while (*fmt) {
switch ((c=*fmt++)) {