Skip to content

Commit 4cddeee

Browse files
committed
Fix GCC 8 warnings
1 parent 0d47b16 commit 4cddeee

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

include/tacho_motor_class.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ struct tacho_motor_params {
106106
struct tacho_motor_device {
107107
const char *driver_name;
108108
const char *address;
109-
const struct tacho_motor_ops const *ops;
110-
const struct ev3_motor_info const *info;
109+
const struct tacho_motor_ops *ops;
110+
const struct ev3_motor_info *info;
111111
void *context;
112112
struct tacho_motor_params params;
113113
struct tacho_motor_params active_params;

lms2012/d_iic.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,9 @@ static enum hrtimer_restart Device1TimerInterrupt1(struct hrtimer *pTimer)
316316
{
317317
if (IicPortReceive(Port, TmpBuffer) != BUSY) {
318318
if (TmpBuffer[0] == 0x60) {
319-
memcpy(IicStrings[Port].Manufacturer, "LEGO", IIC_NAME_LENGTH);
319+
memcpy(IicStrings[Port].Manufacturer, "LEGO\0\0\0\0", IIC_NAME_LENGTH);
320320
IicStrings[Port].Manufacturer[IIC_NAME_LENGTH] = 0;
321-
memcpy(IicStrings[Port].SensorType, "Temp.", IIC_NAME_LENGTH);
321+
memcpy(IicStrings[Port].SensorType, "Temp.\0\0\0", IIC_NAME_LENGTH);
322322
IicStrings[Port].SensorType[IIC_NAME_LENGTH] = 0;
323323

324324
pIic->Changed[Port] = 1;
@@ -386,7 +386,7 @@ static enum hrtimer_restart Device1TimerInterrupt1(struct hrtimer *pTimer)
386386
}
387387
} else {
388388
if (TmpBuffer[0] == 0) {
389-
memcpy(IicStrings[Port].Manufacturer, "LEGO", IIC_NAME_LENGTH);
389+
memcpy(IicStrings[Port].Manufacturer, "LEGO\0\0\0\0", IIC_NAME_LENGTH);
390390
IicStrings[Port].Manufacturer[IIC_NAME_LENGTH] = 0;
391391
}
392392
IicPort[Port].Initialised = 1;
@@ -429,11 +429,11 @@ static enum hrtimer_restart Device1TimerInterrupt1(struct hrtimer *pTimer)
429429
case IIC_TYPE_READ:
430430
{
431431
if (IicPortReceive(Port, TmpBuffer) != BUSY) {
432-
memcpy((void*)IicStrings[Port].SensorType, (void*)TmpBuffer, IIC_NAME_LENGTH);
432+
memcpy(IicStrings[Port].SensorType, TmpBuffer, IIC_NAME_LENGTH);
433433
IicStrings[Port].SensorType[IIC_NAME_LENGTH] = 0;
434434

435435
if (TmpBuffer[0] == 0) {
436-
memcpy((void*)IicStrings[Port].SensorType, (void*)"Store", IIC_NAME_LENGTH);
436+
memcpy(IicStrings[Port].SensorType, "Store\0\0\0", IIC_NAME_LENGTH);
437437
IicStrings[Port].Manufacturer[IIC_NAME_LENGTH] = 0;
438438
}
439439

0 commit comments

Comments
 (0)