[webkit-changes] cvs commit: WebCore/khtml/rendering render_form.cpp

Darin darin at opensource.apple.com
Sun Jul 31 21:31:58 PDT 2005


darin       05/07/31 21:31:58

  Modified:    .        ChangeLog
               khtml/misc arena.cpp loader.cpp
               khtml/rendering render_form.cpp
  Log:
          Reviewed by Maciej.
  
          - remove uses of Mac-OS-X-specific MAX macro in non-Mac-OS-X-specific code
  
          * khtml/misc/arena.cpp: (ArenaAllocate): Use std::max instead of MAX.
          * khtml/misc/loader.cpp: (Cache::setSize): Use kMax instead of MAX.
          * khtml/rendering/render_form.cpp:
          (RenderLineEdit::setSelectionStart): Ditto.
          (RenderLineEdit::setSelectionEnd): Ditto.
          (RenderLineEdit::setSelectionRange): Ditto.
  
  Revision  Changes    Path
  1.4511    +13 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4510
  retrieving revision 1.4511
  diff -u -r1.4510 -r1.4511
  --- ChangeLog	1 Aug 2005 03:25:25 -0000	1.4510
  +++ ChangeLog	1 Aug 2005 04:31:53 -0000	1.4511
  @@ -1,3 +1,16 @@
  +2005-07-31  Darin Adler  <darin at apple.com>
  +
  +        Reviewed by Maciej.
  +
  +        - remove uses of Mac-OS-X-specific MAX macro in non-Mac-OS-X-specific code
  +
  +        * khtml/misc/arena.cpp: (ArenaAllocate): Use std::max instead of MAX.
  +        * khtml/misc/loader.cpp: (Cache::setSize): Use kMax instead of MAX.
  +        * khtml/rendering/render_form.cpp:
  +        (RenderLineEdit::setSelectionStart): Ditto.
  +        (RenderLineEdit::setSelectionEnd): Ditto.
  +        (RenderLineEdit::setSelectionRange): Ditto.
  +
   2005-07-31  David Hyatt  <hyatt at apple.com>
   
   	Make node lists more refined in their invalidation when children are added/removed
  
  
  
  1.5       +5 -2      WebCore/khtml/misc/arena.cpp
  
  Index: arena.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/misc/arena.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- arena.cpp	26 Apr 2005 18:46:04 -0000	1.4
  +++ arena.cpp	1 Aug 2005 04:31:57 -0000	1.5
  @@ -42,11 +42,14 @@
    * David R. Hanson, Software -- Practice and Experience, Vol. 20(1).
    */
   
  +#include "arena.h"
  +
  +#include <algorithm>
   #include <stdlib.h>
   #include <string.h>
  -#include "arena.h"
   #include "main_thread_malloc.h"
   
  +using std::max;
   using khtml::main_thread_malloc;
   using khtml::main_thread_free;
   
  @@ -167,7 +170,7 @@
   
       /* attempt to allocate from the heap */ 
       {  
  -        unsigned int sz = MAX(pool->arenasize, nb);
  +        unsigned int sz = max(pool->arenasize, nb);
           sz += sizeof *a + pool->mask;  /* header and alignment slop */
   #ifdef DEBUG_ARENA_MALLOC
           i++;
  
  
  
  1.71      +1 -1      WebCore/khtml/misc/loader.cpp
  
  Index: loader.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/misc/loader.cpp,v
  retrieving revision 1.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- loader.cpp	27 May 2005 22:55:24 -0000	1.70
  +++ loader.cpp	1 Aug 2005 04:31:57 -0000	1.71
  @@ -2356,7 +2356,7 @@
   void Cache::setSize( int bytes )
   {
       maxSize = bytes;
  -    maxCacheable = MAX(maxSize / 128, MAXCACHEABLE);
  +    maxCacheable = kMax(maxSize / 128, MAXCACHEABLE);
   
       // may be we need to clear parts of the cache
       flushCount = 0;
  
  
  
  1.113     +5 -5      WebCore/khtml/rendering/render_form.cpp
  
  Index: render_form.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_form.cpp,v
  retrieving revision 1.112
  retrieving revision 1.113
  diff -u -r1.112 -r1.113
  --- render_form.cpp	30 Jul 2005 02:33:23 -0000	1.112
  +++ render_form.cpp	1 Aug 2005 04:31:58 -0000	1.113
  @@ -738,15 +738,15 @@
   
   void RenderLineEdit::setSelectionStart(long start)
   {
  -    int realStart = MAX(start, 0);
  -    int length = MAX(selectionEnd() - realStart, 0);
  +    int realStart = kMax(start, 0L);
  +    int length = kMax(selectionEnd() - realStart, 0L);
       static_cast<KLineEdit *>(m_widget)->setSelection(realStart, length);
   }
   
   void RenderLineEdit::setSelectionEnd(long end)
   {
       int start = selectionStart();
  -    int realEnd = MAX(end, 0);
  +    int realEnd = kMax(end, 0L);
       int length = realEnd - start;
       if (length < 0) {
           start = realEnd;
  @@ -762,8 +762,8 @@
   
   void RenderLineEdit::setSelectionRange(long start, long end)
   {
  -    int realStart = MAX(start, 0);
  -    int length = MAX(end - realStart, 0);
  +    int realStart = kMax(start, 0L);
  +    int length = kMax(end - realStart, 0L);
       static_cast<KLineEdit *>(m_widget)->setSelection(realStart, length);
   }
   
  
  
  



More information about the webkit-changes mailing list