The following commit has been merged in the master branch:
commit 912657f0b45bb17c111e2b08845382f28fe73798
Author: Guillem Jover <[email protected]>
Date:   Fri Aug 28 19:39:27 2009 +0200

    libdpkg: Fold buffer_copy_setup back into buffer_copy_setup_TYPE functions

diff --git a/lib/dpkg/buffer.c b/lib/dpkg/buffer.c
index 6b8d5bd..7936c60 100644
--- a/lib/dpkg/buffer.c
+++ b/lib/dpkg/buffer.c
@@ -160,23 +160,6 @@ buffer_read(buffer_data_t data, void *buf, off_t length, 
const char *desc)
        return ret;
 }
 
-off_t
-buffer_copy_setup(buffer_arg argIn, int typeIn,
-                  buffer_arg argOut, int typeOut,
-                  off_t limit, const char *desc)
-{
-       struct buffer_data read_data = { argIn, typeIn },
-                          write_data = { argOut, typeOut };
-       off_t ret;
-
-       buffer_init(&read_data, &write_data);
-       ret = buffer_copy(&read_data, &write_data, limit, desc);
-       buffer_done(&read_data, &write_data);
-
-       return ret;
-}
-
-
 #define buffer_copy_setup_dual(name, type1, name1, type2, name2) \
 off_t \
 buffer_copy_setup_##name(type1 n1, int typeIn, \
@@ -184,17 +167,23 @@ buffer_copy_setup_##name(type1 n1, int typeIn, \
                          off_t limit, const char *desc, ...) \
 { \
        va_list al; \
-       buffer_arg a1, a2; \
+       struct buffer_data read_data, write_data; \
        struct varbuf v = VARBUF_INIT; \
        off_t ret; \
 \
-       a1.name1 = n1; \
-       a2.name2 = n2; \
+       read_data.data.name1 = n1; \
+       read_data.type = typeIn; \
+       write_data.data.name2 = n2; \
+       write_data.type = typeOut; \
+\
        va_start(al, desc); \
        varbufvprintf(&v, desc, al); \
        va_end(al); \
 \
-       ret = buffer_copy_setup(a1, typeIn, a2, typeOut, limit, v.buf); \
+       buffer_init(&read_data, &write_data); \
+       ret = buffer_copy(&read_data, &write_data, limit, v.buf); \
+       buffer_done(&read_data, &write_data); \
+\
        varbuffree(&v); \
 \
        return ret; \
diff --git a/lib/dpkg/buffer.h b/lib/dpkg/buffer.h
index 7b2ee1f..1ff97f2 100644
--- a/lib/dpkg/buffer.h
+++ b/lib/dpkg/buffer.h
@@ -153,9 +153,7 @@ off_t buffer_copy_setup_IntInt(int i1, int typeIn,
                                int i2, int typeOut,
                                off_t limit, const char *desc,
                                ...) DPKG_ATTR_PRINTF(6);
-off_t buffer_copy_setup(buffer_arg argIn, int typeIn,
-                        buffer_arg argOut, int typeOut,
-                        off_t limit, const char *desc);
+
 off_t buffer_write(buffer_data_t data, void *buf,
                    off_t length, const char *desc);
 off_t buffer_read(buffer_data_t data, void *buf,

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to