bug 716871 remove nshttp::CLAMP r=jduell
authorPatrick McManus <mcmanus@ducksong.com>
Tue, 10 Jan 2012 20:07:29 -0500
changeset 84200 208cbee3b3a0f75a3f53d52f26ece07074f9bb4f
parent 84199 d71926e38f2c62dc725309f167d82f94da163c18
child 84201 3710dc1826ca8e0499902287b924a57c5c3d4573
push id21832
push userbmo@edmorley.co.uk
push dateWed, 11 Jan 2012 17:04:15 +0000
treeherdermozilla-central@40c9f9ff9fd5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjduell
bugs716871
milestone12.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 716871 remove nshttp::CLAMP r=jduell
netwerk/protocol/http/HttpChannelChild.cpp
netwerk/protocol/http/nsHttp.h
--- a/netwerk/protocol/http/HttpChannelChild.cpp
+++ b/netwerk/protocol/http/HttpChannelChild.cpp
@@ -1212,17 +1212,17 @@ HttpChannelChild::ResumeAt(PRUint64 star
 
 //-----------------------------------------------------------------------------
 // HttpChannelChild::nsISupportsPriority
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 HttpChannelChild::SetPriority(PRInt32 aPriority)
 {
-  PRInt16 newValue = CLAMP(aPriority, PR_INT16_MIN, PR_INT16_MAX);
+  PRInt16 newValue = clamped(aPriority, PR_INT16_MIN, PR_INT16_MAX);
   if (mPriority == newValue)
     return NS_OK;
   mPriority = newValue;
   if (RemoteChannelExists())
     SendSetPriority(mPriority);
   return NS_OK;
 }
 
--- a/netwerk/protocol/http/nsHttp.h
+++ b/netwerk/protocol/http/nsHttp.h
@@ -229,19 +229,15 @@ struct nsHttp
 static inline PRUint32
 PRTimeToSeconds(PRTime t_usec)
 {
     return PRUint32( t_usec / PR_USEC_PER_SEC );
 }
 
 #define NowInSeconds() PRTimeToSeconds(PR_Now())
 
-// ripped from glib.h
-#undef  CLAMP
-#define CLAMP(x, low, high)  (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
-
 // round q-value to one decimal place; return most significant digit as uint.
 #define QVAL_TO_UINT(q) ((unsigned int) ((q + 0.05) * 10.0))
 
 #define HTTP_LWS " \t"
 #define HTTP_HEADER_VALUE_SEPS HTTP_LWS ","
 
 #endif // nsHttp_h__