mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
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 <gniibe@fsij.org>
This commit is contained in:
parent
0617a05eb5
commit
3f52c7da39
12 changed files with 49 additions and 36 deletions
|
@ -5,6 +5,7 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
#include "iobuf.h"
|
||||
#include "stringhelp.h"
|
||||
|
||||
/* Return every other byte. In particular, reads two bytes, returns
|
||||
the second one. */
|
||||
|
@ -16,7 +17,7 @@ every_other_filter (void *opaque, int control,
|
|||
|
||||
if (control == IOBUFCTRL_DESC)
|
||||
{
|
||||
*(char **) buf = "every_other_filter";
|
||||
mem2str (buf, "every_other_filter", *len);
|
||||
}
|
||||
if (control == IOBUFCTRL_UNDERFLOW)
|
||||
{
|
||||
|
@ -52,7 +53,7 @@ double_filter (void *opaque, int control,
|
|||
|
||||
if (control == IOBUFCTRL_DESC)
|
||||
{
|
||||
* (char **) buf = "double_filter";
|
||||
mem2str (buf, "double_filter", *len);
|
||||
}
|
||||
if (control == IOBUFCTRL_FLUSH)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue