From b652d8f74b87ef8e73713c1c724e71c502ef0c3e Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Wed, 7 Aug 2019 19:12:40 +0200 Subject: [PATCH] tests: don't use 'index' as a name for variables The standard library provides index() as a function. Don't use it as a name for variables, arguments, etc. Signed-off-by: Bartosz Golaszewski --- tests/gpiod-test.c | 12 ++++++------ tests/gpiod-test.h | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/gpiod-test.c b/tests/gpiod-test.c index 7fc8744..1d962aa 100644 --- a/tests/gpiod-test.c +++ b/tests/gpiod-test.c @@ -129,11 +129,11 @@ void _gpiod_test_register(_GpiodTestCase *test) globals.tests = g_list_append(globals.tests, test); } -const gchar *gpiod_test_chip_path(guint index) +const gchar *gpiod_test_chip_path(guint idx) { const gchar *path; - path = gpio_mockup_chip_path(globals.mockup, index); + path = gpio_mockup_chip_path(globals.mockup, idx); if (!path) g_error("unable to retrieve the chip path: %s", g_strerror(errno)); @@ -141,11 +141,11 @@ const gchar *gpiod_test_chip_path(guint index) return path; } -const gchar *gpiod_test_chip_name(guint index) +const gchar *gpiod_test_chip_name(guint idx) { const gchar *name; - name = gpio_mockup_chip_name(globals.mockup, index); + name = gpio_mockup_chip_name(globals.mockup, idx); if (!name) g_error("unable to retrieve the chip name: %s", g_strerror(errno)); @@ -153,11 +153,11 @@ const gchar *gpiod_test_chip_name(guint index) return name; } -gint gpiod_test_chip_num(unsigned int index) +gint gpiod_test_chip_num(unsigned int idx) { gint num; - num = gpio_mockup_chip_num(globals.mockup, index); + num = gpio_mockup_chip_num(globals.mockup, idx); if (num < 0) g_error("unable to retrieve the chip number: %s", g_strerror(errno)); diff --git a/tests/gpiod-test.h b/tests/gpiod-test.h index 8047964..ebeda41 100644 --- a/tests/gpiod-test.h +++ b/tests/gpiod-test.h @@ -84,9 +84,9 @@ enum { } while (0) /* Wrappers around libgpiomockup helpers. */ -const gchar *gpiod_test_chip_path(guint index); -const gchar *gpiod_test_chip_name(guint index); -gint gpiod_test_chip_num(guint index); +const gchar *gpiod_test_chip_path(guint idx); +const gchar *gpiod_test_chip_name(guint idx); +gint gpiod_test_chip_num(guint idx); gint gpiod_test_chip_get_value(guint chip_index, guint line_offset); void gpiod_test_chip_set_pull(guint chip_index, guint line_offset, gint pull); -- 2.30.2