mbed library sources, mbed-dev only for TYBLE16
Fork of mbed-dev by
Please refer flowing link.
/users/kenjiArai/notebook/tyble16-module-will-become-a-mbed-family--mbedliza/
Diff: platform/Callback.h
- Revision:
- 175:af195413fb11
- Parent:
- 167:e84263d55307
- Child:
- 178:79309dc6340a
diff -r b96e65c34a4d -r af195413fb11 platform/Callback.h --- a/platform/Callback.h Mon Oct 02 15:33:19 2017 +0100 +++ b/platform/Callback.h Wed Oct 11 12:45:49 2017 +0100 @@ -77,7 +77,7 @@ */ Callback(R (*func)() = 0) { if (!func) { - _ops = 0; + memset(this, 0, sizeof(Callback)); } else { generate(func); } @@ -590,6 +590,7 @@ MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), "Type F must not exceed the size of the Callback class"); + memset(this, 0, sizeof(Callback)); new (this) F(f); _ops = &ops; } @@ -651,7 +652,7 @@ */ Callback(R (*func)(A0) = 0) { if (!func) { - _ops = 0; + memset(this, 0, sizeof(Callback)); } else { generate(func); } @@ -1165,6 +1166,7 @@ MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), "Type F must not exceed the size of the Callback class"); + memset(this, 0, sizeof(Callback)); new (this) F(f); _ops = &ops; } @@ -1226,7 +1228,7 @@ */ Callback(R (*func)(A0, A1) = 0) { if (!func) { - _ops = 0; + memset(this, 0, sizeof(Callback)); } else { generate(func); } @@ -1741,6 +1743,7 @@ MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), "Type F must not exceed the size of the Callback class"); + memset(this, 0, sizeof(Callback)); new (this) F(f); _ops = &ops; } @@ -1802,7 +1805,7 @@ */ Callback(R (*func)(A0, A1, A2) = 0) { if (!func) { - _ops = 0; + memset(this, 0, sizeof(Callback)); } else { generate(func); } @@ -2318,6 +2321,7 @@ MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), "Type F must not exceed the size of the Callback class"); + memset(this, 0, sizeof(Callback)); new (this) F(f); _ops = &ops; } @@ -2379,7 +2383,7 @@ */ Callback(R (*func)(A0, A1, A2, A3) = 0) { if (!func) { - _ops = 0; + memset(this, 0, sizeof(Callback)); } else { generate(func); } @@ -2896,6 +2900,7 @@ MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), "Type F must not exceed the size of the Callback class"); + memset(this, 0, sizeof(Callback)); new (this) F(f); _ops = &ops; } @@ -2957,7 +2962,7 @@ */ Callback(R (*func)(A0, A1, A2, A3, A4) = 0) { if (!func) { - _ops = 0; + memset(this, 0, sizeof(Callback)); } else { generate(func); } @@ -3475,6 +3480,7 @@ MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), "Type F must not exceed the size of the Callback class"); + memset(this, 0, sizeof(Callback)); new (this) F(f); _ops = &ops; }