summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Thomas Preud'homme2013-02-10 20:16:17 +0100
committerGravatar Nikias Bassen2013-02-10 20:16:17 +0100
commit7cbf283090ec273c006a14129eee8bba1885da58 (patch)
tree2a865fb9254e84a81fa2d7c0a39f3f89a31a78e3
parentea5c8334de82d6e9f0705e8a2c4a3ab0b29731ad (diff)
downloadlibvformat-7cbf283090ec273c006a14129eee8bba1885da58.tar.gz
libvformat-7cbf283090ec273c006a14129eee8bba1885da58.tar.bz2
Cast NULL in void * in functions using va_arg
NULL isn't necessary a zero value. For instance, on AMD64 architecture, a null pointer is 0x7fff00000000. Usually things works automagically as the compiler always cast NULL and 0 in void * if stored in a pointer variable. But with functions with variable number of arguments the compiler can't know the type of the arguments and thus don't make the cast. In consequences, NULL and 0 must be cast explicitely in void * if the parameter is a pointer.
-rw-r--r--test/vformat.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/vformat.c b/test/vformat.c
index b4a753d..40c299e 100644
--- a/test/vformat.c
+++ b/test/vformat.c
@@ -489,19 +489,19 @@ static void check_extract_fields(
}
printf(" Looking for {%s, %s}...\n", p_array[0], p_array[1]);
- if (vf_get_property(&p_tmp, p_object, VFGP_FIND, NULL, p_array[0], p_array[1], NULL))
+ if (vf_get_property(&p_tmp, p_object, VFGP_FIND, NULL, p_array[0], p_array[1], (void *) NULL))
{
print_search_results(p_tmp);
}
printf(" Looking for {%s, %s}...\n", p_array[0], p_array[2]);
- if (vf_get_property(&p_tmp, p_object, VFGP_FIND, NULL, p_array[0], p_array[2], NULL))
+ if (vf_get_property(&p_tmp, p_object, VFGP_FIND, NULL, p_array[0], p_array[2], (void *) NULL))
{
print_search_results(p_tmp);
}
printf(" Looking for {%s, %s, %s}...\n", p_array[0], p_array[1], p_array[2]);
- if (vf_get_property(&p_tmp, p_object, VFGP_FIND, NULL, p_array[0], p_array[1], p_array[2], NULL))
+ if (vf_get_property(&p_tmp, p_object, VFGP_FIND, NULL, p_array[0], p_array[1], p_array[2], (void *) NULL))
{
print_search_results(p_tmp);
}