[pulseaudio-commits] r2033 - /trunk/src/pulsecore/macro.h

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Thu Nov 8 17:29:51 PST 2007


Author: lennart
Date: Fri Nov  9 02:29:50 2007
New Revision: 2033

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2033&root=pulseaudio&view=rev
Log:
add PA_CLAMP_LIKELY and PA_CLAMP_UNLIKELY macros

Modified:
    trunk/src/pulsecore/macro.h

Modified: trunk/src/pulsecore/macro.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/macro.h?rev=2033&root=pulseaudio&r1=2032&r2=2033&view=diff
==============================================================================
--- trunk/src/pulsecore/macro.h (original)
+++ trunk/src/pulsecore/macro.h Fri Nov  9 02:29:50 2007
@@ -31,6 +31,7 @@
 #include <unistd.h>
 
 #include <pulsecore/log.h>
+#include <pulsecore/gccmacro.h>
 
 #ifndef PACKAGE
 #error "Please include config.h before including this file!"
@@ -73,8 +74,11 @@
 #endif
 
 #ifndef CLAMP
-#define CLAMP(x, low, high)  (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
+#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
 #endif
+
+#define PA_CLAMP_LIKELY(x, low, high) (PA_LIKELY((x) > (high)) ? (high) : PA_LIKELY(((x) < (low)) ? (low) : (x)))
+#define PA_CLAMP_UNLIKELY(x, low, high) (PA_UNLIKELY((x) > (high)) ? (high) : PA_UNLIKELY(((x) < (low)) ? (low) : (x)))
 
 /* This type is not intended to be used in exported APIs! Use classic "int" there! */
 #ifdef HAVE_STD_BOOL




More information about the pulseaudio-commits mailing list