[gtk/wip/chergert/glproto: 488/493] shorten data field name




commit cf943de8a0c6e52b664ba1370b2fc83c0adee401
Author: Christian Hergert <chergert redhat com>
Date:   Wed Feb 17 14:20:34 2021 -0800

    shorten data field name

 gsk/next/gskglcommandqueue.c | 40 ++++++++++++++++++++--------------------
 gsk/next/inlinearray.h       | 18 +++++++++---------
 2 files changed, 29 insertions(+), 29 deletions(-)
---
diff --git a/gsk/next/gskglcommandqueue.c b/gsk/next/gskglcommandqueue.c
index 687d823409..0c0b9b60fa 100644
--- a/gsk/next/gskglcommandqueue.c
+++ b/gsk/next/gskglcommandqueue.c
@@ -168,13 +168,13 @@ gsk_gl_command_queue_print_batch (GskGLCommandQueue       *self,
 
       for (guint i = 0; i < batch->draw.bind_count; i++)
         {
-          const GskGLCommandBind *bind = &self->batch_binds.elements[batch->draw.bind_offset + i];
+          const GskGLCommandBind *bind = &self->batch_binds.items[batch->draw.bind_offset + i];
           g_print ("      Bind[%d]: %u\n", bind->texture, bind->id);
         }
 
       for (guint i = 0; i < batch->draw.uniform_count; i++)
         {
-          const GskGLCommandUniform *uniform = &self->batch_uniforms.elements[batch->draw.uniform_offset + 
i];
+          const GskGLCommandUniform *uniform = &self->batch_uniforms.items[batch->draw.uniform_offset + i];
           g_printerr ("  Uniform[%02d]: ", uniform->location);
           print_uniform (uniform->info.format,
                          uniform->info.array_count,
@@ -290,8 +290,8 @@ snapshots_equal (GskGLCommandQueue *self,
 
   for (guint i = 0; i < first->draw.bind_count; i++)
     {
-      const GskGLCommandBind *fb = &self->batch_binds.elements[first->draw.bind_offset+i];
-      const GskGLCommandBind *sb = &self->batch_binds.elements[second->draw.bind_offset+i];
+      const GskGLCommandBind *fb = &self->batch_binds.items[first->draw.bind_offset+i];
+      const GskGLCommandBind *sb = &self->batch_binds.items[second->draw.bind_offset+i];
 
       if (fb->id != sb->id || fb->texture != sb->texture)
         return FALSE;
@@ -299,8 +299,8 @@ snapshots_equal (GskGLCommandQueue *self,
 
   for (guint i = 0; i < first->draw.uniform_count; i++)
     {
-      const GskGLCommandUniform *fu = &self->batch_uniforms.elements[first->draw.uniform_offset+i];
-      const GskGLCommandUniform *su = &self->batch_uniforms.elements[second->draw.uniform_offset+i];
+      const GskGLCommandUniform *fu = &self->batch_uniforms.items[first->draw.uniform_offset+i];
+      const GskGLCommandUniform *su = &self->batch_uniforms.items[second->draw.uniform_offset+i];
       gconstpointer fdata;
       gconstpointer sdata;
       gsize len;
@@ -464,7 +464,7 @@ enqueue_batch (GskGLCommandQueue *self)
 
   if (self->tail_batch_index != -1)
     {
-      GskGLCommandBatch *prev = &self->batches.elements[self->tail_batch_index];
+      GskGLCommandBatch *prev = &self->batches.items[self->tail_batch_index];
 
       prev->any.next_batch_index = index;
     }
@@ -568,7 +568,7 @@ gsk_gl_command_queue_end_draw (GskGLCommandQueue *self)
     }
 
   if (self->batches.len > 1)
-    last_batch = &self->batches.elements[self->batches.len - 2];
+    last_batch = &self->batches.items[self->batches.len - 2];
   else
     last_batch = NULL;
 
@@ -850,12 +850,12 @@ gsk_gl_command_queue_unlink (GskGLCommandQueue *self,
   if (batch->any.prev_batch_index == -1)
     self->head_batch_index = batch->any.next_batch_index;
   else
-    self->batches.elements[batch->any.prev_batch_index].any.next_batch_index = batch->any.next_batch_index;
+    self->batches.items[batch->any.prev_batch_index].any.next_batch_index = batch->any.next_batch_index;
 
   if (batch->any.next_batch_index == -1)
     self->tail_batch_index = batch->any.prev_batch_index;
   else
-    self->batches.elements[batch->any.next_batch_index].any.prev_batch_index = batch->any.prev_batch_index;
+    self->batches.items[batch->any.next_batch_index].any.prev_batch_index = batch->any.prev_batch_index;
 
   batch->any.prev_batch_index = -1;
   batch->any.next_batch_index = -1;
@@ -869,10 +869,10 @@ gsk_gl_command_queue_insert_before (GskGLCommandQueue *self,
   int sibling_index;
   int index;
 
-  g_assert (batch >= self->batches.elements);
-  g_assert (batch < &self->batches.elements[self->batches.len]);
-  g_assert (sibling >= self->batches.elements);
-  g_assert (sibling < &self->batches.elements[self->batches.len]);
+  g_assert (batch >= self->batches.items);
+  g_assert (batch < &self->batches.items[self->batches.len]);
+  g_assert (sibling >= self->batches.items);
+  g_assert (sibling < &self->batches.items[self->batches.len]);
 
   index = gsk_gl_command_batch_array_index_of (&self->batches, batch);
   sibling_index = gsk_gl_command_batch_array_index_of (&self->batches, sibling);
@@ -881,7 +881,7 @@ gsk_gl_command_queue_insert_before (GskGLCommandQueue *self,
   batch->any.prev_batch_index = sibling->any.prev_batch_index;
 
   if (batch->any.prev_batch_index > -1)
-    self->batches.elements[batch->any.prev_batch_index].any.next_batch_index = index;
+    self->batches.items[batch->any.prev_batch_index].any.next_batch_index = index;
 
   sibling->any.prev_batch_index = index;
 
@@ -918,7 +918,7 @@ gsk_gl_command_queue_sort_batches (GskGLCommandQueue *self)
 
   while (index >= 0)
     {
-      GskGLCommandBatch *batch = &self->batches.elements[index];
+      GskGLCommandBatch *batch = &self->batches.items[index];
       int cur_index = index;
       int fbo = -1;
 
@@ -955,7 +955,7 @@ gsk_gl_command_queue_sort_batches (GskGLCommandQueue *self)
       if (seen[fbo] != -1 && seen[fbo] != batch->any.next_batch_index)
         {
           int mru_index = seen[fbo];
-          GskGLCommandBatch *mru = &self->batches.elements[mru_index];
+          GskGLCommandBatch *mru = &self->batches.items[mru_index];
 
           g_assert (mru_index > -1);
 
@@ -1075,7 +1075,7 @@ gsk_gl_command_queue_execute (GskGLCommandQueue    *self,
 
   while (next_batch_index >= 0)
     {
-      const GskGLCommandBatch *batch = &self->batches.elements[next_batch_index];
+      const GskGLCommandBatch *batch = &self->batches.items[next_batch_index];
 
       g_assert (next_batch_index >= 0);
       g_assert (next_batch_index < self->batches.len);
@@ -1121,7 +1121,7 @@ gsk_gl_command_queue_execute (GskGLCommandQueue    *self,
 
           if G_UNLIKELY (batch->draw.bind_count > 0)
             {
-              const GskGLCommandBind *bind = &self->batch_binds.elements[batch->draw.bind_offset];
+              const GskGLCommandBind *bind = &self->batch_binds.items[batch->draw.bind_offset];
 
               for (guint i = 0; i < batch->draw.bind_count; i++)
                 {
@@ -1145,7 +1145,7 @@ gsk_gl_command_queue_execute (GskGLCommandQueue    *self,
 
           if (batch->draw.uniform_count > 0)
             {
-              const GskGLCommandUniform *u = &self->batch_uniforms.elements[batch->draw.uniform_offset];
+              const GskGLCommandUniform *u = &self->batch_uniforms.items[batch->draw.uniform_offset];
 
               for (guint i = 0; i < batch->draw.uniform_count; i++, u++)
                 apply_uniform (gsk_gl_uniform_state_get_uniform_data (self->uniforms, u->info.offset),
diff --git a/gsk/next/inlinearray.h b/gsk/next/inlinearray.h
index 3495846222..166f8f8e15 100644
--- a/gsk/next/inlinearray.h
+++ b/gsk/next/inlinearray.h
@@ -5,7 +5,7 @@
   typedef struct _##Type##Array {                                   \
     gsize len;                                                      \
     gsize allocated;                                                \
-    Type *elements;                                                 \
+    Type *items;                                                    \
   } Type##Array;                                                    \
                                                                     \
   static inline void                                                \
@@ -14,7 +14,7 @@
   {                                                                 \
     ar->len = 0;                                                    \
     ar->allocated = initial_size ? initial_size : 16;               \
-    ar->elements = g_new0 (Type, ar->allocated);                    \
+    ar->items = g_new0 (Type, ar->allocated);                       \
   }                                                                 \
                                                                     \
   static inline void                                                \
@@ -22,19 +22,19 @@
   {                                                                 \
     ar->len = 0;                                                    \
     ar->allocated = 0;                                              \
-    g_clear_pointer (&ar->elements, g_free);                        \
+    g_clear_pointer (&ar->items, g_free);                           \
   }                                                                 \
                                                                     \
   static inline Type *                                              \
   prefix##_head (Type##Array *ar)                                   \
   {                                                                 \
-    return &ar->elements[0];                                        \
+    return &ar->items[0];                                           \
   }                                                                 \
                                                                     \
   static inline Type *                                              \
   prefix##_tail (Type##Array *ar)                                   \
   {                                                                 \
-    return &ar->elements[ar->len-1];                                \
+    return &ar->items[ar->len-1];                                   \
   }                                                                 \
                                                                     \
   static inline Type *                                              \
@@ -43,7 +43,7 @@
     if G_UNLIKELY (ar->len == ar->allocated)                        \
       {                                                             \
         ar->allocated *= 2;                                         \
-        ar->elements = g_renew (Type, ar->elements, ar->allocated); \
+        ar->items = g_renew (Type, ar->items, ar->allocated);       \
       }                                                             \
                                                                     \
     ar->len++;                                                      \
@@ -59,19 +59,19 @@
       {                                                             \
         while ((ar->len + n) > ar->allocated)                       \
           ar->allocated *= 2;                                       \
-        ar->elements = g_renew (Type, ar->elements, ar->allocated); \
+        ar->items = g_renew (Type, ar->items, ar->allocated);       \
       }                                                             \
                                                                     \
     ar->len += n;                                                   \
                                                                     \
-    return &ar->elements[ar->len-n];                                \
+    return &ar->items[ar->len-n];                                   \
   }                                                                 \
                                                                     \
   static inline gsize                                               \
   prefix##_index_of (Type##Array *ar,                               \
                      const Type  *element)                          \
   {                                                                 \
-    return element - &ar->elements[0];                              \
+    return element - &ar->items[0];                                 \
   }
 
 #endif /* __INLINE_ARRAY_H__ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]