Changes from feedback - use source instead of type in sizeof()

This commit is contained in:
Bruce Luckcuck 2018-07-22 13:40:20 -04:00
parent 9745547175
commit 68906f990b
1 changed files with 9 additions and 9 deletions

View File

@ -736,7 +736,7 @@ static void printRxFailsafe(uint8_t dumpMask, const rxFailsafeChannelConfig_t *r
for (uint32_t channel = 0; channel < MAX_SUPPORTED_RC_CHANNEL_COUNT; channel++) {
const rxFailsafeChannelConfig_t *channelFailsafeConfig = &rxFailsafeChannelConfigs[channel];
const rxFailsafeChannelConfig_t *defaultChannelFailsafeConfig = &defaultRxFailsafeChannelConfigs[channel];
const bool equalsDefault = !memcmp(channelFailsafeConfig, defaultChannelFailsafeConfig, sizeof(rxFailsafeChannelConfig_t));
const bool equalsDefault = !memcmp(channelFailsafeConfig, defaultChannelFailsafeConfig, sizeof(*channelFailsafeConfig));
const bool requireValue = channelFailsafeConfig->mode == RX_FAILSAFE_MODE_SET;
if (requireValue) {
const char *format = "rxfail %u %c %d";
@ -855,7 +855,7 @@ static void printAux(uint8_t dumpMask, const modeActivationCondition_t *modeActi
bool equalsDefault = false;
if (defaultModeActivationConditions) {
const modeActivationCondition_t *macDefault = &defaultModeActivationConditions[i];
equalsDefault = !memcmp(mac, macDefault, sizeof(modeActivationCondition_t));
equalsDefault = !memcmp(mac, macDefault, sizeof(*mac));
const box_t *box = findBoxByBoxId(macDefault->modeId);
const box_t *linkedTo = findBoxByBoxId(macDefault->linkedTo);
if (box) {
@ -965,7 +965,7 @@ static void printSerial(uint8_t dumpMask, const serialConfig_t *serialConfig, co
};
bool equalsDefault = false;
if (serialConfigDefault) {
equalsDefault = !memcmp(&serialConfig->portConfigs[i], &serialConfigDefault->portConfigs[i], sizeof(serialPortConfig_t));
equalsDefault = !memcmp(&serialConfig->portConfigs[i], &serialConfigDefault->portConfigs[i], sizeof(serialConfig->portConfigs[i]));
cliDefaultPrintLinef(dumpMask, equalsDefault, format,
serialConfigDefault->portConfigs[i].identifier,
serialConfigDefault->portConfigs[i].functionMask,
@ -1214,7 +1214,7 @@ static void printAdjustmentRange(uint8_t dumpMask, const adjustmentRange_t *adju
bool equalsDefault = false;
if (defaultAdjustmentRanges) {
const adjustmentRange_t *arDefault = &defaultAdjustmentRanges[i];
equalsDefault = !memcmp(ar, arDefault, sizeof(adjustmentRange_t));
equalsDefault = !memcmp(ar, arDefault, sizeof(*ar));
cliDefaultPrintLinef(dumpMask, equalsDefault, format,
i,
arDefault->adjustmentIndex,
@ -1447,7 +1447,7 @@ static void printRxRange(uint8_t dumpMask, const rxChannelRangeConfig_t *channel
for (uint32_t i = 0; i < NON_AUX_CHANNEL_COUNT; i++) {
bool equalsDefault = false;
if (defaultChannelRangeConfigs) {
equalsDefault = !memcmp(&channelRangeConfigs[i], &defaultChannelRangeConfigs[i], sizeof(rxChannelRangeConfig_t));
equalsDefault = !memcmp(&channelRangeConfigs[i], &defaultChannelRangeConfigs[i], sizeof(channelRangeConfigs[i]));
cliDefaultPrintLinef(dumpMask, equalsDefault, format,
i,
defaultChannelRangeConfigs[i].min,
@ -1565,7 +1565,7 @@ static void printColor(uint8_t dumpMask, const hsvColor_t *colors, const hsvColo
bool equalsDefault = false;
if (defaultColors) {
const hsvColor_t *colorDefault = &defaultColors[i];
equalsDefault = !memcmp(color, colorDefault, sizeof(hsvColor_t));
equalsDefault = !memcmp(color, colorDefault, sizeof(*color));
cliDefaultPrintLinef(dumpMask, equalsDefault, format, i,colorDefault->h, colorDefault->s, colorDefault->v);
}
cliDumpPrintLinef(dumpMask, equalsDefault, format, i, color->h, color->s, color->v);
@ -1674,7 +1674,7 @@ static void printServo(uint8_t dumpMask, const servoParam_t *servoParams, const
bool equalsDefault = false;
if (defaultServoParams) {
const servoParam_t *defaultServoConf = &defaultServoParams[i];
equalsDefault = !memcmp(servoConf, defaultServoConf, sizeof(servoParam_t));
equalsDefault = !memcmp(servoConf, defaultServoConf, sizeof(*servoConf));
cliDefaultPrintLinef(dumpMask, equalsDefault, format,
i,
defaultServoConf->min,
@ -1816,7 +1816,7 @@ static void printServoMix(uint8_t dumpMask, const servoMixer_t *customServoMixer
bool equalsDefault = false;
if (defaultCustomServoMixers) {
servoMixer_t customServoMixerDefault = defaultCustomServoMixers[i];
equalsDefault = !memcmp(&customServoMixer, &customServoMixerDefault, sizeof(servoMixer_t));
equalsDefault = !memcmp(&customServoMixer, &customServoMixerDefault, sizeof(customServoMixer));
cliDefaultPrintLinef(dumpMask, equalsDefault, format,
i,
@ -2142,7 +2142,7 @@ static void printVtx(uint8_t dumpMask, const vtxConfig_t *vtxConfig, const vtxCo
const vtxChannelActivationCondition_t *cac = &vtxConfig->vtxChannelActivationConditions[i];
if (vtxConfigDefault) {
const vtxChannelActivationCondition_t *cacDefault = &vtxConfigDefault->vtxChannelActivationConditions[i];
equalsDefault = !memcmp(cac, cacDefault, sizeof(vtxChannelActivationCondition_t));
equalsDefault = !memcmp(cac, cacDefault, sizeof(*cac));
cliDefaultPrintLinef(dumpMask, equalsDefault, format,
i,
cacDefault->auxChannelIndex,