summaryrefslogtreecommitdiffstats
path: root/src/gbm/backends/dri/gbm_dri.c
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2019-09-01 17:42:23 +0100
committerEric Engestrom <[email protected]>2019-10-13 18:10:47 +0100
commitebe176eeff75b76527fc99d0a0f88b48ab04d0d7 (patch)
tree0252477fc325917ec30e82bfda468a6aea7e37b4 /src/gbm/backends/dri/gbm_dri.c
parentad7e4108936df34d564176b481e7d805af9da921 (diff)
gbm: use size_t for array indexes
Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/gbm/backends/dri/gbm_dri.c')
-rw-r--r--src/gbm/backends/dri/gbm_dri.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index ce24c3183e0..8fe6a0265fb 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -281,12 +281,11 @@ dri_bind_extensions(struct gbm_dri_device *dri,
struct dri_extension_match *matches, size_t num_matches,
const __DRIextension **extensions)
{
- int i, j;
bool ret = true;
void *field;
- for (i = 0; extensions[i]; i++) {
- for (j = 0; j < num_matches; j++) {
+ for (size_t i = 0; extensions[i]; i++) {
+ for (size_t j = 0; j < num_matches; j++) {
if (strcmp(extensions[i]->name, matches[j].name) == 0 &&
extensions[i]->version >= matches[j].version) {
field = ((char *) dri + matches[j].offset);
@@ -295,7 +294,7 @@ dri_bind_extensions(struct gbm_dri_device *dri,
}
}
- for (j = 0; j < num_matches; j++) {
+ for (size_t j = 0; j < num_matches; j++) {
field = ((char *) dri + matches[j].offset);
if ((*(const __DRIextension **) field == NULL) && !matches[j].optional) {
ret = false;
@@ -571,10 +570,8 @@ static const struct gbm_dri_visual gbm_dri_visuals_table[] = {
static int
gbm_format_to_dri_format(uint32_t gbm_format)
{
- int i;
-
gbm_format = gbm_format_canonicalize(gbm_format);
- for (i = 0; i < ARRAY_SIZE(gbm_dri_visuals_table); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(gbm_dri_visuals_table); i++) {
if (gbm_dri_visuals_table[i].gbm_format == gbm_format)
return gbm_dri_visuals_table[i].dri_image_format;
}
@@ -585,9 +582,7 @@ gbm_format_to_dri_format(uint32_t gbm_format)
static uint32_t
gbm_dri_to_gbm_format(int dri_format)
{
- int i;
-
- for (i = 0; i < ARRAY_SIZE(gbm_dri_visuals_table); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(gbm_dri_visuals_table); i++) {
if (gbm_dri_visuals_table[i].dri_image_format == dri_format)
return gbm_dri_visuals_table[i].gbm_format;
}