t
Fork of mbed-dev by
Diff: platform/Callback.h
- Revision:
- 176:af195413fb11
- Parent:
- 168:e84263d55307
--- 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; }