logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_size_add_check_overflow - Add two integers, checking for overflow.

Availability

       This function is available since SDL 3.2.0.

Simple Directmedia Layer                           SDL 3.2.20                     SDL_size_add_check_overflow(3)

Description

       If a+b would overflow, return false.

       Otherwise store a+b via ret and return true.

Function Parameters

a      the first addend.

       b      the second addend.

       ret    on non-overflow output, stores the addition result, may not be NULL.

Name

       SDL_size_add_check_overflow - Add two integers, checking for overflow.

Return Value

       Returns false on overflow, true if result is added without overflow.

Synopsis

#include<SDL3/SDL_stdinc.h>SDL_FORCE_INLINEboolSDL_size_add_check_overflow(size_ta,size_tb,size_t*ret);

Thread Safety

       It is safe to call this function from any thread.

See Also