From 3f52c7da3940ec06572270d511000dc7fe9c27d2 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Tue, 12 Jan 2016 10:32:20 +0900 Subject: common: Fix iobuf API of filter function for alignment. * common/iobuf.h (IOBUFCTRL_DESC): Change the call semantics. * common/iobuf.c (iobuf_desc): Add the second argument DESC. (print_chain, iobuf_close, do_open, iobuf_sockopen, iobuf_ioctl) (iobuf_push_filter2, pop_filter, iobuf_write_temp): Change calls of iobuf_desc. (file_filter, file_es_filter, sock_filter, block_filter): Fill the description. * common/t-iobuf.c (every_other_filter, double_filter): Likewise. * g10/armor.c, g10/cipher.c, g10/compress-bz2.c, g10/compress.c, g10/decrypt-data.c, g10/encrypt.c, g10/mdfilter.c, g10/progress.c, g10/textfilter.c: Likewise. -- Newer GCC warns against possible alignment difference of pointers. This change can silence those warnings. Signed-off-by: NIIBE Yutaka --- common/iobuf.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'common/iobuf.h') diff --git a/common/iobuf.h b/common/iobuf.h index cb7910510..69764d6f5 100644 --- a/common/iobuf.h +++ b/common/iobuf.h @@ -404,10 +404,10 @@ int iobuf_cancel (iobuf_t iobuf); called on the pipeline. IOBUFCTRL_DESC: Called with this value to get a human-readable - description of the filter. * (char **) BUF should set to the - NUL-terminated string. Note: you need to keep track of this - value and, if necessary, free it when the filter function is - called with control set to IOBUFCTRL_FREE. + description of the filter. *LEN is the size of the buffer. + The description is filled into BUF, NUL-terminated. Always + returns 0. When the size of the buffer is shorter than the + description, it is truncated and not NUL-terminated. */ int iobuf_push_filter (iobuf_t a, int (*f) (void *opaque, int control, iobuf_t chain, byte * buf, -- cgit v1.2.3