[Mesa-dev] [PATCH 10/21] mesa/gbm: Resolve GCC sign-compare warning.
Rhys Kidd
rhyskidd at gmail.com
Sun Aug 2 23:09:11 PDT 2015
mesa/src/gbm/main/backend.c: In function 'find_backend':
mesa/src/gbm/main/backend.c:70:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (i = 0; i < ARRAY_SIZE(backends); ++i) {
^
mesa/src/gbm/main/backend.c: In function '_gbm_create_device':
mesa/src/gbm/main/backend.c:95:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (i = 0; i < ARRAY_SIZE(backends) && dev == NULL; ++i) {
^
Signed-off-by: Rhys Kidd <rhyskidd at gmail.com>
---
src/gbm/main/backend.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gbm/main/backend.c b/src/gbm/main/backend.c
index 4929d73..cf35153 100644
--- a/src/gbm/main/backend.c
+++ b/src/gbm/main/backend.c
@@ -65,7 +65,7 @@ static const struct backend_desc *
find_backend(const char *name)
{
const struct backend_desc *backend = NULL;
- int i;
+ unsigned int i;
for (i = 0; i < ARRAY_SIZE(backends); ++i) {
if (strcmp(backends[i].name, name) == 0) {
@@ -82,7 +82,7 @@ _gbm_create_device(int fd)
{
const struct gbm_backend *backend = NULL;
struct gbm_device *dev = NULL;
- int i;
+ unsigned int i;
const char *b;
b = getenv("GBM_BACKEND");
--
2.1.4
More information about the mesa-dev
mailing list