[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH-for-8.1 4/5] bulk: Do not declare function prototypes using e
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH-for-8.1 4/5] bulk: Do not declare function prototypes using extern keyword |
Date: |
Mon, 20 Mar 2023 13:48:18 +0000 |
User-agent: |
Mutt/2.2.9 (2022-11-12) |
On Mon, Mar 20, 2023 at 02:42:18PM +0100, Philippe Mathieu-Daudé wrote:
> By default, C function prototypes declared in headers are visible,
> so there is no need to declare them as 'extern' functions.
> Remove this redundancy in a single bulk commit; do not modify:
>
> - meson.build (used to check function availability at runtime)
> - pc-bios
> - libdecnumber
> - *.c
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> block/dmg.h | 8 +++----
> bsd-user/bsd-file.h | 6 ++---
> crypto/hmacpriv.h | 13 +++++------
> hw/xen/xen_pt.h | 8 +++----
> include/crypto/secret_common.h | 14 +++++-------
> include/exec/page-vary.h | 4 ++--
> include/hw/misc/aspeed_scu.h | 2 +-
> include/hw/nvram/npcm7xx_otp.h | 4 ++--
> include/hw/qdev-core.h | 4 ++--
> include/qemu/crc-ccitt.h | 4 ++--
> include/qemu/osdep.h | 2 +-
> include/qemu/rcu.h | 14 ++++++------
> include/qemu/sys_membarrier.h | 4 ++--
> include/qemu/uri.h | 6 ++---
> include/sysemu/accel-blocker.h | 14 ++++++------
> include/sysemu/os-win32.h | 4 ++--
> include/user/safe-syscall.h | 4 ++--
> target/i386/sev.h | 6 ++---
> target/mips/cpu.h | 4 ++--
> tcg/tcg-internal.h | 4 ++--
> tests/tcg/minilib/minilib.h | 2 +-
> include/exec/memory_ldst.h.inc | 42 +++++++++++++++++-----------------
> roms/seabios | 2 +-
Accidental submodule commit.,
> 23 files changed, 84 insertions(+), 91 deletions(-)
>
> diff --git a/block/dmg.h b/block/dmg.h
> index e488601b62..ed209b5dec 100644
> --- a/block/dmg.h
> +++ b/block/dmg.h
> @@ -51,10 +51,10 @@ typedef struct BDRVDMGState {
> z_stream zstream;
> } BDRVDMGState;
>
> -extern int (*dmg_uncompress_bz2)(char *next_in, unsigned int avail_in,
> - char *next_out, unsigned int avail_out);
> +int (*dmg_uncompress_bz2)(char *next_in, unsigned int avail_in,
> + char *next_out, unsigned int avail_out);
>
> -extern int (*dmg_uncompress_lzfse)(char *next_in, unsigned int avail_in,
> - char *next_out, unsigned int avail_out);
> +int (*dmg_uncompress_lzfse)(char *next_in, unsigned int avail_in,
> + char *next_out, unsigned int avail_out);
These are variable declarations, so with this change you'll get multiple
copies of the variable if this header is included from multiple source
files. IOW, the 'extern' usage is correct.
> diff --git a/roms/seabios b/roms/seabios
> index ea1b7a0733..3208b098f5 160000
> --- a/roms/seabios
> +++ b/roms/seabios
> @@ -1 +1 @@
> -Subproject commit ea1b7a0733906b8425d948ae94fba63c32b1d425
> +Subproject commit 3208b098f51a9ef96d0dfa71d5ec3a3eaec88f0a
Nope !
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- [PATCH-for-8.1 0/5] bulk: Do not declare function prototypes using 'extern' keyword, Philippe Mathieu-Daudé, 2023/03/20
- [PATCH-for-8.1 1/5] qemu/osdep.h: Do not declare function prototypes using extern keyword, Philippe Mathieu-Daudé, 2023/03/20
- [PATCH-for-8.1 2/5] block/dmg: Remove duplicated prototype declarations, Philippe Mathieu-Daudé, 2023/03/20
- [PATCH-for-8.1 3/5] qemu/uri: Use QueryParams type definition, Philippe Mathieu-Daudé, 2023/03/20
- [PATCH-for-8.1 4/5] bulk: Do not declare function prototypes using extern keyword, Philippe Mathieu-Daudé, 2023/03/20
- Re: [PATCH-for-8.1 4/5] bulk: Do not declare function prototypes using extern keyword,
Daniel P . Berrangé <=
- [PATCH-for-8.1 5/5] bulk: Replace __attribute__((noreturn)) -> G_NORETURN, Philippe Mathieu-Daudé, 2023/03/20