libidav/davqlexec.c

branch
v1.1
changeset 341
7954fdacdb5c
parent 339
ad45ba74fe1b
--- a/libidav/davqlexec.c	Tue Dec 12 15:51:09 2017 +0100
+++ b/libidav/davqlexec.c	Tue Dec 12 17:41:01 2017 +0100
@@ -66,7 +66,7 @@
     return result;
 }
 
-sstr_t dav_format_string(UcxAllocator *a, sstr_t fstr, va_list *ap, davqlerror_t *error) {
+sstr_t dav_format_string(UcxAllocator *a, sstr_t fstr, dav_valist ap, davqlerror_t *error) {
     UcxBuffer *buf = ucx_buffer_new(NULL, 128, UCX_BUFFER_AUTOEXTEND);
     
     int placeholder = 0;
@@ -81,17 +81,17 @@
                 int err = 0;
                 switch(c) {
                     case 's': {
-                        char *arg = va_arg(*ap, char*);
+                        char *arg = dav_vaarg(ap, char*);
                         ucx_buffer_puts(buf, arg);
                         break;
                     }
                     case 'd': {
-                        int arg = va_arg(*ap, int);
+                        int arg = dav_vaarg(ap, int);
                         ucx_bprintf(buf, "%d", arg);
                         break;
                     }
                     case 'u': {
-                        unsigned int arg = va_arg(*ap, unsigned int);
+                        unsigned int arg = dav_vaarg(ap, unsigned int);
                         ucx_bprintf(buf, "%u", arg);
                         break;
                     }
@@ -371,7 +371,7 @@
     
     // get path string
     davqlerror_t error;
-    sstr_t path = dav_format_string(mp->allocator, st->path, &ap, &error);
+    sstr_t path = dav_fmt_str(mp->allocator, st->path, ap, &error);
     if(error) {
         // TODO: cleanup
         ucx_mempool_destroy(mp);
@@ -640,7 +640,7 @@
         }
         case DAVQL_STRING: {
             cmd.type = DAVQL_CMD_STRING;
-            cmd.data.string = dav_format_string(a, src, &ap, &error);
+            cmd.data.string = dav_fmt_str(a, src, ap, &error);
             ucx_buffer_write(&cmd, sizeof(cmd), 1, bcode);
             break;
         }

mercurial