Skip to content

Commit

Permalink
render: constified some local variables in SDL_AllocateRenderVertices.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Sep 19, 2021
1 parent 5faea84 commit 857cc7c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/render/SDL_render.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 857cc7c

Please sign in to comment.