Replace 4 with sizeof( int ) in R_GetCommandBufferReserved

This commit is contained in:
Zack Middleton 2015-10-17 21:57:16 -05:00
parent 81e2b6c0cf
commit 41f83ac8b0
2 changed files with 4 additions and 4 deletions

View file

@ -126,8 +126,8 @@ void *R_GetCommandBufferReserved( int bytes, int reservedBytes ) {
bytes = PAD(bytes, sizeof(void *));
// always leave room for the end of list command
if ( cmdList->used + bytes + 4 + reservedBytes > MAX_RENDER_COMMANDS ) {
if ( bytes > MAX_RENDER_COMMANDS - 4 ) {
if ( cmdList->used + bytes + sizeof( int ) + reservedBytes > MAX_RENDER_COMMANDS ) {
if ( bytes > MAX_RENDER_COMMANDS - sizeof( int ) ) {
ri.Error( ERR_FATAL, "R_GetCommandBuffer: bad size %i", bytes );
}
// if we run out of room, just start dropping commands

View file

@ -133,8 +133,8 @@ void *R_GetCommandBufferReserved( int bytes, int reservedBytes ) {
bytes = PAD(bytes, sizeof(void *));
// always leave room for the end of list command
if ( cmdList->used + bytes + 4 + reservedBytes > MAX_RENDER_COMMANDS ) {
if ( bytes > MAX_RENDER_COMMANDS - 4 ) {
if ( cmdList->used + bytes + sizeof( int ) + reservedBytes > MAX_RENDER_COMMANDS ) {
if ( bytes > MAX_RENDER_COMMANDS - sizeof( int ) ) {
ri.Error( ERR_FATAL, "R_GetCommandBuffer: bad size %i", bytes );
}
// if we run out of room, just start dropping commands