[vlc-commits] lock debug: fix pointer aliasing

Rémi Denis-Courmont git at videolan.org
Sun Oct 27 19:24:02 CET 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Oct 27 20:13:28 2019 +0200| [45b0ccff03309183a12c79000e364d0069af282f] | committer: Rémi Denis-Courmont

lock debug: fix pointer aliasing

Tree functions return pointers to void pointers.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=45b0ccff03309183a12c79000e364d0069af282f
---

 src/misc/threads.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/misc/threads.c b/src/misc/threads.c
index 54643ba4aa..d267cc7344 100644
--- a/src/misc/threads.c
+++ b/src/misc/threads.c
@@ -82,7 +82,7 @@ static void vlc_lock_mark(const void *lock, void **rootp)
     mark->object = lock;
     mark->refs = 0;
 
-    struct vlc_lock_mark **entry = tsearch(mark, rootp, vlc_lock_mark_cmp);
+    void **entry = tsearch(mark, rootp, vlc_lock_mark_cmp);
     if (unlikely(entry == NULL))
         abort();
 
@@ -98,7 +98,7 @@ static void vlc_lock_mark(const void *lock, void **rootp)
 static void vlc_lock_unmark(const void *lock, void **rootp)
 {
     struct vlc_lock_mark *mark = &(struct vlc_lock_mark){ lock, 0 };
-    struct vlc_lock_mark **entry = tfind(mark, rootp, vlc_lock_mark_cmp);
+    void **entry = tfind(mark, rootp, vlc_lock_mark_cmp);
 
     assert(entry != NULL);
     mark = *entry;



More information about the vlc-commits mailing list