Changeset 9992 in webkit for trunk/JavaScriptCore


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.
Location:
trunk/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r9932 r9992  
     12005-07-31  Darin Adler  <[email protected]>
     2
     3        Reviewed by Maciej.
     4
     5        - remove uses of Mac-OS-X-specific MAX macro
     6        - remove one of the many excess "APPLE_CHANGES" ifdefs
     7
     8        * kjs/collector.cpp: (KJS::Collector::allocate): Use std::max instead of MAX.
     9        * kjs/property_map.cpp: (KJS::PropertyMap::rehash): Ditto.
     10        * kjs/ustring.cpp:
     11        (KJS::UChar::toLower): Take out non-ICU code path.
     12        (KJS::UChar::toUpper): Ditto.
     13        (KJS::UString::spliceSubstringsWithSeparators): Use std::max instead of MAX.
     14
    1152005-07-27  Geoffrey Garen  <[email protected]>
    216
  • trunk/JavaScriptCore/kjs/collector.cpp

    r9768 r9992  
    2727#include "value.h"
    2828
     29#include <algorithm>
     30
    2931#if APPLE_CHANGES
    3032#include <CoreFoundation/CoreFoundation.h>
     
    3436#include <mach/thread_act.h>
    3537#endif
     38
     39using std::max;
    3640
    3741namespace KJS {
     
    102106    // oversize allocator
    103107    if (heap.usedOversizeCells == heap.numOversizeCells) {
    104       heap.numOversizeCells = MAX(MIN_ARRAY_SIZE, heap.numOversizeCells * GROWTH_FACTOR);
     108      heap.numOversizeCells = max(MIN_ARRAY_SIZE, heap.numOversizeCells * GROWTH_FACTOR);
    105109      heap.oversizeCells = (CollectorCell **)kjs_fast_realloc(heap.oversizeCells, heap.numOversizeCells * sizeof(CollectorCell *));
    106110    }
     
    132136   
    133137    if (heap.usedBlocks == heap.numBlocks) {
    134       heap.numBlocks = MAX(MIN_ARRAY_SIZE, heap.numBlocks * GROWTH_FACTOR);
     138      heap.numBlocks = max(MIN_ARRAY_SIZE, heap.numBlocks * GROWTH_FACTOR);
    135139      heap.blocks = (CollectorBlock **)kjs_fast_realloc(heap.blocks, heap.numBlocks * sizeof(CollectorBlock *));
    136140    }
  • trunk/JavaScriptCore/kjs/property_map.cpp

    r9768 r9992  
    2727#include "reference_list.h"
    2828
     29#include <algorithm>
     30
     31using std::max;
     32
    2933#define DEBUG_PROPERTIES 0
    3034#define DO_CONSISTENCY_CHECK 0
     
    413417            else {
    414418                int index = entry.index;
    415                 lastIndexUsed = MAX(index, lastIndexUsed);
     419                lastIndexUsed = max(index, lastIndexUsed);
    416420                insert(key, entry.value, entry.attributes, index);
    417421            }
  • 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.