xiaoxiang781216 commented on code in PR #3801:
URL: https://github.com/apache/nuttx-apps/pull/3801#discussion_r4115920765


##########
graphics/tinygl/0005-Declare-the-input-array-parameters-const-as-OpenGL-d.patch:
##########
@@ -0,0 +1,182 @@
+From 202a4eba444f29055174ee33394a608607c4d35a Mon Sep 17 00:00:00 2001
+From: Alan Carvalho de Assis <[email protected]>
+Date: Sat, 26 Sep 2026 13:51:30 -0300
+Subject: [PATCH] Declare the input array parameters const, as OpenGL does
+
+glMaterialfv(), glLightfv(), glLightModelfv(), the glVertex*v(),
+glColor*v(), glNormal*v(), glTexCoord*v() and glRasterPos*v() families
+only read the array they are passed, and OpenGL declares that parameter
+const.  Do the same, so that callers can pass constant data, for
+example "static const GLfloat red[4]", without casts or warnings.
+---
+ include/GL/gl.h | 28 ++++++++++++++--------------
+ src/api.c       | 16 ++++++++--------
+ src/zraster.c   |  6 +++---
+ 3 files changed, 25 insertions(+), 25 deletions(-)
+
+diff --git a/include/GL/gl.h b/include/GL/gl.h
+index ab4a10b..1f651fc 100644
+--- a/include/GL/gl.h
++++ b/include/GL/gl.h
+@@ -804,26 +804,26 @@ void glPlotPixel(GLint x, GLint y, GLuint pixel);
+ #define PROTO_GL1(name)                               \
+ void gl ## name ## 1f(GLfloat);       \
+ void gl ## name ## 1d(GLdouble);      \
+-void gl ## name ## 1fv(GLfloat *);            \

Review Comment:
   whether OpenGL define these API with const?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to