diff mbox series

lib: make the return types consistent

Message ID VI1P191MB0624F1AD9EA3EA9427311B1EDB53A@VI1P191MB0624.EURP191.PROD.OUTLOOK.COM
State Accepted
Headers show
Series lib: make the return types consistent | expand

Commit Message

Ákos Nagy June 7, 2023, 3:21 p.m. UTC
GCC 13 warns about the return type mismatch between the declaration and
the definition of the function. The new -Wenum-int-mismatch warning is
enabled by -Wall.

Signed-off-by: Ákos Nagy <nagyakos@outlook.com>
---
 src/lib/include/fwts_cpu.h       | 2 +-
 src/lib/include/fwts_memorymap.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Ivan Hu June 8, 2023, 1:56 a.m. UTC | #1
On 6/7/23 23:21, Ákos Nagy wrote:
> GCC 13 warns about the return type mismatch between the declaration and
> the definition of the function. The new -Wenum-int-mismatch warning is
> enabled by -Wall.
> 
> Signed-off-by: Ákos Nagy <nagyakos@outlook.com>
> ---
>   src/lib/include/fwts_cpu.h       | 2 +-
>   src/lib/include/fwts_memorymap.h | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/lib/include/fwts_cpu.h b/src/lib/include/fwts_cpu.h
> index c397c70b..7bca6a2b 100644
> --- a/src/lib/include/fwts_cpu.h
> +++ b/src/lib/include/fwts_cpu.h
> @@ -63,7 +63,7 @@ int fwts_cpu_is_Intel(bool *is_intel);
>   int fwts_cpu_is_AMD(bool *is_amd);
>   int fwts_cpu_is_Hygon(bool *is_hygon);
>   
> -int fwts_cpu_has_c1e(void);
> +fwts_bool fwts_cpu_has_c1e(void);
>   fwts_cpuinfo_x86 *fwts_cpu_get_info(const int which_cpu);
>   void fwts_cpu_free_info(fwts_cpuinfo_x86 *cpu);
>   
> diff --git a/src/lib/include/fwts_memorymap.h b/src/lib/include/fwts_memorymap.h
> index 1a2b3a2f..5f9e2852 100644
> --- a/src/lib/include/fwts_memorymap.h
> +++ b/src/lib/include/fwts_memorymap.h
> @@ -38,7 +38,7 @@ typedef struct {
>   } fwts_memory_map_entry;
>   
>   int        fwts_memory_map_type(fwts_list *memory_map_list, const uint64_t memory);
> -int        fwts_memory_map_is_reserved(fwts_list *memory_map_list, const uint64_t memory);
> +fwts_bool  fwts_memory_map_is_reserved(fwts_list *memory_map_list, const uint64_t memory);
>   fwts_list *fwts_memory_map_table_load(fwts_framework *fw);
>   void       fwts_memory_map_table_free(fwts_list *memory_map_list);
>   void       fwts_memory_map_table_dump(fwts_framework *fw, fwts_list *memory_map_list);


Thanks!

Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox series

Patch

diff --git a/src/lib/include/fwts_cpu.h b/src/lib/include/fwts_cpu.h
index c397c70b..7bca6a2b 100644
--- a/src/lib/include/fwts_cpu.h
+++ b/src/lib/include/fwts_cpu.h
@@ -63,7 +63,7 @@  int fwts_cpu_is_Intel(bool *is_intel);
 int fwts_cpu_is_AMD(bool *is_amd);
 int fwts_cpu_is_Hygon(bool *is_hygon);
 
-int fwts_cpu_has_c1e(void);
+fwts_bool fwts_cpu_has_c1e(void);
 fwts_cpuinfo_x86 *fwts_cpu_get_info(const int which_cpu);
 void fwts_cpu_free_info(fwts_cpuinfo_x86 *cpu);
 
diff --git a/src/lib/include/fwts_memorymap.h b/src/lib/include/fwts_memorymap.h
index 1a2b3a2f..5f9e2852 100644
--- a/src/lib/include/fwts_memorymap.h
+++ b/src/lib/include/fwts_memorymap.h
@@ -38,7 +38,7 @@  typedef struct {
 } fwts_memory_map_entry;
 
 int        fwts_memory_map_type(fwts_list *memory_map_list, const uint64_t memory);
-int        fwts_memory_map_is_reserved(fwts_list *memory_map_list, const uint64_t memory);
+fwts_bool  fwts_memory_map_is_reserved(fwts_list *memory_map_list, const uint64_t memory);
 fwts_list *fwts_memory_map_table_load(fwts_framework *fw);
 void       fwts_memory_map_table_free(fwts_list *memory_map_list);
 void       fwts_memory_map_table_dump(fwts_framework *fw, fwts_list *memory_map_list);