Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The local variable ‘freq’ should be renamed #502

Open
tangshaozhu opened this issue Aug 19, 2024 · 0 comments
Open

The local variable ‘freq’ should be renamed #502

tangshaozhu opened this issue Aug 19, 2024 · 0 comments

Comments

@tangshaozhu
Copy link

static void iio_spin_button_update_value(struct iio_widget *widget,
		const char *src, size_t len)
{
	gdouble freq, mag, min, max;
	gdouble scale = widget->priv ? *(gdouble *)widget->priv : 1.0;
	char *end;

	mag = gtk_spin_button_get_value(GTK_SPIN_BUTTON(widget->widget));
	gtk_spin_button_get_range(GTK_SPIN_BUTTON(widget->widget), &min, &max);

	freq = g_ascii_strtod(src, &end);
        ...

The local variable ‘freq’ should be renamed, as it may not be necessary to represent frequency. It may cause a bit of confusion for source code reading, and similar conditions should be checked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant