VirtualBox

Ignore:
Timestamp:
Dec 4, 2023 5:24:33 PM (14 months ago)
Author:
vboxsync
Message:

libs/xpcom: Get rid of PL_strcmp/PL_strncmp and replace with IPRT equivalents, bugref:10545

Location:
trunk/src/libs/xpcom18a4/xpcom/ds
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/xpcom/ds/nsAtomTable.cpp

    r101962 r102457  
    3636 *
    3737 * ***** END LICENSE BLOCK ***** */
     38#include <iprt/string.h>
    3839
    3940#include "nsAtomTable.h"
     
    181182  const AtomTableEntry *he = NS_STATIC_CAST(const AtomTableEntry*, entry);
    182183  const char* keyStr = NS_STATIC_CAST(const char*, key);
    183   return nsCRT::strcmp(keyStr, he->get()) == 0;
     184  return RTStrCmp(keyStr, he->get()) == 0;
    184185}
    185186
  • trunk/src/libs/xpcom18a4/xpcom/ds/nsCRT.h

    r102326 r102457  
    146146  }                                                                             
    147147
    148   /// Compare s1 and s2.
    149   static PRInt32 strcmp(const char* s1, const char* s2) {
    150     return PRInt32(PL_strcmp(s1, s2));
    151   }
    152 
    153   static PRInt32 strncmp(const char* s1, const char* s2,
    154                          PRUint32 aMaxLen) {
    155     return PRInt32(PL_strncmp(s1, s2, aMaxLen));
    156   }
    157 
    158148  /// Case-insensitive string comparison.
    159149  static PRInt32 strcasecmp(const char* s1, const char* s2) {
     
    169159      result=-1;
    170160    return result;
    171   }
    172 
    173   static PRInt32 strncmp(const char* s1, const char* s2, PRInt32 aMaxLen) {
    174     // inline the first test (assumes strings are not null):
    175     PRInt32 diff = ((const unsigned char*)s1)[0] - ((const unsigned char*)s2)[0];
    176     if (diff != 0) return diff;
    177     return PRInt32(PL_strncmp(s1,s2,unsigned(aMaxLen)));
    178161  }
    179162 
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette