X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Fimports.h;h=a421eb5e755bc96da57729c2a9941d2fee9016c8;hb=5340b6dff73a0a23531ce2a5f28fba8303adab6e;hp=0e6e301fdeb6291625ab143d286fe1046ed93a47;hpb=f25a90ed222216d89b3cd33ec60647ff78286074;p=mesa.git diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 0e6e301fdeb..a421eb5e755 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -462,6 +462,16 @@ static INLINE int iceil(float f) #endif +/** + * Is x a power of two? + */ +static INLINE int +_mesa_is_pow_two(int x) +{ + return !(x & (x - 1)); +} + + /*** *** UNCLAMPED_FLOAT_TO_UBYTE: clamp float to [0,1] and map to ubyte in [0,255] *** CLAMPED_FLOAT_TO_UBYTE: map float known to be in [0,1] to ubyte in [0,255] @@ -753,9 +763,15 @@ _mesa_strtod( const char *s, char **end ); extern int _mesa_sprintf( char *str, const char *fmt, ... ); +extern int +_mesa_snprintf( char *str, size_t size, const char *fmt, ... ); + extern void _mesa_printf( const char *fmtString, ... ); +extern void +_mesa_fprintf( FILE *f, const char *fmtString, ... ); + extern int _mesa_vsprintf( char *str, const char *fmt, va_list args );