Christopher Haster / mbed-hal

Dependencies:   target-freescale

Fork of mbed-hal by Morpheus

Revision:
17:fe43695d093a
Parent:
15:1ce23ed6859a
Child:
18:8c5ec1e88a9c
--- a/api/FunctionPointer.h	Fri Apr 01 01:22:54 2016 -0500
+++ b/api/FunctionPointer.h	Tue Apr 05 20:36:18 2016 -0500
@@ -72,7 +72,7 @@
      */
     void attach(R (*function)(A1, A2, A3, A4)) {
         _object = 0;
-        *reinterpret_cast<R (**)(A1)>(_function) = function;
+        *reinterpret_cast<R (**)(A1, A2, A3, A4)>(_function) = function;
         _thunk = &FuncPtr::staticthunk;
     }
 
@@ -84,7 +84,7 @@
     template <typename T>
     void attach(T *object, R (*function)(T*, A1, A2, A3, A4)) {
         _object = static_cast<void*>(object);
-        *reinterpret_cast<R (**)(T*, A1)>(_function) = function;
+        *reinterpret_cast<R (**)(T*, A1, A2, A3, A4)>(_function) = function;
         _thunk = &FuncPtr::boundthunk<T>;
     }
 
@@ -96,7 +96,7 @@
     template<typename T>
     void attach(T *object, R (T::*method)(A1, A2, A3, A4)) {
         _object = static_cast<void*>(object);
-        *reinterpret_cast<R (T::**)(A1)>(_function) = method;
+        *reinterpret_cast<R (T::**)(A1, A2, A3, A4)>(_function) = method;
         _thunk = &FuncPtr::methodthunk<T>;
     }
 
@@ -140,7 +140,7 @@
     template<typename T>
     static R boundthunk(void *object, void *func, A1 a1, A2 a2, A3 a3, A4 a4) {
         T *o = static_cast<T*>(object);
-        R (*f)(T*, A1) = *reinterpret_cast<R (**)(T*, A1)>(func);
+        R (*f)(T*, A1, A2, A3, A4) = *reinterpret_cast<R (**)(T*, A1, A2, A3, A4)>(func);
         return f(o, a1);
     }
 
@@ -216,7 +216,7 @@
      */
     void attach(R (*function)(A1, A2, A3)) {
         _object = 0;
-        *reinterpret_cast<R (**)(A1)>(_function) = function;
+        *reinterpret_cast<R (**)(A1, A2, A3)>(_function) = function;
         _thunk = &FuncPtr::staticthunk;
     }
 
@@ -228,7 +228,7 @@
     template <typename T>
     void attach(T *object, R (*function)(T*, A1, A2, A3)) {
         _object = static_cast<void*>(object);
-        *reinterpret_cast<R (**)(T*, A1)>(_function) = function;
+        *reinterpret_cast<R (**)(T*, A1, A2, A3)>(_function) = function;
         _thunk = &FuncPtr::boundthunk<T>;
     }
 
@@ -240,7 +240,7 @@
     template<typename T>
     void attach(T *object, R (T::*method)(A1, A2, A3)) {
         _object = static_cast<void*>(object);
-        *reinterpret_cast<R (T::**)(A1)>(_function) = method;
+        *reinterpret_cast<R (T::**)(A1, A2, A3)>(_function) = method;
         _thunk = &FuncPtr::methodthunk<T>;
     }
 
@@ -284,7 +284,7 @@
     template<typename T>
     static R boundthunk(void *object, void *func, A1 a1, A2 a2, A3 a3) {
         T *o = static_cast<T*>(object);
-        R (*f)(T*, A1) = *reinterpret_cast<R (**)(T*, A1)>(func);
+        R (*f)(T*, A1, A2, A3) = *reinterpret_cast<R (**)(T*, A1, A2, A3)>(func);
         return f(o, a1);
     }
 
@@ -360,7 +360,7 @@
      */
     void attach(R (*function)(A1, A2)) {
         _object = 0;
-        *reinterpret_cast<R (**)(A1)>(_function) = function;
+        *reinterpret_cast<R (**)(A1, A2)>(_function) = function;
         _thunk = &FuncPtr::staticthunk;
     }
 
@@ -372,7 +372,7 @@
     template <typename T>
     void attach(T *object, R (*function)(T*, A1, A2)) {
         _object = static_cast<void*>(object);
-        *reinterpret_cast<R (**)(T*, A1)>(_function) = function;
+        *reinterpret_cast<R (**)(T*, A1, A2)>(_function) = function;
         _thunk = &FuncPtr::boundthunk<T>;
     }
 
@@ -384,7 +384,7 @@
     template<typename T>
     void attach(T *object, R (T::*method)(A1, A2)) {
         _object = static_cast<void*>(object);
-        *reinterpret_cast<R (T::**)(A1)>(_function) = method;
+        *reinterpret_cast<R (T::**)(A1, A2)>(_function) = method;
         _thunk = &FuncPtr::methodthunk<T>;
     }
 
@@ -428,7 +428,7 @@
     template<typename T>
     static R boundthunk(void *object, void *func, A1 a1, A2 a2) {
         T *o = static_cast<T*>(object);
-        R (*f)(T*, A1) = *reinterpret_cast<R (**)(T*, A1)>(func);
+        R (*f)(T*, A1, A2) = *reinterpret_cast<R (**)(T*, A1, A2)>(func);
         return f(o, a1);
     }