Bug 800106: replace some NS_ALWAYS_INLINEs with MOZ_ALWAYS_INLINEs; r=ehsan
authorJacek Szpot <maligree@gmail.com>
Tue, 23 Oct 2012 13:31:22 +0200
changeset 111316 531b7f4293e9c1d9fa8eea6f2d4f5ee2bcff2347
parent 111315 04a2e09f4bc1da54f8638abdb5f66a62f1eb2fd5
child 111317 82d78390fda1a69232f8d1bf0035a9c65e49d869
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersehsan
bugs800106
milestone19.0a1
Bug 800106: replace some NS_ALWAYS_INLINEs with MOZ_ALWAYS_INLINEs; r=ehsan
toolkit/components/places/SQLFunctions.cpp
xpcom/string/public/nsUTF8Utils.h
--- a/toolkit/components/places/SQLFunctions.cpp
+++ b/toolkit/components/places/SQLFunctions.cpp
@@ -39,17 +39,17 @@ namespace {
    *
    * @param aStart the beginning of the UTF-8 sequence
    * @param aNext the next character in the sequence
    * @param aEnd the first byte which is not part of the sequence
    *
    * @return a pointer to the next word boundary after aStart
    */
   static
-  NS_ALWAYS_INLINE const_char_iterator
+  MOZ_ALWAYS_INLINE const_char_iterator
   nextWordBoundary(const_char_iterator const aStart,
                    const_char_iterator const aNext,
                    const_char_iterator const aEnd) {
 
     const_char_iterator cur = aStart;
     if (('a' <= *cur && *cur <= 'z') ||
         ('A' <= *cur && *cur <= 'Z')) {
 
@@ -71,32 +71,32 @@ namespace {
     eFindOnBoundary,
     eFindAnywhere
   };
 
   /**
    * findAnywhere and findOnBoundary do almost the same thing, so it's natural
    * to implement them in terms of a single function.  They're both
    * performance-critical functions, however, and checking aBehavior makes them
-   * a bit slower.  Our solution is to define findInString as NS_ALWAYS_INLINE
+   * a bit slower.  Our solution is to define findInString as MOZ_ALWAYS_INLINE
    * and rely on the compiler to optimize out the aBehavior check.
    *
    * @param aToken
    *        The token we're searching for
    * @param aSourceString
    *        The string in which we're searching
    * @param aBehavior
    *        eFindOnBoundary if we should only consider matchines which occur on
    *        word boundaries, or eFindAnywhere if we should consider matches
    *        which appear anywhere.
    *
    * @return true if aToken was found in aSourceString, false otherwise.
    */
   static
-  NS_ALWAYS_INLINE bool
+  MOZ_ALWAYS_INLINE bool
   findInString(const nsDependentCSubstring &aToken,
                const nsACString &aSourceString,
                FindInStringBehavior aBehavior)
   {
     // CaseInsensitiveUTF8CharsEqual assumes that there's at least one byte in
     // the both strings, so don't pass an empty token here.
     NS_PRECONDITION(!aToken.IsEmpty(), "Don't search for an empty token!");
 
--- a/xpcom/string/public/nsUTF8Utils.h
+++ b/xpcom/string/public/nsUTF8Utils.h
@@ -281,17 +281,17 @@ class ConvertUTF8toUTF16
 
     ConvertUTF8toUTF16( buffer_type* aBuffer )
         : mStart(aBuffer), mBuffer(aBuffer), mErrorEncountered(false) {}
 
     size_t Length() const { return mBuffer - mStart; }
 
     bool ErrorEncountered() const { return mErrorEncountered; }
 
-    void NS_ALWAYS_INLINE write( const value_type* start, uint32_t N )
+    void MOZ_ALWAYS_INLINE write( const value_type* start, uint32_t N )
       {
         if ( mErrorEncountered )
           return;
 
         // algorithm assumes utf8 units won't
         // be spread across fragments
         const value_type* p = start;
         const value_type* end = start + N;
@@ -340,17 +340,17 @@ class CalculateUTF8Length
   {
     public:
       typedef char value_type;
 
     CalculateUTF8Length() : mLength(0), mErrorEncountered(false) { }
 
     size_t Length() const { return mLength; }
 
-    void NS_ALWAYS_INLINE write( const value_type* start, uint32_t N )
+    void MOZ_ALWAYS_INLINE write( const value_type* start, uint32_t N )
       {
           // ignore any further requests
         if ( mErrorEncountered )
             return;
 
         // algorithm assumes utf8 units won't
         // be spread across fragments
         const value_type* p = start;
@@ -444,17 +444,17 @@ class ConvertUTF16toUTF8
     // |ConvertUTF8toUTF16|, but it's that way for backwards
     // compatibility.
 
     ConvertUTF16toUTF8( buffer_type* aBuffer )
         : mStart(aBuffer), mBuffer(aBuffer) {}
 
     size_t Size() const { return mBuffer - mStart; }
 
-    void NS_ALWAYS_INLINE write( const value_type* start, uint32_t N )
+    void MOZ_ALWAYS_INLINE write( const value_type* start, uint32_t N )
       {
         buffer_type *out = mBuffer; // gcc isn't smart enough to do this!
 
         for (const value_type *p = start, *end = start + N; p < end; ++p )
           {
             value_type c = *p;
             if (! (c & 0xFF80)) // U+0000 - U+007F
               {
@@ -561,17 +561,17 @@ class CalculateUTF8Size
     public:
       typedef PRUnichar value_type;
 
     CalculateUTF8Size()
       : mSize(0) { }
 
     size_t Size() const { return mSize; }
 
-    void NS_ALWAYS_INLINE write( const value_type* start, uint32_t N )
+    void MOZ_ALWAYS_INLINE write( const value_type* start, uint32_t N )
       {
         // Assume UCS2 surrogate pairs won't be spread across fragments.
         for (const value_type *p = start, *end = start + N; p < end; ++p )
           {
             value_type c = *p;
             if (! (c & 0xFF80)) // U+0000 - U+007F
               mSize += 1;
             else if (! (c & 0xF800)) // U+0100 - U+07FF