diff options
author | Noel Power <noel.power@suse.com> | 2019-05-03 12:21:07 +0100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2019-05-10 01:15:18 +0000 |
commit | 658128e2b9acaf859b4533b300c84d28267b1de8 (patch) | |
tree | d65f98c23b9cbcae8f5f5692eca311ff07028e3a /source3/registry | |
parent | 3d0f9491131e03cd33dc8a2161b86ceb22c678ab (diff) | |
download | samba-658128e2b9acaf859b4533b300c84d28267b1de8.tar.gz |
s3/registry: Fix func cast error (diff in params size_t vs uint32)
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 <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/registry')
-rw-r--r-- | source3/registry/reg_parse.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/registry/reg_parse.h b/source3/registry/reg_parse.h index 0694225ef50..3940e3d6936 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. |