From 85e4d084752d2ca109630d393362531b05cefdf3 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Wed, 29 Nov 2023 11:53:03 +0100 Subject: [PATCH] cogl: Remove unused utils Part-of: --- cogl/cogl/cogl-util.c | 20 -------------------- cogl/cogl/cogl-util.h | 32 -------------------------------- 2 files changed, 52 deletions(-) diff --git a/cogl/cogl/cogl-util.c b/cogl/cogl/cogl-util.c index 797e7d36a..ed2a95c58 100644 --- a/cogl/cogl/cogl-util.c +++ b/cogl/cogl/cogl-util.c @@ -35,26 +35,6 @@ #include "cogl/cogl-util.h" #include "cogl/cogl-private.h" -/* - * cogl_util_next_p2: - * @a: Value to get the next power of two - * - * Calculates the next power of two greater than or equal to @a. - * - * Return value: @a if @a is already a power of two, otherwise returns - * the next nearest power of two. - */ -COGL_EXPORT int -_cogl_util_next_p2 (int a) -{ - int rval = 1; - - while (rval < a) - rval <<= 1; - - return rval; -} - unsigned int _cogl_util_one_at_a_time_mix (unsigned int hash) { diff --git a/cogl/cogl/cogl-util.h b/cogl/cogl/cogl-util.h index 9b9b8e42f..16fdced48 100644 --- a/cogl/cogl/cogl-util.h +++ b/cogl/cogl/cogl-util.h @@ -39,31 +39,6 @@ #include -int -_cogl_util_next_p2 (int a); - -/* The signbit macro is defined by ISO C99 so it should be available, - however if it's not we can fallback to an evil hack */ -#ifdef signbit -#define cogl_util_float_signbit(x) signbit(x) -#else -/* This trick was stolen from here: - http://lists.boost.org/Archives/boost/2006/08/108731.php - - It xors the integer reinterpretations of -1.0f and 1.0f. In theory - they should only differ by the signbit so that gives a mask for the - sign which we can just test against the value */ -static inline gboolean -cogl_util_float_signbit (float x) -{ - static const union { float f; uint32_t i; } negative_one = { -1.0f }; - static const union { float f; uint32_t i; } positive_one = { +1.0f }; - union { float f; uint32_t i; } value = { x }; - - return !!((negative_one.i ^ positive_one.i) & value.i); -} -#endif - /* This is a replacement for the nearbyint function which always rounds to the nearest integer. nearbyint is apparently a C99 function so it might not always be available but also it seems in @@ -72,13 +47,6 @@ cogl_util_float_signbit (float x) negative numbers. */ #define COGL_UTIL_NEARBYINT(x) ((int) ((x) < 0.0f ? (x) - 0.5f : (x) + 0.5f)) -/* Returns whether the given integer is a power of two */ -static inline gboolean -_cogl_util_is_pot (unsigned int num) -{ - /* Make sure there is only one bit set */ - return (num & (num - 1)) == 0; -} /* Split Bob Jenkins' One-at-a-Time hash *