mirror of
https://github.com/samba-team/samba.git
synced 2025-08-04 08:22:08 +03:00
s3/registry: Fix incompatible func casts
[3425/3524] Compiling source3/registry/reg_parse.c ../../source3/registry/reg_parse.c: In function ‘reg_parse_new’: ../../source3/registry/reg_parse.c:223:12: error: cast between incompatible function types from ‘int (*)(void *)’ to ‘int (*)(void *, const char **, size_t, _Bool)’ {aka ‘int (*)(void *, const char **, long unsigned int, _Bool)’} [-Werror=cast-function-type] cb.key = (reg_parse_callback_key_t)&nop; ^ ../../source3/registry/reg_parse.c:226:12: error: cast between incompatible function types from ‘int (*)(void *)’ 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] cb.val = (reg_parse_callback_val_t)&nop; ^ ../../source3/registry/reg_parse.c:229:16: error: cast between incompatible function types from ‘int (*)(void *)’ to ‘int (*)(void *, const char *)’ [-Werror=cast-function-type] cb.val_del = (reg_parse_callback_val_del_t)&nop; ^ ../../source3/registry/reg_parse.c:232:16: error: cast between incompatible function types from ‘int (*)(void *)’ to ‘int (*)(void *, const char *)’ [-Werror=cast-function-type] cb.comment = (reg_parse_callback_comment_t)&nop; Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
committed by
Andrew Bartlett
parent
658128e2b9
commit
61dd7d6f06
@ -192,11 +192,27 @@ static bool act_comment (struct reg_parse* p, const char* txt)
|
|||||||
/**@}*/
|
/**@}*/
|
||||||
|
|
||||||
|
|
||||||
static int nop(void* data)
|
static int nop_callback_key(void* private_data,
|
||||||
|
const char* key[],
|
||||||
|
size_t klen,
|
||||||
|
bool del)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int nop_callback_val(void* private_data,
|
||||||
|
const char* name,
|
||||||
|
uint32_t type,
|
||||||
|
const uint8_t* data,
|
||||||
|
size_t len)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int nop_callback_del(void* data, const char* str)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
struct reg_parse* reg_parse_new(const void* ctx,
|
struct reg_parse* reg_parse_new(const void* ctx,
|
||||||
struct reg_parse_callback cb,
|
struct reg_parse_callback cb,
|
||||||
@ -220,16 +236,17 @@ struct reg_parse* reg_parse_new(const void* ctx,
|
|||||||
|
|
||||||
s->valtype = 0;
|
s->valtype = 0;
|
||||||
if (cb.key == NULL) {
|
if (cb.key == NULL) {
|
||||||
cb.key = (reg_parse_callback_key_t)&nop;
|
cb.key = (reg_parse_callback_key_t)&nop_callback_key;
|
||||||
}
|
}
|
||||||
if (cb.val == NULL) {
|
if (cb.val == NULL) {
|
||||||
cb.val = (reg_parse_callback_val_t)&nop;
|
cb.val = (reg_parse_callback_val_t)&nop_callback_val;
|
||||||
}
|
}
|
||||||
if (cb.val_del == NULL) {
|
if (cb.val_del == NULL) {
|
||||||
cb.val_del = (reg_parse_callback_val_del_t)&nop;
|
cb.val_del = (reg_parse_callback_val_del_t)&nop_callback_del;
|
||||||
}
|
}
|
||||||
if (cb.comment == NULL) {
|
if (cb.comment == NULL) {
|
||||||
cb.comment = (reg_parse_callback_comment_t)&nop;
|
cb.comment =
|
||||||
|
(reg_parse_callback_comment_t)&nop_callback_del;
|
||||||
}
|
}
|
||||||
|
|
||||||
s->call = cb;
|
s->call = cb;
|
||||||
|
Reference in New Issue
Block a user