Changeset 9992 in webkit for trunk/JavaScriptCore/kjs/ustring.cpp


Ignore:
Timestamp:
Jul 31, 2005, 10:02:13 PM (20 years ago)
Author:
darin
Message:

Reviewed by Maciej.

  • remove uses of Mac-OS-X-specific MAX macro
  • remove one of the many excess "APPLE_CHANGES" ifdefs
  • kjs/collector.cpp: (KJS::Collector::allocate): Use std::max instead of MAX.
  • kjs/property_map.cpp: (KJS::PropertyMap::rehash): Ditto.
  • kjs/ustring.cpp: (KJS::UChar::toLower): Take out non-ICU code path. (KJS::UChar::toUpper): Ditto. (KJS::UString::spliceSubstringsWithSeparators): Use std::max instead of MAX.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/ustring.cpp

    r9768 r9992  
    4343#include "dtoa.h"
    4444
    45 #if APPLE_CHANGES
     45#include <algorithm>
     46
     47using std::max;
    4648
    4749#include <unicode/uchar.h>
    48 
    49 #endif
    5050
    5151namespace KJS {
     
    150150UChar UChar::toLower() const
    151151{
    152 #if APPLE_CHANGES
    153152  return static_cast<unsigned short>(u_tolower(uc));
    154 #else
    155   // ### properly support unicode tolower
    156   if (uc >= 256 || islower(uc))
    157     return *this;
    158 
    159   return (unsigned char)tolower(uc);
    160 #endif
    161153}
    162154
    163155UChar UChar::toUpper() const
    164156{
    165 #if APPLE_CHANGES
    166157  return static_cast<unsigned short>(u_toupper(uc));
    167 #else
    168   if (uc >= 256 || isupper(uc))
    169     return *this;
    170 
    171   return (unsigned char)toupper(uc);
    172 #endif
    173158}
    174159
     
    641626  UChar *buffer = static_cast<UChar *>(kjs_fast_malloc(totalLength * sizeof(UChar)));
    642627
    643   int maxCount = MAX(rangeCount, separatorCount);
     628  int maxCount = max(rangeCount, separatorCount);
    644629  int bufferPos = 0;
    645630  for (int i = 0; i < maxCount; i++) {
Note: See TracChangeset for help on using the changeset viewer.