Use uint8_t* not void* in memcpy()

Computrainer spinscan memcpy() used offsets
but failed to declare the datatype used by
pointers.

Interestingly, some compilers will assume a
void* points to a byte, whilst others will
rightly complain.
This commit is contained in:
Mark Liversedge
2011-12-04 14:31:04 +00:00
parent 70c8f0223c
commit 362bc06f72

View File

@@ -373,8 +373,8 @@ void Computrainer::unpackTelemetry(int &ss1, int &ss2, int &ss3, int &buttons, i
value12 = value8 | (b1&7)<<9 | (b3&2)<<7;
if (buttons&64) {
memcpy((void*)spinScan, (void*)ss+3, 21);
memcpy((void*)spinScan+21, (void*)ss, 3);
memcpy((uint8_t*)spinScan, (uint8_t*)ss+3, 21);
memcpy((uint8_t*)spinScan+21, (uint8_t*)ss, 3);
//for (pos=0; pos<24; pos++) fprintf(stderr, "%d, ", ss[pos]);
//fprintf(stderr, "\n");
pos=0;