mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 15:23:04 +00:00 
			
		
		
		
	Apply readability-redundant-control-flow check
This commit is contained in:
		| @@ -373,7 +373,6 @@ void beidou_b1i_telemetry_decoder_gs::reset() | |||||||
|     d_sent_tlm_failed_msg = false; |     d_sent_tlm_failed_msg = false; | ||||||
|     d_flag_valid_word = false; |     d_flag_valid_word = false; | ||||||
|     DLOG(INFO) << "Beidou B1I Telemetry decoder reset for satellite " << d_satellite; |     DLOG(INFO) << "Beidou B1I Telemetry decoder reset for satellite " << d_satellite; | ||||||
|     return; |  | ||||||
| } | } | ||||||
|  |  | ||||||
| int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), | int beidou_b1i_telemetry_decoder_gs::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), | ||||||
|   | |||||||
| @@ -395,7 +395,6 @@ void beidou_b3i_telemetry_decoder_gs::reset() | |||||||
|     d_sent_tlm_failed_msg = false; |     d_sent_tlm_failed_msg = false; | ||||||
|     d_flag_valid_word = false; |     d_flag_valid_word = false; | ||||||
|     DLOG(INFO) << "Beidou B3I Telemetry decoder reset for satellite " << d_satellite; |     DLOG(INFO) << "Beidou B3I Telemetry decoder reset for satellite " << d_satellite; | ||||||
|     return; |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -374,9 +374,9 @@ void Viterbi_Decoder::nsc_transit(int output_p[], int trans_p[], int input, cons | |||||||
|             output_p[state] = nsc_enc_bit(nextstate, input, state, g, KK, nn); |             output_p[state] = nsc_enc_bit(nextstate, input, state, g, KK, nn); | ||||||
|             trans_p[state] = nextstate[0]; |             trans_p[state] = nextstate[0]; | ||||||
|         } |         } | ||||||
|     return; |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| /* Function nsc_enc_bit() | /* Function nsc_enc_bit() | ||||||
|  |  | ||||||
|  Description: Convolutionally encodes a single bit using a rate 1/n encoder. |  Description: Convolutionally encodes a single bit using a rate 1/n encoder. | ||||||
| @@ -395,7 +395,6 @@ void Viterbi_Decoder::nsc_transit(int output_p[], int trans_p[], int input, cons | |||||||
|  (i.e. the state after encoding this bit) |  (i.e. the state after encoding this bit) | ||||||
|  |  | ||||||
|  This function is used by rsc_encode(), nsc_transit(), rsc_transit(), and nsc_transit() */ |  This function is used by rsc_encode(), nsc_transit(), rsc_transit(), and nsc_transit() */ | ||||||
|  |  | ||||||
| int Viterbi_Decoder::nsc_enc_bit(int state_out_p[], int input, int state_in, | int Viterbi_Decoder::nsc_enc_bit(int state_out_p[], int input, int state_in, | ||||||
|     const int g[], int KK, int nn) |     const int g[], int KK, int nn) | ||||||
| { | { | ||||||
|   | |||||||
| @@ -102,7 +102,6 @@ void Tcp_Communication::send_receive_tcp_packet_galileo_e1(boost::array<float, N | |||||||
|             std::cerr << "Exception: " << e.what() << ". Please press Ctrl+C to end the program." << std::endl; |             std::cerr << "Exception: " << e.what() << ". Please press Ctrl+C to end the program." << std::endl; | ||||||
|             std::cin >> controlc; |             std::cin >> controlc; | ||||||
|         } |         } | ||||||
|     return; |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -137,7 +136,6 @@ void Tcp_Communication::send_receive_tcp_packet_gps_l1_ca(boost::array<float, NU | |||||||
|             std::cerr << "Exception: " << e.what() << ". Please press Ctrl+C to end the program." << std::endl; |             std::cerr << "Exception: " << e.what() << ". Please press Ctrl+C to end the program." << std::endl; | ||||||
|             std::cin >> controlc; |             std::cin >> controlc; | ||||||
|         } |         } | ||||||
|     return; |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -146,5 +144,4 @@ void Tcp_Communication::close_tcp_connection(size_t d_port_) | |||||||
|     // Close the TCP connection |     // Close the TCP connection | ||||||
|     tcp_socket_.close(); |     tcp_socket_.close(); | ||||||
|     std::cout << "Socket closed on port " << d_port_ << std::endl; |     std::cout << "Socket closed on port " << d_port_ << std::endl; | ||||||
|     return; |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1,10 +1,9 @@ | |||||||
| #include "asn_internal.h" |  | ||||||
| #include "constraints.h" | #include "constraints.h" | ||||||
|  | #include "asn_internal.h" | ||||||
|  |  | ||||||
| int | int asn_generic_no_constraint(asn_TYPE_descriptor_t *type_descriptor, | ||||||
| asn_generic_no_constraint(asn_TYPE_descriptor_t *type_descriptor, |     const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) | ||||||
| 	const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) { | { | ||||||
|  |  | ||||||
|     (void)type_descriptor; /* Unused argument */ |     (void)type_descriptor; /* Unused argument */ | ||||||
|     (void)struct_ptr;      /* Unused argument */ |     (void)struct_ptr;      /* Unused argument */ | ||||||
|     (void)cb;              /* Unused argument */ |     (void)cb;              /* Unused argument */ | ||||||
| @@ -14,10 +13,9 @@ asn_generic_no_constraint(asn_TYPE_descriptor_t *type_descriptor, | |||||||
|     return 0; |     return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
| int | int asn_generic_unknown_constraint(asn_TYPE_descriptor_t *type_descriptor, | ||||||
| asn_generic_unknown_constraint(asn_TYPE_descriptor_t *type_descriptor, |     const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) | ||||||
| 	const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) { | { | ||||||
|  |  | ||||||
|     (void)type_descriptor; /* Unused argument */ |     (void)type_descriptor; /* Unused argument */ | ||||||
|     (void)struct_ptr;      /* Unused argument */ |     (void)struct_ptr;      /* Unused argument */ | ||||||
|     (void)cb;              /* Unused argument */ |     (void)cb;              /* Unused argument */ | ||||||
| @@ -27,7 +25,8 @@ asn_generic_unknown_constraint(asn_TYPE_descriptor_t *type_descriptor, | |||||||
|     return 0; |     return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
| struct errbufDesc { | struct errbufDesc | ||||||
|  | { | ||||||
|     asn_TYPE_descriptor_t *failed_type; |     asn_TYPE_descriptor_t *failed_type; | ||||||
|     const void *failed_struct_ptr; |     const void *failed_struct_ptr; | ||||||
|     char *errbuf; |     char *errbuf; | ||||||
| @@ -35,7 +34,8 @@ struct errbufDesc { | |||||||
| }; | }; | ||||||
|  |  | ||||||
| static void | static void | ||||||
| _asn_i_ctfailcb(void *key, asn_TYPE_descriptor_t *td, const void *sptr, const char *fmt, ...) { | _asn_i_ctfailcb(void *key, asn_TYPE_descriptor_t *td, const void *sptr, const char *fmt, ...) | ||||||
|  | { | ||||||
|     struct errbufDesc *arg = key; |     struct errbufDesc *arg = key; | ||||||
|     va_list ap; |     va_list ap; | ||||||
|     ssize_t vlen; |     ssize_t vlen; | ||||||
| @@ -51,14 +51,19 @@ _asn_i_ctfailcb(void *key, asn_TYPE_descriptor_t *td, const void *sptr, const ch | |||||||
|     va_start(ap, fmt); |     va_start(ap, fmt); | ||||||
|     vlen = vsnprintf(arg->errbuf, maxlen, fmt, ap); |     vlen = vsnprintf(arg->errbuf, maxlen, fmt, ap); | ||||||
|     va_end(ap); |     va_end(ap); | ||||||
| 	if(vlen >= maxlen) { |     if (vlen >= maxlen) | ||||||
|  |         { | ||||||
|             arg->errbuf[maxlen - 1] = '\0'; /* Ensuring libc correctness */ |             arg->errbuf[maxlen - 1] = '\0'; /* Ensuring libc correctness */ | ||||||
|             arg->errlen = maxlen - 1;       /* Not counting termination */ |             arg->errlen = maxlen - 1;       /* Not counting termination */ | ||||||
|             return; |             return; | ||||||
| 	} else if(vlen >= 0) { |         } | ||||||
|  |     else if (vlen >= 0) | ||||||
|  |         { | ||||||
|             arg->errbuf[vlen] = '\0'; /* Ensuring libc correctness */ |             arg->errbuf[vlen] = '\0'; /* Ensuring libc correctness */ | ||||||
|             arg->errlen = vlen;       /* Not counting termination */ |             arg->errlen = vlen;       /* Not counting termination */ | ||||||
| 	} else { |         } | ||||||
|  |     else | ||||||
|  |         { | ||||||
|             /* |             /* | ||||||
| 		 * The libc on this system is broken. | 		 * The libc on this system is broken. | ||||||
| 		 */ | 		 */ | ||||||
| @@ -68,13 +73,11 @@ _asn_i_ctfailcb(void *key, asn_TYPE_descriptor_t *td, const void *sptr, const ch | |||||||
|             memcpy(arg->errbuf, "<broken vsnprintf>", arg->errlen); |             memcpy(arg->errbuf, "<broken vsnprintf>", arg->errlen); | ||||||
|             arg->errbuf[arg->errlen] = 0; |             arg->errbuf[arg->errlen] = 0; | ||||||
|         } |         } | ||||||
|  |  | ||||||
| 	return; |  | ||||||
| } | } | ||||||
|  |  | ||||||
| int | int asn_check_constraints(asn_TYPE_descriptor_t *type_descriptor, | ||||||
| asn_check_constraints(asn_TYPE_descriptor_t *type_descriptor, |     const void *struct_ptr, char *errbuf, size_t *errlen) | ||||||
| 		const void *struct_ptr, char *errbuf, size_t *errlen) { | { | ||||||
|     struct errbufDesc arg; |     struct errbufDesc arg; | ||||||
|     int ret; |     int ret; | ||||||
|  |  | ||||||
| @@ -90,4 +93,3 @@ asn_check_constraints(asn_TYPE_descriptor_t *type_descriptor, | |||||||
|  |  | ||||||
|     return ret; |     return ret; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,10 +1,9 @@ | |||||||
| #include "asn_internal.h" |  | ||||||
| #include "constraints.h" | #include "constraints.h" | ||||||
|  | #include "asn_internal.h" | ||||||
|  |  | ||||||
| int | int asn_generic_no_constraint(asn_TYPE_descriptor_t *type_descriptor, | ||||||
| asn_generic_no_constraint(asn_TYPE_descriptor_t *type_descriptor, |     const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) | ||||||
| 	const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) { | { | ||||||
|  |  | ||||||
|     (void)type_descriptor; /* Unused argument */ |     (void)type_descriptor; /* Unused argument */ | ||||||
|     (void)struct_ptr;      /* Unused argument */ |     (void)struct_ptr;      /* Unused argument */ | ||||||
|     (void)cb;              /* Unused argument */ |     (void)cb;              /* Unused argument */ | ||||||
| @@ -14,10 +13,9 @@ asn_generic_no_constraint(asn_TYPE_descriptor_t *type_descriptor, | |||||||
|     return 0; |     return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
| int | int asn_generic_unknown_constraint(asn_TYPE_descriptor_t *type_descriptor, | ||||||
| asn_generic_unknown_constraint(asn_TYPE_descriptor_t *type_descriptor, |     const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) | ||||||
| 	const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) { | { | ||||||
|  |  | ||||||
|     (void)type_descriptor; /* Unused argument */ |     (void)type_descriptor; /* Unused argument */ | ||||||
|     (void)struct_ptr;      /* Unused argument */ |     (void)struct_ptr;      /* Unused argument */ | ||||||
|     (void)cb;              /* Unused argument */ |     (void)cb;              /* Unused argument */ | ||||||
| @@ -27,7 +25,8 @@ asn_generic_unknown_constraint(asn_TYPE_descriptor_t *type_descriptor, | |||||||
|     return 0; |     return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
| struct errbufDesc { | struct errbufDesc | ||||||
|  | { | ||||||
|     asn_TYPE_descriptor_t *failed_type; |     asn_TYPE_descriptor_t *failed_type; | ||||||
|     const void *failed_struct_ptr; |     const void *failed_struct_ptr; | ||||||
|     char *errbuf; |     char *errbuf; | ||||||
| @@ -35,7 +34,8 @@ struct errbufDesc { | |||||||
| }; | }; | ||||||
|  |  | ||||||
| static void | static void | ||||||
| _asn_i_ctfailcb(void *key, asn_TYPE_descriptor_t *td, const void *sptr, const char *fmt, ...) { | _asn_i_ctfailcb(void *key, asn_TYPE_descriptor_t *td, const void *sptr, const char *fmt, ...) | ||||||
|  | { | ||||||
|     struct errbufDesc *arg = key; |     struct errbufDesc *arg = key; | ||||||
|     va_list ap; |     va_list ap; | ||||||
|     ssize_t vlen; |     ssize_t vlen; | ||||||
| @@ -51,14 +51,19 @@ _asn_i_ctfailcb(void *key, asn_TYPE_descriptor_t *td, const void *sptr, const ch | |||||||
|     va_start(ap, fmt); |     va_start(ap, fmt); | ||||||
|     vlen = vsnprintf(arg->errbuf, maxlen, fmt, ap); |     vlen = vsnprintf(arg->errbuf, maxlen, fmt, ap); | ||||||
|     va_end(ap); |     va_end(ap); | ||||||
| 	if(vlen >= maxlen) { |     if (vlen >= maxlen) | ||||||
|  |         { | ||||||
|             arg->errbuf[maxlen - 1] = '\0'; /* Ensuring libc correctness */ |             arg->errbuf[maxlen - 1] = '\0'; /* Ensuring libc correctness */ | ||||||
|             arg->errlen = maxlen - 1;       /* Not counting termination */ |             arg->errlen = maxlen - 1;       /* Not counting termination */ | ||||||
|             return; |             return; | ||||||
| 	} else if(vlen >= 0) { |         } | ||||||
|  |     else if (vlen >= 0) | ||||||
|  |         { | ||||||
|             arg->errbuf[vlen] = '\0'; /* Ensuring libc correctness */ |             arg->errbuf[vlen] = '\0'; /* Ensuring libc correctness */ | ||||||
|             arg->errlen = vlen;       /* Not counting termination */ |             arg->errlen = vlen;       /* Not counting termination */ | ||||||
| 	} else { |         } | ||||||
|  |     else | ||||||
|  |         { | ||||||
|             /* |             /* | ||||||
| 		 * The libc on this system is broken. | 		 * The libc on this system is broken. | ||||||
| 		 */ | 		 */ | ||||||
| @@ -68,13 +73,11 @@ _asn_i_ctfailcb(void *key, asn_TYPE_descriptor_t *td, const void *sptr, const ch | |||||||
|             memcpy(arg->errbuf, "<broken vsnprintf>", arg->errlen); |             memcpy(arg->errbuf, "<broken vsnprintf>", arg->errlen); | ||||||
|             arg->errbuf[arg->errlen] = 0; |             arg->errbuf[arg->errlen] = 0; | ||||||
|         } |         } | ||||||
|  |  | ||||||
| 	return; |  | ||||||
| } | } | ||||||
|  |  | ||||||
| int | int asn_check_constraints(asn_TYPE_descriptor_t *type_descriptor, | ||||||
| asn_check_constraints(asn_TYPE_descriptor_t *type_descriptor, |     const void *struct_ptr, char *errbuf, size_t *errlen) | ||||||
| 		const void *struct_ptr, char *errbuf, size_t *errlen) { | { | ||||||
|     struct errbufDesc arg; |     struct errbufDesc arg; | ||||||
|     int ret; |     int ret; | ||||||
|  |  | ||||||
| @@ -90,4 +93,3 @@ asn_check_constraints(asn_TYPE_descriptor_t *type_descriptor, | |||||||
|  |  | ||||||
|     return ret; |     return ret; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -283,7 +283,6 @@ void Gnss_Satellite::set_rf_link(int32_t rf_link_) | |||||||
| { | { | ||||||
|     // Set satellite's rf link. Identifies the GLONASS Frequency Channel |     // Set satellite's rf link. Identifies the GLONASS Frequency Channel | ||||||
|     rf_link = rf_link_; |     rf_link = rf_link_; | ||||||
|     return; |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -293,7 +293,6 @@ void receive_msg() | |||||||
|                         } |                         } | ||||||
|                 } |                 } | ||||||
|         } |         } | ||||||
|     return; |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez