summaryrefslogtreecommitdiffstats
path: root/test/unit/prof_thread_name.c
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2016-10-28 04:31:25 (GMT)
committerJason Evans <jasone@canonware.com>2016-10-28 04:31:25 (GMT)
commit977103c897225a4ab0380f09adc67b4c43143521 (patch)
tree8052c549b5e37c0eb5347a92aa796ae7cd7b556a /test/unit/prof_thread_name.c
parent44df4a45cf587db8adee7edff4acfb96bfd3d670 (diff)
downloadjemalloc-977103c897225a4ab0380f09adc67b4c43143521.zip
jemalloc-977103c897225a4ab0380f09adc67b4c43143521.tar.gz
jemalloc-977103c897225a4ab0380f09adc67b4c43143521.tar.bz2
Uniformly cast mallctl[bymib]() oldp/newp arguments to (void *).
This avoids warnings in some cases, and is otherwise generally good hygiene.
Diffstat (limited to 'test/unit/prof_thread_name.c')
-rw-r--r--test/unit/prof_thread_name.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/test/unit/prof_thread_name.c b/test/unit/prof_thread_name.c
index f501158..9ec5497 100644
--- a/test/unit/prof_thread_name.c
+++ b/test/unit/prof_thread_name.c
@@ -12,8 +12,9 @@ mallctl_thread_name_get_impl(const char *thread_name_expected, const char *func,
size_t sz;
sz = sizeof(thread_name_old);
- assert_d_eq(mallctl("thread.prof.name", &thread_name_old, &sz, NULL, 0),
- 0, "%s():%d: Unexpected mallctl failure reading thread.prof.name",
+ assert_d_eq(mallctl("thread.prof.name", (void *)&thread_name_old, &sz,
+ NULL, 0), 0,
+ "%s():%d: Unexpected mallctl failure reading thread.prof.name",
func, line);
assert_str_eq(thread_name_old, thread_name_expected,
"%s():%d: Unexpected thread.prof.name value", func, line);
@@ -26,8 +27,8 @@ mallctl_thread_name_set_impl(const char *thread_name, const char *func,
int line)
{
- assert_d_eq(mallctl("thread.prof.name", NULL, NULL, &thread_name,
- sizeof(thread_name)), 0,
+ assert_d_eq(mallctl("thread.prof.name", NULL, NULL,
+ (void *)&thread_name, sizeof(thread_name)), 0,
"%s():%d: Unexpected mallctl failure reading thread.prof.name",
func, line);
mallctl_thread_name_get_impl(thread_name, func, line);
@@ -46,15 +47,15 @@ TEST_BEGIN(test_prof_thread_name_validation)
/* NULL input shouldn't be allowed. */
thread_name = NULL;
- assert_d_eq(mallctl("thread.prof.name", NULL, NULL, &thread_name,
- sizeof(thread_name)), EFAULT,
+ assert_d_eq(mallctl("thread.prof.name", NULL, NULL,
+ (void *)&thread_name, sizeof(thread_name)), EFAULT,
"Unexpected mallctl result writing \"%s\" to thread.prof.name",
thread_name);
/* '\n' shouldn't be allowed. */
thread_name = "hi\nthere";
- assert_d_eq(mallctl("thread.prof.name", NULL, NULL, &thread_name,
- sizeof(thread_name)), EFAULT,
+ assert_d_eq(mallctl("thread.prof.name", NULL, NULL,
+ (void *)&thread_name, sizeof(thread_name)), EFAULT,
"Unexpected mallctl result writing \"%s\" to thread.prof.name",
thread_name);
@@ -64,8 +65,9 @@ TEST_BEGIN(test_prof_thread_name_validation)
size_t sz;
sz = sizeof(thread_name_old);
- assert_d_eq(mallctl("thread.prof.name", &thread_name_old, &sz,
- &thread_name, sizeof(thread_name)), EPERM,
+ assert_d_eq(mallctl("thread.prof.name",
+ (void *)&thread_name_old, &sz, (void *)&thread_name,
+ sizeof(thread_name)), EPERM,
"Unexpected mallctl result writing \"%s\" to "
"thread.prof.name", thread_name);
}