From 658128e2b9acaf859b4533b300c84d28267b1de8 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Fri, 3 May 2019 12:21:07 +0100 Subject: [PATCH] s3/registry: Fix func cast error (diff in params size_t vs uint32) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit reg_parse_callback_key_t alread has size_t for number of elemens in key but reg_parse_callback_val_t uses uint32_t for length of value data. Many internal function seem to take size_t as data len (see reg_format_value etc.) It seems changing the signature of the callback aligns it more closely with the existing api. ../../source3/registry/reg_format.c:438:10: error: cast between incompatible function types from ‘int (*)(reg_format *, const char *, uint32_t, const uint8_t *, size_t)’ {aka ‘int (*)(struct reg_format *, const char *, unsigned int, const unsigned char *, long unsigned int)’} to ‘int (*)(void *, const char *, uint32_t, const uint8_t *, uint32_t)’ {aka ‘int (*)(void *, const char *, unsigned int, const unsigned char *, unsigned int)’} [-Werror=cast-function-type] .val = (reg_parse_callback_val_t)®_format_value, Signed-off-by: Noel Power Reviewed-by: Andreas Schneider Reviewed-by: Andrew Bartlett --- source3/registry/reg_parse.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/registry/reg_parse.h b/source3/registry/reg_parse.h index 0694225ef50e..3940e3d69363 100644 --- a/source3/registry/reg_parse.h +++ b/source3/registry/reg_parse.h @@ -70,7 +70,7 @@ typedef int (*reg_parse_callback_val_t) (void* private_data, const char* name, uint32_t type, const uint8_t* data, - uint32_t len); + size_t len); /** * Protoype for function called on value delete found. -- 2.34.1