]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libndr: Apply const to the ndr_print_* functions's void *
authorVolker Lendecke <vl@samba.org>
Sun, 24 Nov 2024 13:16:06 +0000 (14:16 +0100)
committerMartin Schwenke <martins@samba.org>
Mon, 2 Dec 2024 04:53:33 +0000 (04:53 +0000)
ndr_print_fn_t has a const void *, so we can extend this to the
callers. Keep ABI at 6.0.0, 4.21 is 5.0.0 and 4.22 is not there yet.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
librpc/ABI/ndr-6.0.0.sigs
librpc/ndr/libndr.h
librpc/ndr/ndr.c

index 7c672a1bf51dcf2ce97f719a07a2911a48b0ab82..ed433a50b4c68995aa3fac17bda22432a2458ba1 100644 (file)
@@ -42,15 +42,15 @@ ndr_print_array_uint8: void (struct ndr_print *, const char *, const uint8_t *,
 ndr_print_bad_level: void (struct ndr_print *, const char *, uint16_t)
 ndr_print_bitmap_flag: void (struct ndr_print *, size_t, const char *, uint32_t, uint32_t)
 ndr_print_bool: void (struct ndr_print *, const char *, const bool)
-ndr_print_debug: bool (int, ndr_print_fn_t, const char *, void *, const char *, const char *)
+ndr_print_debug: bool (int, ndr_print_fn_t, const char *, const void *, const char *, const char *)
 ndr_print_debug_helper: void (struct ndr_print *, const char *, ...)
-ndr_print_debugc: void (int, ndr_print_fn_t, const char *, void *)
+ndr_print_debugc: void (int, ndr_print_fn_t, const char *, const void *)
 ndr_print_debugc_helper: void (struct ndr_print *, const char *, ...)
 ndr_print_dlong: void (struct ndr_print *, const char *, int64_t)
 ndr_print_double: void (struct ndr_print *, const char *, double)
 ndr_print_enum: void (struct ndr_print *, const char *, const char *, const char *, uint32_t)
-ndr_print_function_debug: void (ndr_print_function_t, const char *, ndr_flags_type, void *)
-ndr_print_function_string: char *(TALLOC_CTX *, ndr_print_function_t, const char *, ndr_flags_type, void *)
+ndr_print_function_debug: void (ndr_print_function_t, const char *, ndr_flags_type, const void *)
+ndr_print_function_string: char *(TALLOC_CTX *, ndr_print_function_t, const char *, ndr_flags_type, const void *)
 ndr_print_gid_t: void (struct ndr_print *, const char *, gid_t)
 ndr_print_hyper: void (struct ndr_print *, const char *, uint64_t)
 ndr_print_int16: void (struct ndr_print *, const char *, int16_t)
@@ -76,7 +76,7 @@ ndr_print_string: void (struct ndr_print *, const char *, const char *)
 ndr_print_string_array: void (struct ndr_print *, const char *, const char **)
 ndr_print_string_helper: void (struct ndr_print *, const char *, ...)
 ndr_print_struct: void (struct ndr_print *, const char *, const char *)
-ndr_print_struct_string: char *(TALLOC_CTX *, ndr_print_fn_t, const char *, void *)
+ndr_print_struct_string: char *(TALLOC_CTX *, ndr_print_fn_t, const char *, const void *)
 ndr_print_svcctl_ServerType: void (struct ndr_print *, const char *, uint32_t)
 ndr_print_time_t: void (struct ndr_print *, const char *, time_t)
 ndr_print_timespec: void (struct ndr_print *, const char *, const struct timespec *)
@@ -90,8 +90,8 @@ ndr_print_uint32: void (struct ndr_print *, const char *, uint32_t)
 ndr_print_uint3264: void (struct ndr_print *, const char *, uint32_t)
 ndr_print_uint8: void (struct ndr_print *, const char *, uint8_t)
 ndr_print_union: void (struct ndr_print *, const char *, int, const char *)
-ndr_print_union_debug: void (ndr_print_fn_t, const char *, uint32_t, void *)
-ndr_print_union_string: char *(TALLOC_CTX *, ndr_print_fn_t, const char *, uint32_t, void *)
+ndr_print_union_debug: void (ndr_print_fn_t, const char *, uint32_t, const void *)
+ndr_print_union_string: char *(TALLOC_CTX *, ndr_print_fn_t, const char *, uint32_t, const void *)
 ndr_print_winreg_Data: void (struct ndr_print *, const char *, const union winreg_Data *)
 ndr_print_winreg_Data_GPO: void (struct ndr_print *, const char *, const union winreg_Data_GPO *)
 ndr_print_winreg_Type: void (struct ndr_print *, const char *, enum winreg_Type)
@@ -271,5 +271,5 @@ ndr_token_peek_cmp_fn: enum ndr_err_code (struct ndr_token_list *, const void *,
 ndr_token_retrieve: enum ndr_err_code (struct ndr_token_list *, const void *, uint32_t *)
 ndr_token_store: enum ndr_err_code (TALLOC_CTX *, struct ndr_token_list *, const void *, uint32_t)
 ndr_transfer_syntax_ndr: uuid = {time_low = 2324192516, time_mid = 7403, time_hi_and_version = 4553, clock_seq = "\237\350", node = "\b\000+\020H`"}, if_version = 2
-ndr_transfer_syntax_ndr64: uuid = {time_low = 1903232307, time_mid = 48826, time_hi_and_version = 18743, clock_seq = "\203\031", node = "\265\333\357\234\3146"}, if_version = 1
+ndr_transfer_syntax_ndr64: uuid = {time_low = 1903232307, time_mid = 48826, time_hi_and_version = 18743, clock_seq = "\203\031", node = "\265\333\357\234\314\066"}, if_version = 1
 ndr_zero_memory: void (void *, size_t)
index c8cf6ee1d45199067f20ef5caa7a3e0e963be7c4..91d1cdac838942261ed5ae0c79810187d6a3e4d8 100644 (file)
@@ -663,15 +663,38 @@ void ndr_print_debug_helper(struct ndr_print *ndr, const char *format, ...) PRIN
 void ndr_print_debugc_helper(struct ndr_print *ndr, const char *format, ...) PRINTF_ATTRIBUTE(2,3);
 void ndr_print_printf_helper(struct ndr_print *ndr, const char *format, ...) PRINTF_ATTRIBUTE(2,3);
 void ndr_print_string_helper(struct ndr_print *ndr, const char *format, ...) PRINTF_ATTRIBUTE(2,3);
-bool ndr_print_debug(int level, ndr_print_fn_t fn, const char *name, void *ptr, const char *location, const char *function);
-void ndr_print_debugc(int dbgc_class, ndr_print_fn_t fn, const char *name, void *ptr);
-void ndr_print_union_debug(ndr_print_fn_t fn, const char *name, uint32_t level, void *ptr);
-void ndr_print_function_debug(ndr_print_function_t fn, const char *name, ndr_flags_type flags, void *ptr);
-char *ndr_print_struct_string(TALLOC_CTX *mem_ctx, ndr_print_fn_t fn, const char *name, void *ptr);
-char *ndr_print_union_string(TALLOC_CTX *mem_ctx, ndr_print_fn_t fn, const char *name, uint32_t level, void *ptr);
+bool ndr_print_debug(int level,
+                    ndr_print_fn_t fn,
+                    const char *name,
+                    const void *ptr,
+                    const char *location,
+                    const char *function);
+void ndr_print_debugc(int dbgc_class,
+                     ndr_print_fn_t fn,
+                     const char *name,
+                     const void *ptr);
+void ndr_print_union_debug(ndr_print_fn_t fn,
+                          const char *name,
+                          uint32_t level,
+                          const void *ptr);
+void ndr_print_function_debug(ndr_print_function_t fn,
+                             const char *name,
+                             ndr_flags_type flags,
+                             const void *ptr);
+char *ndr_print_struct_string(TALLOC_CTX *mem_ctx,
+                             ndr_print_fn_t fn,
+                             const char *name,
+                             const void *ptr);
+char *ndr_print_union_string(TALLOC_CTX *mem_ctx,
+                            ndr_print_fn_t fn,
+                            const char *name,
+                            uint32_t level,
+                            const void *ptr);
 char *ndr_print_function_string(TALLOC_CTX *mem_ctx,
-                               ndr_print_function_t fn, const char *name,
-                               ndr_flags_type flags, void *ptr);
+                               ndr_print_function_t fn,
+                               const char *name,
+                               ndr_flags_type flags,
+                               const void *ptr);
 void ndr_set_flags(libndr_flags *pflags, libndr_flags new_flags);
 enum ndr_err_code _ndr_pull_error(struct ndr_pull *ndr,
                                  enum ndr_err_code ndr_err,
index c07bd233a93e469d94a9d9e90ac5ec75ff9a1eab..ece7f56a1a8394bb5f59ebb1ff542132eede6c7b 100644 (file)
@@ -406,7 +406,10 @@ _PUBLIC_ void ndr_print_string_helper(struct ndr_print *ndr, const char *format,
 /*
   a useful helper function for printing idl structures via DEBUGC()
 */
-_PUBLIC_ void ndr_print_debugc(int dbgc_class, ndr_print_fn_t fn, const char *name, void *ptr)
+_PUBLIC_ void ndr_print_debugc(int dbgc_class,
+                              ndr_print_fn_t fn,
+                              const char *name,
+                              const void *ptr)
 {
        struct ndr_print *ndr;
 
@@ -434,7 +437,7 @@ _PUBLIC_ void ndr_print_debugc(int dbgc_class, ndr_print_fn_t fn, const char *na
 _PUBLIC_ bool ndr_print_debug(int level,
                              ndr_print_fn_t fn,
                              const char *name,
-                             void *ptr,
+                             const void *ptr,
                              const char *location,
                              const char *function)
 {
@@ -468,7 +471,10 @@ fail:
 /*
   a useful helper function for printing idl unions via DEBUG()
 */
-_PUBLIC_ void ndr_print_union_debug(ndr_print_fn_t fn, const char *name, uint32_t level, void *ptr)
+_PUBLIC_ void ndr_print_union_debug(ndr_print_fn_t fn,
+                                   const char *name,
+                                   uint32_t level,
+                                   const void *ptr)
 {
        struct ndr_print *ndr;
 
@@ -493,7 +499,10 @@ _PUBLIC_ void ndr_print_union_debug(ndr_print_fn_t fn, const char *name, uint32_
 /*
   a useful helper function for printing idl function calls via DEBUG()
 */
-_PUBLIC_ void ndr_print_function_debug(ndr_print_function_t fn, const char *name, ndr_flags_type flags, void *ptr)
+_PUBLIC_ void ndr_print_function_debug(ndr_print_function_t fn,
+                                      const char *name,
+                                      ndr_flags_type flags,
+                                      const void *ptr)
 {
        struct ndr_print *ndr;
 
@@ -517,7 +526,10 @@ _PUBLIC_ void ndr_print_function_debug(ndr_print_function_t fn, const char *name
 /*
   a useful helper function for printing idl structures to a string
 */
-_PUBLIC_ char *ndr_print_struct_string(TALLOC_CTX *mem_ctx, ndr_print_fn_t fn, const char *name, void *ptr)
+_PUBLIC_ char *ndr_print_struct_string(TALLOC_CTX *mem_ctx,
+                                      ndr_print_fn_t fn,
+                                      const char *name,
+                                      const void *ptr)
 {
        struct ndr_print *ndr;
        char *ret = NULL;
@@ -542,7 +554,11 @@ failed:
 /*
   a useful helper function for printing idl unions to a string
 */
-_PUBLIC_ char *ndr_print_union_string(TALLOC_CTX *mem_ctx, ndr_print_fn_t fn, const char *name, uint32_t level, void *ptr)
+_PUBLIC_ char *ndr_print_union_string(TALLOC_CTX *mem_ctx,
+                                     ndr_print_fn_t fn,
+                                     const char *name,
+                                     uint32_t level,
+                                     const void *ptr)
 {
        struct ndr_print *ndr;
        char *ret = NULL;
@@ -568,8 +584,10 @@ failed:
   a useful helper function for printing idl function calls to a string
 */
 _PUBLIC_ char *ndr_print_function_string(TALLOC_CTX *mem_ctx,
-                               ndr_print_function_t fn, const char *name,
-                               ndr_flags_type flags, void *ptr)
+                                        ndr_print_function_t fn,
+                                        const char *name,
+                                        ndr_flags_type flags,
+                                        const void *ptr)
 {
        struct ndr_print *ndr;
        char *ret = NULL;