Blast-Radius Aware AI Code Review for Business-Critical Systems
LiveReview LiveReview Explore LiveReview

SDL_size_mul_check_overflow - Multiply two integers, checking for overflow.

Availability

       This function is available since SDL 3.2.0.

Simple Directmedia Layer                           SDL 3.2.10                     SDL_size_mul_check_overflow(3)

Description

       If ab would overflow, return false.

       Otherwise store a b via ret and return true.

Function Parameters

a      the multiplicand.

       b      the multiplier.

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

Header File

       Defined in SDL3/SDL_stdinc.h

Name

       SDL_size_mul_check_overflow - Multiply two integers, checking for overflow.

Return Value

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

Synopsis

#include"SDL3/SDL.h"SDL_FORCE_INLINEboolSDL_size_mul_check_overflow(size_ta,size_tb,size_t*ret);

Thread Safety

       It is safe to call this function from any thread.

See Also