Linux-GPIO Archive on lore.kernel.org
 help / color / Atom feed
From: Kent Gibson <warthog618@gmail.com>
To: linux-gpio@vger.kernel.org, bgolaszewski@baylibre.com
Cc: Kent Gibson <warthog618@gmail.com>
Subject: [libgpiod][PATCH] bindings: cxx: fix sign-compare compile warnings in tests
Date: Wed,  1 Jul 2020 09:39:08 +0800
Message-ID: <20200701013908.42359-1-warthog618@gmail.com> (raw)

Fix sign-compare compile warnings in cxx tests.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
---

Just noticed these warnings while rebuilding in a fresh build environment.
Not sure if they were triggered by an enviromental change, or if I just
wasn't paying enough attention before, but either way this patch makes
the compiler happier.

 bindings/cxx/tests/tests-iter.cpp | 2 +-
 bindings/cxx/tests/tests-line.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bindings/cxx/tests/tests-iter.cpp b/bindings/cxx/tests/tests-iter.cpp
index fdc2cb5..4c07613 100644
--- a/bindings/cxx/tests/tests-iter.cpp
+++ b/bindings/cxx/tests/tests-iter.cpp
@@ -53,7 +53,7 @@ TEST_CASE("Line iterator works", "[iter][line]")
 {
 	mockup::probe_guard mockup_chips({ 4 });
 	::gpiod::chip chip(mockup::instance().chip_name(0));
-	int count = 0;
+	unsigned int count = 0;
 
 	for (auto& it: ::gpiod::line_iter(chip))
 		REQUIRE(it.offset() == count++);
diff --git a/bindings/cxx/tests/tests-line.cpp b/bindings/cxx/tests/tests-line.cpp
index 5353093..e2e4cbc 100644
--- a/bindings/cxx/tests/tests-line.cpp
+++ b/bindings/cxx/tests/tests-line.cpp
@@ -210,7 +210,7 @@ TEST_CASE("Line bulk object works correctly", "[line][bulk]")
 	SECTION("bulk iterator works")
 	{
 		auto lines = chip.get_all_lines();
-		int count = 0;
+		unsigned int count = 0;
 
 		for (auto& it: lines)
 			REQUIRE(it.offset() == count++);

base-commit: b56d6b6a452e47fee8c70514afb99ccd77ada677
-- 
2.27.0


                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200701013908.42359-1-warthog618@gmail.com \
    --to=warthog618@gmail.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=linux-gpio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-GPIO Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-gpio/0 linux-gpio/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-gpio linux-gpio/ https://lore.kernel.org/linux-gpio \
		linux-gpio@vger.kernel.org
	public-inbox-index linux-gpio

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-gpio


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git