[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/3] Fix various function pointer types
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 1/3] Fix various function pointer types |
Date: |
Tue, 10 Dec 2024 18:53:31 +0100 |
Applied the series, thanks!
Sergey Bugaev, le mar. 10 déc. 2024 14:57:03 +0300, a ecrit:
> Fixes Wincompatible-pointer-types errors on GCC 15.
>
> Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
> ---
> ddb/db_variables.h | 2 +-
> i386/i386/trap.c | 2 +-
> vm/vm_fault.c | 4 ++--
> vm/vm_map.c | 2 +-
> vm/vm_map.h | 8 ++++----
> 5 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/ddb/db_variables.h b/ddb/db_variables.h
> index 9880d50f..2929dab9 100644
> --- a/ddb/db_variables.h
> +++ b/ddb/db_variables.h
> @@ -51,7 +51,7 @@ struct db_variable {
> #define DB_VAR_GET 0
> #define DB_VAR_SET 1
> };
> -#define FCN_NULL ((void (*)())0)
> +#define FCN_NULL ((void (*)(struct db_variable *, db_expr_t *,
> int, db_var_aux_param_t))0)
>
> #define DB_VAR_LEVEL 3 /* maximum number of suffix level */
>
> diff --git a/i386/i386/trap.c b/i386/i386/trap.c
> index 555d7498..a9d0d8d2 100644
> --- a/i386/i386/trap.c
> +++ b/i386/i386/trap.c
> @@ -245,7 +245,7 @@ dump_ss(regs);
> #endif
> FALSE,
> FALSE,
> - (void (*)()) 0);
> + vm_fault_no_continuation);
> #if MACH_KDB
> if (result == KERN_SUCCESS) {
> /* Look for watchpoints */
> diff --git a/vm/vm_fault.c b/vm/vm_fault.c
> index d99425a3..ef6b5656 100644
> --- a/vm/vm_fault.c
> +++ b/vm/vm_fault.c
> @@ -1520,7 +1520,7 @@ void vm_fault_wire(
> for (va = entry->vme_start; va < end_addr; va += PAGE_SIZE) {
> if (vm_fault_wire_fast(map, va, entry) != KERN_SUCCESS)
> (void) vm_fault(map, va, VM_PROT_NONE, TRUE,
> - FALSE, (void (*)()) 0);
> + FALSE, vm_fault_no_continuation);
> }
> }
>
> @@ -1554,7 +1554,7 @@ void vm_fault_unwire(
> if (object == VM_OBJECT_NULL) {
> vm_map_lock_set_recursive(map);
> (void) vm_fault(map, va, VM_PROT_NONE, TRUE,
> - FALSE, (void (*)()) 0);
> + FALSE, vm_fault_no_continuation);
> vm_map_lock_clear_recursive(map);
> } else {
> vm_prot_t prot;
> diff --git a/vm/vm_map.c b/vm/vm_map.c
> index 56928369..03d22ea1 100644
> --- a/vm/vm_map.c
> +++ b/vm/vm_map.c
> @@ -3927,7 +3927,7 @@ kern_return_t vm_map_copyin_page_list(
> copy->cpy_npages = 0;
> copy->offset = src_addr;
> copy->size = len;
> - copy->cpy_cont = ((kern_return_t (*)()) 0);
> + copy->cpy_cont = (vm_map_copy_cont_fn) 0;
> copy->cpy_cont_args = VM_MAP_COPYIN_ARGS_NULL;
>
> /*
> diff --git a/vm/vm_map.h b/vm/vm_map.h
> index 7e25d9f4..900f1218 100644
> --- a/vm/vm_map.h
> +++ b/vm/vm_map.h
> @@ -311,14 +311,14 @@ MACRO_BEGIN
> \
> vm_map_copy_page_discard(old_copy); \
> *result = (*((old_copy)->cpy_cont))((old_copy)->cpy_cont_args, \
> new_copy); \
> - (old_copy)->cpy_cont = (kern_return_t (*)()) 0; \
> + (old_copy)->cpy_cont = (vm_map_copy_cont_fn) 0; \
> MACRO_END
>
> #define vm_map_copy_invoke_extend_cont(old_copy, new_copy, result)
> \
> MACRO_BEGIN \
> *result = (*((old_copy)->cpy_cont))((old_copy)->cpy_cont_args, \
> new_copy); \
> - (old_copy)->cpy_cont = (kern_return_t (*)()) 0; \
> + (old_copy)->cpy_cont = (vm_map_copy_cont_fn) 0; \
> MACRO_END
>
> #define vm_map_copy_abort_cont(old_copy) \
> @@ -326,12 +326,12 @@ MACRO_BEGIN
> \
> vm_map_copy_page_discard(old_copy); \
> (*((old_copy)->cpy_cont))((old_copy)->cpy_cont_args, \
> (vm_map_copy_t *) 0); \
> - (old_copy)->cpy_cont = (kern_return_t (*)()) 0; \
> + (old_copy)->cpy_cont = (vm_map_copy_cont_fn) 0; \
> (old_copy)->cpy_cont_args = VM_MAP_COPYIN_ARGS_NULL; \
> MACRO_END
>
> #define vm_map_copy_has_cont(copy) \
> - (((copy)->cpy_cont) != (kern_return_t (*)()) 0)
> + (((copy)->cpy_cont) != (vm_map_copy_cont_fn) 0)
>
> /*
> * Continuation structures for vm_map_copyin_page_list.
> --
> 2.47.1
>
>
--
Samuel
> Allez, soyez sympa ... traduisez-lui "linux"
Linux, c'est comme le miel : c'est vachement bon mais ça attire les
mouches. En plus, ça colle aux doigts et on a du mal à s'en défaire.
-+- TP in: Guide du linuxien pervers - "Barrez vous les mouches !"