Skip to content

The local variable ‘freq’ should be renamed #502

@tangshaozhu

Description

@tangshaozhu
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions