Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys void * cast the probe functions that take more than ...



details:   https://anonhg.NetBSD.org/src/rev/0580ea20d99e
branches:  trunk
changeset: 966165:0580ea20d99e
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Oct 16 15:08:09 2019 +0000

description:
void * cast the probe functions that take more than 5 uintptr_t arguments
(dtrace_probe takes 5).

diffstat:

 sys/sys/sdt.h |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (33 lines):

diff -r 5c760e48eacb -r 0580ea20d99e sys/sys/sdt.h
--- a/sys/sys/sdt.h     Wed Oct 16 15:01:56 2019 +0000
+++ b/sys/sys/sdt.h     Wed Oct 16 15:08:09 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdt.h,v 1.10 2018/08/26 16:54:38 riastradh Exp $       */
+/*     $NetBSD: sdt.h,v 1.11 2019/10/16 15:08:09 christos Exp $        */
 
 /*-
  * Copyright 2006-2008 John Birrell <jb%FreeBSD.org@localhost>
@@ -309,11 +309,13 @@
        SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, 0)
 #define        SDT_PROBE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) \
        SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4)
+/* XXX: void * function casts */
 #define        SDT_PROBE6(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5)  \
        do {                                                                   \
                if (sdt_##prov##_##mod##_##func##_##name->id)                  \
                        (*(void (*)(uint32_t, uintptr_t, uintptr_t, uintptr_t, \
-                           uintptr_t, uintptr_t, uintptr_t))sdt_probe_func)(  \
+                           uintptr_t, uintptr_t, uintptr_t))(void *)          \
+                           sdt_probe_func)(                                   \
                            sdt_##prov##_##mod##_##func##_##name->id,          \
                            (uintptr_t)arg0, (uintptr_t)arg1, (uintptr_t)arg2, \
                            (uintptr_t)arg3, (uintptr_t)arg4, (uintptr_t)arg5);\
@@ -324,7 +326,7 @@
                if (sdt_##prov##_##mod##_##func##_##name->id)                  \
                        (*(void (*)(uint32_t, uintptr_t, uintptr_t, uintptr_t, \
                            uintptr_t, uintptr_t, uintptr_t, uintptr_t))       \
-                           sdt_probe_func)(                                   \
+                           (void *)sdt_probe_func)(                           \
                            sdt_##prov##_##mod##_##func##_##name->id,          \
                            (uintptr_t)arg0, (uintptr_t)arg1, (uintptr_t)arg2, \
                            (uintptr_t)arg3, (uintptr_t)arg4, (uintptr_t)arg5, \



Home | Main Index | Thread Index | Old Index