From 6a0f514e2a26cc698b8afbb156928a2a92b8161b Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 1 Jan 2000 00:19:25 +0900 Subject: Simplify needlessly complex error handling when mult/div menu values --- menus.c | 44 +++++++++++--------------------------------- 1 file changed, 11 insertions(+), 33 deletions(-) (limited to 'menus.c') diff --git a/menus.c b/menus.c index aa47c32..7c3bcb5 100644 --- a/menus.c +++ b/menus.c @@ -2172,9 +2172,7 @@ static int Submenu_Mult_Value(float mult_by) switch (Submenu_Numeric_Parameter-channel) { case Show_frequency: - if (error_num=Set_frequency(0,0,0,channel,new_value)) { - Submenu_Value=new_value; - } + error_num=Set_frequency(0,0,0,channel,new_value); break; case Show_delay: @@ -2195,9 +2193,7 @@ static int Submenu_Mult_Value(float mult_by) } } - if (error_num=Set_Delay(0,0,0,channel,new_value)) { - Submenu_Value=new_value; - } + error_num=Set_Delay(0,0,0,channel,new_value); break; case Show_pw: @@ -2218,9 +2214,7 @@ static int Submenu_Mult_Value(float mult_by) } } - if (error_num=Set_Pw(0,0,0,channel,new_value,0)) { - Submenu_Value=new_value; - } + error_num=Set_Pw(0,0,0,channel,new_value,0); break; case Show_amplitude: @@ -2240,39 +2234,27 @@ static int Submenu_Mult_Value(float mult_by) } } - if (error_num=Set_Amplitude(0,0,0,0,0,0,0,channel,new_value,0)) { - Submenu_Value=new_value; - } + error_num=Set_Amplitude(0,0,0,0,0,0,0,channel,new_value,0); break; case Show_Burst_Time: - if (error_num=Set_Burst_Time(0,0,0,channel,new_value)) { - Submenu_Value=new_value; - } + error_num=Set_Burst_Time(0,0,0,channel,new_value); break; case Show_rise_time: - if (error_num=Set_rise_time(0,0,0,channel,new_value)) { - Submenu_Value=new_value; - } + error_num=Set_rise_time(0,0,0,channel,new_value); break; case Show_slew: - if (error_num=Set_slew(0,0,0,channel,new_value)) { - Submenu_Value=new_value; - } + error_num=Set_slew(0,0,0,channel,new_value); break; case Show_load_type: - if (error_num=Set_Load(channel,new_value)) { - Submenu_Value=new_value; - } + error_num=Set_Load(channel,new_value); break; case Show_soft_current_limit: - if (error_num=Set_current_limit(0,channel,new_value)) { - Submenu_Value=new_value; - } + error_num=Set_current_limit(0,channel,new_value); break; case Show_offset: @@ -2292,15 +2274,11 @@ static int Submenu_Mult_Value(float mult_by) } } - if (error_num=Set_Offset(0,0,0,0,channel,new_value)) { - Submenu_Value=new_value; - } + error_num=Set_Offset(0,0,0,0,channel,new_value); break; case Show_duty_cycle: - if (error_num=Set_Pw(0,0,0,channel,new_value/(100*globals.ChannelState[channel].frequency),0)) { - Submenu_Value=new_value; - } + error_num=Set_Pw(0,0,0,channel,new_value/(100*globals.ChannelState[channel].frequency),0); break; } -- cgit