gl: Pass swizzle array directly
authorBenjamin Otte <otte@redhat.com>
Sat, 12 Aug 2023 20:17:29 +0000 (22:17 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 24 Aug 2023 14:20:03 +0000 (10:20 -0400)
There's no need to pass pointers to arrays, as arrays are already
pointers.

gdk/gdkgltexture.c
gdk/gdkmemoryformat.c
gdk/gdkmemoryformatprivate.h
gsk/gl/gskglcommandqueue.c

index d9d62190d9568432752a892a7a682d5ee10d41b7..c0c57f70cbe0b404f0f0a0128c0826e2e958ee3e 100644 (file)
@@ -153,7 +153,7 @@ gdk_gl_texture_find_format (gboolean         use_es,
       if (gdk_memory_format_alpha (format) != alpha)
         continue;
 
-      if (!gdk_memory_format_gl_format (format, use_es, gl_major, gl_minor, &q_internal_format, &q_format, &q_type, &q_swizzle))
+      if (!gdk_memory_format_gl_format (format, use_es, gl_major, gl_minor, &q_internal_format, &q_format, &q_type, q_swizzle))
         continue;
 
       if (q_format != gl_format || q_type != gl_type)
@@ -188,7 +188,7 @@ gdk_gl_texture_do_download (GdkGLTexture *self,
                                    FALSE,
                                    major, minor,
                                    &gl_internal_format,
-                                   &gl_format, &gl_type, &gl_swizzle))
+                                   &gl_format, &gl_type, gl_swizzle))
     {
       if (download->stride == expected_stride &&
           download->format == format)
index ec5583a2add97a4f574f342efdbfcbf38e64c730..ff42f236174883845e12247b320ddd02bc9d2126 100644 (file)
@@ -739,12 +739,12 @@ gdk_memory_format_gl_format (GdkMemoryFormat  format,
                              guint           *out_internal_format,
                              guint           *out_format,
                              guint           *out_type,
-                             GLint          (*out_swizzle)[4])
+                             GLint            out_swizzle[4])
 {
   *out_internal_format = memory_formats[format].gl.internal_format;
   *out_format = memory_formats[format].gl.format;
   *out_type = memory_formats[format].gl.type;
-  memcpy (out_swizzle, &memory_formats[format].gl.swizzle, sizeof(GLint) * 4);
+  memcpy (out_swizzle, memory_formats[format].gl.swizzle, sizeof(GLint) * 4);
 
   if (gles)
     {
index 9f56442de598d7606335bca26dcdb55d42122512..65041791f0a6c94f18674e9174c07e5649919796 100644 (file)
@@ -52,7 +52,7 @@ gboolean                gdk_memory_format_gl_format         (GdkMemoryFormat
                                                              guint                      *out_internal_format,
                                                              guint                      *out_format,
                                                              guint                      *out_type,
-                                                             GLint                     (*out_gizzle)[4]);
+                                                             GLint                       out_gizzle[4]);
 
 void                    gdk_memory_convert                  (guchar                     *dest_data,
                                                              gsize                       dest_stride,
index 1cbd36850066641ee4fb36e8f1bec9056467e86b..0924b739933cda85666d5485fa3de3fdfce07896 100644 (file)
@@ -1456,7 +1456,7 @@ memory_format_gl_format (GdkMemoryFormat  data_format,
                          guint           *gl_internalformat,
                          guint           *gl_format,
                          guint           *gl_type,
-                         GLint          (*gl_swizzle)[4])
+                         GLint            gl_swizzle[4])
 {
   GdkMemoryDepth depth;
 
@@ -1577,7 +1577,7 @@ gsk_gl_command_queue_do_upload_texture_chunk (GskGLCommandQueue *self,
                                          &gl_internalformat,
                                          &gl_format,
                                          &gl_type,
-                                         &gl_swizzle);
+                                         gl_swizzle);
 
   gdk_texture_downloader_init (&downloader, texture);
   gdk_texture_downloader_set_format (&downloader, data_format);
@@ -1683,7 +1683,7 @@ gsk_gl_command_queue_upload_texture_chunks (GskGLCommandQueue    *self,
                                          &gl_internalformat,
                                          &gl_format,
                                          &gl_type,
-                                         &gl_swizzle);
+                                         gl_swizzle);
 
   glTexImage2D (GL_TEXTURE_2D, 0, gl_internalformat, width, height, 0, gl_format, gl_type, NULL);