mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 07:13:03 +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_flag_valid_word = false; | ||||
|     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)), | ||||
|   | ||||
| @@ -395,7 +395,6 @@ void beidou_b3i_telemetry_decoder_gs::reset() | ||||
|     d_sent_tlm_failed_msg = false; | ||||
|     d_flag_valid_word = false; | ||||
|     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); | ||||
|             trans_p[state] = nextstate[0]; | ||||
|         } | ||||
|     return; | ||||
| } | ||||
|  | ||||
|  | ||||
| /* Function nsc_enc_bit() | ||||
|  | ||||
|  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) | ||||
|  | ||||
|  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, | ||||
|     const int g[], int KK, int nn) | ||||
| { | ||||
|   | ||||
| @@ -102,8 +102,7 @@ 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::cin >> controlc; | ||||
|         } | ||||
|     return; | ||||
| } | ||||
|     } | ||||
|  | ||||
|  | ||||
| void Tcp_Communication::send_receive_tcp_packet_gps_l1_ca(boost::array<float, NUM_TX_VARIABLES_GPS_L1_CA> buf, Tcp_Packet_Data* tcp_data_) | ||||
| @@ -137,8 +136,7 @@ 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::cin >> controlc; | ||||
|         } | ||||
|     return; | ||||
| } | ||||
|     } | ||||
|  | ||||
|  | ||||
| void Tcp_Communication::close_tcp_connection(size_t d_port_) | ||||
| @@ -146,5 +144,4 @@ void Tcp_Communication::close_tcp_connection(size_t d_port_) | ||||
|     // Close the TCP connection | ||||
|     tcp_socket_.close(); | ||||
|     std::cout << "Socket closed on port " << d_port_ << std::endl; | ||||
|     return; | ||||
| } | ||||
|   | ||||
| @@ -1,93 +1,95 @@ | ||||
| #include "asn_internal.h" | ||||
| #include "constraints.h" | ||||
| #include "asn_internal.h" | ||||
|  | ||||
| int | ||||
| asn_generic_no_constraint(asn_TYPE_descriptor_t *type_descriptor, | ||||
| 	const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) { | ||||
| int asn_generic_no_constraint(asn_TYPE_descriptor_t *type_descriptor, | ||||
|     const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) | ||||
| { | ||||
|     (void)type_descriptor; /* Unused argument */ | ||||
|     (void)struct_ptr;      /* Unused argument */ | ||||
|     (void)cb;              /* Unused argument */ | ||||
|     (void)key;             /* Unused argument */ | ||||
|  | ||||
| 	(void)type_descriptor;	/* Unused argument */ | ||||
| 	(void)struct_ptr;	/* Unused argument */ | ||||
| 	(void)cb;	/* Unused argument */ | ||||
| 	(void)key;	/* Unused argument */ | ||||
|  | ||||
| 	/* Nothing to check */ | ||||
| 	return 0; | ||||
|     /* Nothing to check */ | ||||
|     return 0; | ||||
| } | ||||
|  | ||||
| int | ||||
| asn_generic_unknown_constraint(asn_TYPE_descriptor_t *type_descriptor, | ||||
| 	const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) { | ||||
| int asn_generic_unknown_constraint(asn_TYPE_descriptor_t *type_descriptor, | ||||
|     const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) | ||||
| { | ||||
|     (void)type_descriptor; /* Unused argument */ | ||||
|     (void)struct_ptr;      /* Unused argument */ | ||||
|     (void)cb;              /* Unused argument */ | ||||
|     (void)key;             /* Unused argument */ | ||||
|  | ||||
| 	(void)type_descriptor;	/* Unused argument */ | ||||
| 	(void)struct_ptr;	/* Unused argument */ | ||||
| 	(void)cb;	/* Unused argument */ | ||||
| 	(void)key;	/* Unused argument */ | ||||
|  | ||||
| 	/* Unknown how to check */ | ||||
| 	return 0; | ||||
|     /* Unknown how to check */ | ||||
|     return 0; | ||||
| } | ||||
|  | ||||
| struct errbufDesc { | ||||
| 	asn_TYPE_descriptor_t *failed_type; | ||||
| 	const void *failed_struct_ptr; | ||||
| 	char *errbuf; | ||||
| 	size_t errlen; | ||||
| struct errbufDesc | ||||
| { | ||||
|     asn_TYPE_descriptor_t *failed_type; | ||||
|     const void *failed_struct_ptr; | ||||
|     char *errbuf; | ||||
|     size_t errlen; | ||||
| }; | ||||
|  | ||||
| static void | ||||
| _asn_i_ctfailcb(void *key, asn_TYPE_descriptor_t *td, const void *sptr, const char *fmt, ...) { | ||||
| 	struct errbufDesc *arg = key; | ||||
| 	va_list ap; | ||||
| 	ssize_t vlen; | ||||
| 	ssize_t maxlen; | ||||
| _asn_i_ctfailcb(void *key, asn_TYPE_descriptor_t *td, const void *sptr, const char *fmt, ...) | ||||
| { | ||||
|     struct errbufDesc *arg = key; | ||||
|     va_list ap; | ||||
|     ssize_t vlen; | ||||
|     ssize_t maxlen; | ||||
|  | ||||
| 	arg->failed_type = td; | ||||
| 	arg->failed_struct_ptr = sptr; | ||||
|     arg->failed_type = td; | ||||
|     arg->failed_struct_ptr = sptr; | ||||
|  | ||||
| 	maxlen = arg->errlen; | ||||
| 	if(maxlen <= 0) | ||||
| 		return; | ||||
|     maxlen = arg->errlen; | ||||
|     if (maxlen <= 0) | ||||
|         return; | ||||
|  | ||||
| 	va_start(ap, fmt); | ||||
| 	vlen = vsnprintf(arg->errbuf, maxlen, fmt, ap); | ||||
| 	va_end(ap); | ||||
| 	if(vlen >= maxlen) { | ||||
| 		arg->errbuf[maxlen-1] = '\0';	/* Ensuring libc correctness */ | ||||
| 		arg->errlen = maxlen - 1;	/* Not counting termination */ | ||||
| 		return; | ||||
| 	} else if(vlen >= 0) { | ||||
| 		arg->errbuf[vlen] = '\0';	/* Ensuring libc correctness */ | ||||
| 		arg->errlen = vlen;		/* Not counting termination */ | ||||
| 	} else { | ||||
| 		/* | ||||
|     va_start(ap, fmt); | ||||
|     vlen = vsnprintf(arg->errbuf, maxlen, fmt, ap); | ||||
|     va_end(ap); | ||||
|     if (vlen >= maxlen) | ||||
|         { | ||||
|             arg->errbuf[maxlen - 1] = '\0'; /* Ensuring libc correctness */ | ||||
|             arg->errlen = maxlen - 1;       /* Not counting termination */ | ||||
|             return; | ||||
|         } | ||||
|     else if (vlen >= 0) | ||||
|         { | ||||
|             arg->errbuf[vlen] = '\0'; /* Ensuring libc correctness */ | ||||
|             arg->errlen = vlen;       /* Not counting termination */ | ||||
|         } | ||||
|     else | ||||
|         { | ||||
|             /* | ||||
| 		 * The libc on this system is broken. | ||||
| 		 */ | ||||
| 		vlen = sizeof("<broken vsnprintf>") - 1; | ||||
| 		maxlen--; | ||||
| 		arg->errlen = vlen < maxlen ? vlen : maxlen; | ||||
| 		memcpy(arg->errbuf, "<broken vsnprintf>", arg->errlen); | ||||
| 		arg->errbuf[arg->errlen] = 0; | ||||
| 	} | ||||
|  | ||||
| 	return; | ||||
|             vlen = sizeof("<broken vsnprintf>") - 1; | ||||
|             maxlen--; | ||||
|             arg->errlen = vlen < maxlen ? vlen : maxlen; | ||||
|             memcpy(arg->errbuf, "<broken vsnprintf>", arg->errlen); | ||||
|             arg->errbuf[arg->errlen] = 0; | ||||
|         } | ||||
| } | ||||
|  | ||||
| int | ||||
| asn_check_constraints(asn_TYPE_descriptor_t *type_descriptor, | ||||
| 		const void *struct_ptr, char *errbuf, size_t *errlen) { | ||||
| 	struct errbufDesc arg; | ||||
| 	int ret; | ||||
| int asn_check_constraints(asn_TYPE_descriptor_t *type_descriptor, | ||||
|     const void *struct_ptr, char *errbuf, size_t *errlen) | ||||
| { | ||||
|     struct errbufDesc arg; | ||||
|     int ret; | ||||
|  | ||||
| 	arg.failed_type = 0; | ||||
| 	arg.failed_struct_ptr = 0; | ||||
| 	arg.errbuf = errbuf; | ||||
| 	arg.errlen = errlen ? *errlen : 0; | ||||
|     arg.failed_type = 0; | ||||
|     arg.failed_struct_ptr = 0; | ||||
|     arg.errbuf = errbuf; | ||||
|     arg.errlen = errlen ? *errlen : 0; | ||||
|  | ||||
| 	ret = type_descriptor->check_constraints(type_descriptor, | ||||
| 		struct_ptr, _asn_i_ctfailcb, &arg); | ||||
| 	if(ret == -1 && errlen) | ||||
| 		*errlen = arg.errlen; | ||||
|     ret = type_descriptor->check_constraints(type_descriptor, | ||||
|         struct_ptr, _asn_i_ctfailcb, &arg); | ||||
|     if (ret == -1 && errlen) | ||||
|         *errlen = arg.errlen; | ||||
|  | ||||
| 	return ret; | ||||
|     return ret; | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -1,93 +1,95 @@ | ||||
| #include "asn_internal.h" | ||||
| #include "constraints.h" | ||||
| #include "asn_internal.h" | ||||
|  | ||||
| int | ||||
| asn_generic_no_constraint(asn_TYPE_descriptor_t *type_descriptor, | ||||
| 	const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) { | ||||
| int asn_generic_no_constraint(asn_TYPE_descriptor_t *type_descriptor, | ||||
|     const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) | ||||
| { | ||||
|     (void)type_descriptor; /* Unused argument */ | ||||
|     (void)struct_ptr;      /* Unused argument */ | ||||
|     (void)cb;              /* Unused argument */ | ||||
|     (void)key;             /* Unused argument */ | ||||
|  | ||||
| 	(void)type_descriptor;	/* Unused argument */ | ||||
| 	(void)struct_ptr;	/* Unused argument */ | ||||
| 	(void)cb;	/* Unused argument */ | ||||
| 	(void)key;	/* Unused argument */ | ||||
|  | ||||
| 	/* Nothing to check */ | ||||
| 	return 0; | ||||
|     /* Nothing to check */ | ||||
|     return 0; | ||||
| } | ||||
|  | ||||
| int | ||||
| asn_generic_unknown_constraint(asn_TYPE_descriptor_t *type_descriptor, | ||||
| 	const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) { | ||||
| int asn_generic_unknown_constraint(asn_TYPE_descriptor_t *type_descriptor, | ||||
|     const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) | ||||
| { | ||||
|     (void)type_descriptor; /* Unused argument */ | ||||
|     (void)struct_ptr;      /* Unused argument */ | ||||
|     (void)cb;              /* Unused argument */ | ||||
|     (void)key;             /* Unused argument */ | ||||
|  | ||||
| 	(void)type_descriptor;	/* Unused argument */ | ||||
| 	(void)struct_ptr;	/* Unused argument */ | ||||
| 	(void)cb;	/* Unused argument */ | ||||
| 	(void)key;	/* Unused argument */ | ||||
|  | ||||
| 	/* Unknown how to check */ | ||||
| 	return 0; | ||||
|     /* Unknown how to check */ | ||||
|     return 0; | ||||
| } | ||||
|  | ||||
| struct errbufDesc { | ||||
| 	asn_TYPE_descriptor_t *failed_type; | ||||
| 	const void *failed_struct_ptr; | ||||
| 	char *errbuf; | ||||
| 	size_t errlen; | ||||
| struct errbufDesc | ||||
| { | ||||
|     asn_TYPE_descriptor_t *failed_type; | ||||
|     const void *failed_struct_ptr; | ||||
|     char *errbuf; | ||||
|     size_t errlen; | ||||
| }; | ||||
|  | ||||
| static void | ||||
| _asn_i_ctfailcb(void *key, asn_TYPE_descriptor_t *td, const void *sptr, const char *fmt, ...) { | ||||
| 	struct errbufDesc *arg = key; | ||||
| 	va_list ap; | ||||
| 	ssize_t vlen; | ||||
| 	ssize_t maxlen; | ||||
| _asn_i_ctfailcb(void *key, asn_TYPE_descriptor_t *td, const void *sptr, const char *fmt, ...) | ||||
| { | ||||
|     struct errbufDesc *arg = key; | ||||
|     va_list ap; | ||||
|     ssize_t vlen; | ||||
|     ssize_t maxlen; | ||||
|  | ||||
| 	arg->failed_type = td; | ||||
| 	arg->failed_struct_ptr = sptr; | ||||
|     arg->failed_type = td; | ||||
|     arg->failed_struct_ptr = sptr; | ||||
|  | ||||
| 	maxlen = arg->errlen; | ||||
| 	if(maxlen <= 0) | ||||
| 		return; | ||||
|     maxlen = arg->errlen; | ||||
|     if (maxlen <= 0) | ||||
|         return; | ||||
|  | ||||
| 	va_start(ap, fmt); | ||||
| 	vlen = vsnprintf(arg->errbuf, maxlen, fmt, ap); | ||||
| 	va_end(ap); | ||||
| 	if(vlen >= maxlen) { | ||||
| 		arg->errbuf[maxlen-1] = '\0';	/* Ensuring libc correctness */ | ||||
| 		arg->errlen = maxlen - 1;	/* Not counting termination */ | ||||
| 		return; | ||||
| 	} else if(vlen >= 0) { | ||||
| 		arg->errbuf[vlen] = '\0';	/* Ensuring libc correctness */ | ||||
| 		arg->errlen = vlen;		/* Not counting termination */ | ||||
| 	} else { | ||||
| 		/* | ||||
|     va_start(ap, fmt); | ||||
|     vlen = vsnprintf(arg->errbuf, maxlen, fmt, ap); | ||||
|     va_end(ap); | ||||
|     if (vlen >= maxlen) | ||||
|         { | ||||
|             arg->errbuf[maxlen - 1] = '\0'; /* Ensuring libc correctness */ | ||||
|             arg->errlen = maxlen - 1;       /* Not counting termination */ | ||||
|             return; | ||||
|         } | ||||
|     else if (vlen >= 0) | ||||
|         { | ||||
|             arg->errbuf[vlen] = '\0'; /* Ensuring libc correctness */ | ||||
|             arg->errlen = vlen;       /* Not counting termination */ | ||||
|         } | ||||
|     else | ||||
|         { | ||||
|             /* | ||||
| 		 * The libc on this system is broken. | ||||
| 		 */ | ||||
| 		vlen = sizeof("<broken vsnprintf>") - 1; | ||||
| 		maxlen--; | ||||
| 		arg->errlen = vlen < maxlen ? vlen : maxlen; | ||||
| 		memcpy(arg->errbuf, "<broken vsnprintf>", arg->errlen); | ||||
| 		arg->errbuf[arg->errlen] = 0; | ||||
| 	} | ||||
|  | ||||
| 	return; | ||||
|             vlen = sizeof("<broken vsnprintf>") - 1; | ||||
|             maxlen--; | ||||
|             arg->errlen = vlen < maxlen ? vlen : maxlen; | ||||
|             memcpy(arg->errbuf, "<broken vsnprintf>", arg->errlen); | ||||
|             arg->errbuf[arg->errlen] = 0; | ||||
|         } | ||||
| } | ||||
|  | ||||
| int | ||||
| asn_check_constraints(asn_TYPE_descriptor_t *type_descriptor, | ||||
| 		const void *struct_ptr, char *errbuf, size_t *errlen) { | ||||
| 	struct errbufDesc arg; | ||||
| 	int ret; | ||||
| int asn_check_constraints(asn_TYPE_descriptor_t *type_descriptor, | ||||
|     const void *struct_ptr, char *errbuf, size_t *errlen) | ||||
| { | ||||
|     struct errbufDesc arg; | ||||
|     int ret; | ||||
|  | ||||
| 	arg.failed_type = 0; | ||||
| 	arg.failed_struct_ptr = 0; | ||||
| 	arg.errbuf = errbuf; | ||||
| 	arg.errlen = errlen ? *errlen : 0; | ||||
|     arg.failed_type = 0; | ||||
|     arg.failed_struct_ptr = 0; | ||||
|     arg.errbuf = errbuf; | ||||
|     arg.errlen = errlen ? *errlen : 0; | ||||
|  | ||||
| 	ret = type_descriptor->check_constraints(type_descriptor, | ||||
| 		struct_ptr, _asn_i_ctfailcb, &arg); | ||||
| 	if(ret == -1 && errlen) | ||||
| 		*errlen = arg.errlen; | ||||
|     ret = type_descriptor->check_constraints(type_descriptor, | ||||
|         struct_ptr, _asn_i_ctfailcb, &arg); | ||||
|     if (ret == -1 && errlen) | ||||
|         *errlen = arg.errlen; | ||||
|  | ||||
| 	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 | ||||
|     rf_link = rf_link_; | ||||
|     return; | ||||
| } | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -293,7 +293,6 @@ void receive_msg() | ||||
|                         } | ||||
|                 } | ||||
|         } | ||||
|     return; | ||||
| } | ||||
|  | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez