Replace a lot of memset with {} initializers

This commit is contained in:
Matthias Grob
2019-10-15 10:01:03 -04:00
committed by Daniel Agar
parent b8f70e865c
commit e843090383
12 changed files with 35 additions and 80 deletions
+1 -2
View File
@@ -274,8 +274,7 @@ int set_min_pwm(int fd, unsigned long max_channels, int pwm_value)
{
int ret;
struct pwm_output_values pwm_values;
memset(&pwm_values, 0, sizeof(pwm_values));
struct pwm_output_values pwm_values {};
pwm_values.channel_count = max_channels;
+4 -12
View File
@@ -415,9 +415,7 @@ pwm_main(int argc, char *argv[])
return 1;
}
struct pwm_output_values pwm_values;
memset(&pwm_values, 0, sizeof(pwm_values));
struct pwm_output_values pwm_values {};
pwm_values.channel_count = servo_count;
@@ -471,9 +469,7 @@ pwm_main(int argc, char *argv[])
return 1;
}
struct pwm_output_values pwm_values;
memset(&pwm_values, 0, sizeof(pwm_values));
struct pwm_output_values pwm_values {};
pwm_values.channel_count = servo_count;
@@ -526,9 +522,7 @@ pwm_main(int argc, char *argv[])
PX4_WARN("reading disarmed value of zero, disabling disarmed PWM");
}
struct pwm_output_values pwm_values;
memset(&pwm_values, 0, sizeof(pwm_values));
struct pwm_output_values pwm_values {};
pwm_values.channel_count = servo_count;
@@ -582,9 +576,7 @@ pwm_main(int argc, char *argv[])
return 1;
}
struct pwm_output_values pwm_values;
memset(&pwm_values, 0, sizeof(pwm_values));
struct pwm_output_values pwm_values {};
pwm_values.channel_count = servo_count;