Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation on GCC 14 #277

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libzfs.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3008,9 +3008,9 @@ cdef class ZFSPool(object):
cdef char* msg_id
if self.handle != NULL:
IF HAVE_ZPOOL_GET_STATUS == 3:
return PoolStatus(libzfs.zpool_get_status(self.handle, &msg_id, NULL))
return PoolStatus(libzfs.zpool_get_status(self.handle, <const char**>&msg_id, NULL))
ELSE:
return PoolStatus(libzfs.zpool_get_status(self.handle, &msg_id))
return PoolStatus(libzfs.zpool_get_status(self.handle, <const char**>&msg_id))

def __warning_statuses(self):
return [
Expand Down
8 changes: 4 additions & 4 deletions nvpair.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ cdef class NVList(object):
datatype = nvpair.nvpair_type(pair)

if datatype == nvpair.DATA_TYPE_STRING:
nvpair.nvpair_value_string(pair, &cstr)
nvpair.nvpair_value_string(pair, <const char**>&cstr)
return (<bytes>cstr).decode('utf-8')

if datatype == nvpair.DATA_TYPE_BOOLEAN:
Expand Down Expand Up @@ -139,7 +139,7 @@ cdef class NVList(object):
return [x for x in (<uint64_t *>carray)[:carraylen]]

if datatype == nvpair.DATA_TYPE_STRING_ARRAY:
nvpair.nvpair_value_string_array(pair, <char***>&carray, &carraylen)
nvpair.nvpair_value_string_array(pair, <const char***>&carray, &carraylen)
return [x for x in (<char**>carray)[:carraylen]]

if datatype == nvpair.DATA_TYPE_NVLIST:
Expand Down Expand Up @@ -255,7 +255,7 @@ cdef class NVList(object):
for idx, i in enumerate(value):
(<char**>carray)[idx] = i

nvpair.nvlist_add_string_array(self.handle, key, <char**>carray, len(value))
nvpair.nvlist_add_string_array(self.handle, key, <const char * const *>carray, len(value))

if typeid == nvpair.DATA_TYPE_BOOLEAN_ARRAY:
carray = malloc(len(value) * sizeof(char*))
Expand Down Expand Up @@ -334,7 +334,7 @@ cdef class NVList(object):
cnvlist = <NVList>i
(<uintptr_t*>carray)[idx] = <uintptr_t>cnvlist.handle

nvpair.nvlist_add_nvlist_array(self.handle, key, <nvpair.nvlist_t**>carray, len(value))
nvpair.nvlist_add_nvlist_array(self.handle, key, <const nvpair.nvlist_t* const *>carray, len(value))

if carray != NULL:
free(carray)
Expand Down
4 changes: 2 additions & 2 deletions pxd/libzfs.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,9 @@ cdef extern from "libzfs.h" nogil:
extern int zpool_events_next(libzfs_handle_t *, nvpair.nvlist_t **, int *, unsigned, int);

IF HAVE_ZPOOL_GET_STATUS == 3 and HAVE_ZPOOL_ERRATA_T_ENUM:
extern zpool_status_t zpool_get_status(zpool_handle_t *, char **, zfs.zpool_errata_t *)
extern zpool_status_t zpool_get_status(zpool_handle_t *, const char **, zfs.zpool_errata_t *)
ELSE:
extern zpool_status_t zpool_get_status(zpool_handle_t *, char **)
extern zpool_status_t zpool_get_status(zpool_handle_t *, const char **)

extern zpool_status_t zpool_import_status(nvpair.nvlist_t *, char **)
extern void zpool_dump_ddt(const zfs.ddt_stat_t *dds, const zfs.ddt_histogram_t *ddh)
Expand Down
12 changes: 6 additions & 6 deletions pxd/nvpair.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ IF HAVE_NVPAIR_IN_SYS:
int nvlist_add_uint32_array(nvlist_t *, const char *, uint32_t *, uint_t)
int nvlist_add_int64_array(nvlist_t *, const char *, int64_t *, uint_t)
int nvlist_add_uint64_array(nvlist_t *, const char *, uint64_t *, uint_t)
int nvlist_add_string_array(nvlist_t *, const char *, char * const *, uint_t)
int nvlist_add_nvlist_array(nvlist_t *, const char *, nvlist_t **, uint_t)
int nvlist_add_string_array(nvlist_t *, const char *, const char * const *, uint_t)
int nvlist_add_nvlist_array(nvlist_t *, const char *, const nvlist_t * const *, uint_t)
int nvlist_add_hrtime(nvlist_t *, const char *, hrtime_t)
int nvlist_add_double(nvlist_t *, const char *, double)

Expand Down Expand Up @@ -214,8 +214,8 @@ IF HAVE_NVPAIR_IN_SYS:
void fnvlist_add_uint32_array(nvlist_t *, const char *, uint32_t *, uint_t)
void fnvlist_add_int64_array(nvlist_t *, const char *, int64_t *, uint_t)
void fnvlist_add_uint64_array(nvlist_t *, const char *, uint64_t *, uint_t)
void fnvlist_add_string_array(nvlist_t *, const char *, char * const *, uint_t)
void fnvlist_add_nvlist_array(nvlist_t *, const char *, nvlist_t **, uint_t)
void fnvlist_add_string_array(nvlist_t *, const char *, const char * const *, uint_t)
void fnvlist_add_nvlist_array(nvlist_t *, const char *, const nvlist_t * const *, uint_t)

void fnvlist_remove(nvlist_t *, const char *)
void fnvlist_remove_nvpair(nvlist_t *, nvpair_t *)
Expand Down Expand Up @@ -407,7 +407,7 @@ ELSE:
int nvpair_value_uint32(nvpair_t *, uint32_t *)
int nvpair_value_int64(nvpair_t *, int64_t *)
int nvpair_value_uint64(nvpair_t *, uint64_t *)
int nvpair_value_string(nvpair_t *, char **)
int nvpair_value_string(nvpair_t *, const char **)
int nvpair_value_nvlist(nvpair_t *, nvlist_t **)
int nvpair_value_boolean_array(nvpair_t *, boolean_t **, uint_t *)
int nvpair_value_byte_array(nvpair_t *, uchar_t **, uint_t *)
Expand All @@ -419,7 +419,7 @@ ELSE:
int nvpair_value_uint32_array(nvpair_t *, uint32_t **, uint_t *)
int nvpair_value_int64_array(nvpair_t *, int64_t **, uint_t *)
int nvpair_value_uint64_array(nvpair_t *, uint64_t **, uint_t *)
int nvpair_value_string_array(nvpair_t *, char ***, uint_t *)
int nvpair_value_string_array(nvpair_t *, const char ***, uint_t *)
int nvpair_value_nvlist_array(nvpair_t *, nvlist_t ***, uint_t *)
int nvpair_value_hrtime(nvpair_t *, hrtime_t *)
int nvpair_value_double(nvpair_t *, double *)
Expand Down