Changeset 143265 in webkit


Ignore:
Timestamp:
Feb 18, 2013, 2:38:46 PM (12 years ago)
Author:
ap@apple.com
Message:

Make HexNumber functions return 8-bit strings
https://bugs.webkit.org/show_bug.cgi?id=110152

Reviewed by Michael Saboff.

  • wtf/HexNumber.h: (Internal): (WTF::Internal::hexDigitsForMode): (WTF::appendByteAsHex): (WTF::placeByteAsHexCompressIfPossible): (WTF::placeByteAsHex): (WTF::appendUnsignedAsHex): (WTF::appendUnsignedAsHexFixedSize): Use LChar everywhere.
Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r143254 r143265  
     12013-02-18  Alexey Proskuryakov  <ap@apple.com>
     2
     3        Make HexNumber functions return 8-bit strings
     4        https://bugs.webkit.org/show_bug.cgi?id=110152
     5
     6        Reviewed by Michael Saboff.
     7
     8        * wtf/HexNumber.h:
     9        (Internal):
     10        (WTF::Internal::hexDigitsForMode):
     11        (WTF::appendByteAsHex):
     12        (WTF::placeByteAsHexCompressIfPossible):
     13        (WTF::placeByteAsHex):
     14        (WTF::appendUnsignedAsHex):
     15        (WTF::appendUnsignedAsHexFixedSize):
     16        Use LChar everywhere.
     17
    1182013-02-18  Benjamin Poulain  <bpoulain@apple.com>
    219
  • trunk/Source/WTF/wtf/HexNumber.h

    r128829 r143265  
    3232namespace Internal {
    3333
    34 const char lowerHexDigits[17] = "0123456789abcdef";
    35 const char upperHexDigits[17] = "0123456789ABCDEF";
    36 inline const char* hexDigitsForMode(HexConversionMode mode)
     34const LChar lowerHexDigits[17] = "0123456789abcdef";
     35const LChar upperHexDigits[17] = "0123456789ABCDEF";
     36inline const LChar* hexDigitsForMode(HexConversionMode mode)
    3737{
    3838    return mode == Lowercase ? lowerHexDigits : upperHexDigits;
     
    4444inline void appendByteAsHex(unsigned char byte, T& destination, HexConversionMode mode = Uppercase)
    4545{
    46     const char* hexDigits = Internal::hexDigitsForMode(mode);
     46    const LChar* hexDigits = Internal::hexDigitsForMode(mode);
    4747    destination.append(hexDigits[byte >> 4]);
    4848    destination.append(hexDigits[byte & 0xF]);
     
    5252inline void placeByteAsHexCompressIfPossible(unsigned char byte, T& destination, unsigned& index, HexConversionMode mode = Uppercase)
    5353{
    54     const char* hexDigits = Internal::hexDigitsForMode(mode);
     54    const LChar* hexDigits = Internal::hexDigitsForMode(mode);
    5555    if (byte >= 0x10)
    5656        destination[index++] = hexDigits[byte >> 4];
     
    6161inline void placeByteAsHex(unsigned char byte, T& destination, HexConversionMode mode = Uppercase)
    6262{
    63     const char* hexDigits = Internal::hexDigitsForMode(mode);
     63    const LChar* hexDigits = Internal::hexDigitsForMode(mode);
    6464    *destination++ = hexDigits[byte >> 4];
    6565    *destination++ = hexDigits[byte & 0xF];
     
    6969inline void appendUnsignedAsHex(unsigned number, T& destination, HexConversionMode mode = Uppercase)
    7070{
    71     const char* hexDigits = Internal::hexDigitsForMode(mode);
    72     Vector<UChar, 8> result;
     71    const LChar* hexDigits = Internal::hexDigitsForMode(mode);
     72    Vector<LChar, 8> result;
    7373    do {
    7474        result.prepend(hexDigits[number % 16]);
     
    8585    ASSERT(desiredDigits);
    8686
    87     const char* hexDigits = Internal::hexDigitsForMode(mode);
    88     Vector<UChar, 8> result;
     87    const LChar* hexDigits = Internal::hexDigitsForMode(mode);
     88    Vector<LChar, 8> result;
    8989    do {
    9090        result.prepend(hexDigits[number % 16]);
Note: See TracChangeset for help on using the changeset viewer.