Commit 857cc7c0c93f003dbfc5fed7a87de907fffb2a1b

Ryan C. Gordon 2021-09-19T00:05:21

render: constified some local variables in SDL_AllocateRenderVertices.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c
index b0b3ad7..7db35dd 100644
--- a/src/render/SDL_render.c
+++ b/src/render/SDL_render.c
@@ -287,10 +287,10 @@ void *
 SDL_AllocateRenderVertices(SDL_Renderer *renderer, const size_t numbytes, const size_t alignment, size_t *offset)
 {
     const size_t needed = renderer->vertex_data_used + numbytes + alignment;
-    size_t current_offset = renderer->vertex_data_used;
+    const size_t current_offset = renderer->vertex_data_used;
 
-    size_t aligner = (alignment && ((current_offset & (alignment - 1)) != 0)) ? (alignment - (current_offset & (alignment - 1))) : 0;
-    size_t aligned = current_offset + aligner;
+    const size_t aligner = (alignment && ((current_offset & (alignment - 1)) != 0)) ? (alignment - (current_offset & (alignment - 1))) : 0;
+    const size_t aligned = current_offset + aligner;
 
     if (renderer->vertex_data_allocation < needed) {
         const size_t current_allocation = renderer->vertex_data ? renderer->vertex_data_allocation : 1024;