i915g: s/Elements/ARRAY_SIZE/
authorBrian Paul <brianp@vmware.com>
Thu, 28 Apr 2016 17:37:50 +0000 (11:37 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 3 May 2016 21:40:48 +0000 (15:40 -0600)
Signed-off-by: Brian Paul <brianp@vmware.com>
src/gallium/drivers/i915/i915_fpc_translate.c
src/gallium/drivers/i915/i915_resource_texture.c
src/gallium/drivers/i915/i915_state.c
src/gallium/drivers/i915/i915_state_dynamic.c
src/gallium/drivers/i915/i915_state_emit.c
src/gallium/drivers/i915/i915_state_immediate.c

index 456be9d92cac5863586074ed1d89be27aa4d738c..70016ed51e6a0b6bb3b60e4123cdb6e26bb804d7 100644 (file)
@@ -134,8 +134,8 @@ i915_use_passthrough_shader(struct i915_fragment_shader *fs)
    if (fs->program) {
       memcpy(fs->program, passthrough_program, sizeof(passthrough_program));
       memcpy(fs->decl, passthrough_decl, sizeof(passthrough_decl));
-      fs->program_len = Elements(passthrough_program);
-      fs->decl_len = Elements(passthrough_decl);
+      fs->program_len = ARRAY_SIZE(passthrough_program);
+      fs->decl_len = ARRAY_SIZE(passthrough_decl);
    }
    fs->num_constants = 0;
 }
index 03cdcf1c990deb79a92544a07d0c07fccb53980e..af9d97a8acc6c55ff254fcedf42ffe660cd8e781 100644 (file)
@@ -133,7 +133,7 @@ static void
 i915_texture_set_level_info(struct i915_texture *tex,
                             unsigned level, unsigned nr_images)
 {
-   assert(level < Elements(tex->nr_images));
+   assert(level < ARRAY_SIZE(tex->nr_images));
    assert(nr_images);
    assert(!tex->image_offset[level]);
 
@@ -705,7 +705,7 @@ i915_texture_destroy(struct pipe_screen *screen,
    if (tex->buffer)
       iws->buffer_destroy(iws, tex->buffer);
 
-   for (i = 0; i < Elements(tex->image_offset); i++)
+   for (i = 0; i < ARRAY_SIZE(tex->image_offset); i++)
       FREE(tex->image_offset[i]);
 
    FREE(tex);
index b54a9fbf4f9fb692c720863de6a6db84c4d888c1..8fa2f42e7c69661c6ad54c305d7a56660fbba923 100644 (file)
@@ -301,7 +301,7 @@ i915_bind_vertex_sampler_states(struct pipe_context *pipe,
    struct i915_context *i915 = i915_context(pipe);
    unsigned i;
 
-   assert(start + num <= Elements(i915->vertex_samplers));
+   assert(start + num <= ARRAY_SIZE(i915->vertex_samplers));
 
    /* Check for no-op */
    if (num == i915->num_vertex_samplers &&
@@ -443,7 +443,7 @@ i915_cleanup_vertex_sampling(struct i915_context *i915)
 {
    struct i915_winsys *iws = i915->iws;
    unsigned i;
-   for (i = 0; i < Elements(i915->mapped_vs_tex); i++) {
+   for (i = 0; i < ARRAY_SIZE(i915->mapped_vs_tex); i++) {
       if (i915->mapped_vs_tex_buffer[i]) { 
          iws->buffer_unmap(iws, i915->mapped_vs_tex_buffer[i]);
          pipe_resource_reference(&i915->mapped_vs_tex[i], NULL);
@@ -769,7 +769,7 @@ i915_set_vertex_sampler_views(struct pipe_context *pipe,
    struct i915_context *i915 = i915_context(pipe);
    uint i;
 
-   assert(num <= Elements(i915->vertex_sampler_views));
+   assert(num <= ARRAY_SIZE(i915->vertex_sampler_views));
 
    /* Check for no-op */
    if (num == i915->num_vertex_sampler_views &&
@@ -777,7 +777,7 @@ i915_set_vertex_sampler_views(struct pipe_context *pipe,
       return;
    }
 
-   for (i = 0; i < Elements(i915->vertex_sampler_views); i++) {
+   for (i = 0; i < ARRAY_SIZE(i915->vertex_sampler_views); i++) {
       struct pipe_sampler_view *view = i < num ? views[i] : NULL;
 
       pipe_sampler_view_reference(&i915->vertex_sampler_views[i], view);
index 1c29e8ae671110fd5ade228d48769d73491ae792..85b272156756be8f4bf9a8633a0425a1d5bd9564 100644 (file)
@@ -307,7 +307,7 @@ static void update_dynamic(struct i915_context *i915)
 {
    int i;
 
-   for (i = 0; i < Elements(atoms); i++)
+   for (i = 0; i < ARRAY_SIZE(atoms); i++)
       if (i915->dirty & atoms[i]->dirty)
          atoms[i]->update(i915);
 }
index 92751f3cf8b0c54c7a3cfc45ff7742058e317646..a407020f67a9d329490f48ba8842005c9cfc545b 100644 (file)
@@ -110,7 +110,7 @@ static void
 emit_invariant(struct i915_context *i915)
 {
    i915_winsys_batchbuffer_write(i915->batch, invariant_state,
-                                 Elements(invariant_state)*sizeof(uint32_t));
+                                 ARRAY_SIZE(invariant_state)*sizeof(uint32_t));
 }
 
 static void
@@ -495,7 +495,7 @@ i915_validate_state(struct i915_context *i915, unsigned *batch_space)
 
    i915->num_validation_buffers = 0;
    if (i915->hardware_dirty & I915_HW_INVARIANT)
-      *batch_space = Elements(invariant_state);
+      *batch_space = ARRAY_SIZE(invariant_state);
    else
       *batch_space = 0;
 
index c4a6cae1beb9fe07060ec3a9ee1d26ef0172c4e7..b6007acdd1c2ab32df113524e9e5b1b77c8c0502 100644 (file)
@@ -222,7 +222,7 @@ static void update_immediate(struct i915_context *i915)
 {
    int i;
 
-   for (i = 0; i < Elements(atoms); i++)
+   for (i = 0; i < ARRAY_SIZE(atoms); i++)
       if (i915->dirty & atoms[i]->dirty)
          atoms[i]->update(i915);
 }