Commit ebe176ee authored by Eric Engestrom's avatar Eric Engestrom Committed by Eric Engestrom

gbm: use size_t for array indexes

Signed-off-by: Eric Engestrom's avatarEric Engestrom <eric@engestrom.ch>
Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
parent ad7e4108
Pipeline #70222 passed with stages
in 15 minutes and 39 seconds
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment