From 1c3d2876ac2b5212976bde9cd4fdea485a366ab9 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Thu, 23 Sep 2021 17:09:16 -0400
Subject: [PATCH] DRTVWR-543: Consistently use ClassicCallback<USERDATA>
 throughout.

---
 indra/llcommon/classic_callback.h              | 4 ++--
 indra/llcommon/tests/classic_callback_test.cpp | 8 +-------
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/indra/llcommon/classic_callback.h b/indra/llcommon/classic_callback.h
index 76ff9c23391..1ad6dbc58fd 100644
--- a/indra/llcommon/classic_callback.h
+++ b/indra/llcommon/classic_callback.h
@@ -167,9 +167,9 @@ class ClassicCallback
     template <typename... Args>
     static USERDATA extract_userdata(Args... args)
     {
-        // Search for the first void* parameter type, then extract that pointer.
+        // Search for the first USERDATA parameter type, then extract that pointer.
         // extract value from parameter pack: http://stackoverflow.com/a/24710433/5533635
-        return std::get<index_of<0, void*, Args...>::value>(std::forward_as_tuple(args...));
+        return std::get<index_of<0, USERDATA, Args...>::value>(std::forward_as_tuple(args...));
     }
 
     CALLABLE mCallable;
diff --git a/indra/llcommon/tests/classic_callback_test.cpp b/indra/llcommon/tests/classic_callback_test.cpp
index 232532b1c1d..c060775c241 100644
--- a/indra/llcommon/tests/classic_callback_test.cpp
+++ b/indra/llcommon/tests/classic_callback_test.cpp
@@ -22,7 +22,7 @@
 #include "../test/lltut.h"
 
 /*****************************************************************************
-*   example callback accepting only (void* userdata)
+*   example callback
 *****************************************************************************/
 // callback_t is part of the specification of someAPI()
 typedef void (*callback_t)(const char*, void*);
@@ -47,12 +47,6 @@ struct MyCallback
     std::string mMsg;
 };
 
-// a function for which I want to bind other data
-void callback_with_extra(const std::string& extra, void*)
-{
-    std::cout << "callback_with_extra('" << extra << "', *)\n";
-}
-
 /*****************************************************************************
 *   example callback accepting several params, and void* userdata isn't first
 *****************************************************************************/
-- 
GitLab