Ignore:
Timestamp:
Aug 22, 2008, 8:17:17 PM (17 years ago)
Author:
[email protected]
Message:

2008-08-22 Cameron Zwarich <[email protected]>

Reviewed by Oliver.

Some cleanup to match our coding style.

  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • kjs/ExecState.cpp:
  • kjs/ExecState.h:
  • kjs/completion.h:
  • kjs/identifier.cpp: (KJS::Identifier::equal): (KJS::CStringTranslator::hash): (KJS::CStringTranslator::equal): (KJS::CStringTranslator::translate): (KJS::UCharBufferTranslator::equal): (KJS::UCharBufferTranslator::translate): (KJS::Identifier::remove):
  • kjs/operations.h:
File:
1 edited

Legend:

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

    r35776 r35898  
    2020
    2121#include "config.h"
    22 
    2322#include "identifier.h"
    2423
     
    7776}
    7877
    79 bool Identifier::equal(const UString::Rep *r, const char *s)
     78bool Identifier::equal(const UString::Rep* r, const char* s)
    8079{
    8180    int length = r->len;
    82     const UChar *d = r->data();
     81    const UChar* d = r->data();
    8382    for (int i = 0; i != length; ++i)
    8483        if (d[i] != (unsigned char)s[i])
     
    8786}
    8887
    89 bool Identifier::equal(const UString::Rep *r, const UChar *s, int length)
     88bool Identifier::equal(const UString::Rep* r, const UChar* s, int length)
    9089{
    9190    if (r->len != length)
    9291        return false;
    93     const UChar *d = r->data();
     92    const UChar* d = r->data();
    9493    for (int i = 0; i != length; ++i)
    9594        if (d[i] != s[i])
     
    10099struct CStringTranslator
    101100{
    102     static unsigned hash(const char *c)
     101    static unsigned hash(const char* c)
    103102    {
    104103        return UString::Rep::computeHash(c);
    105104    }
    106105
    107     static bool equal(UString::Rep *r, const char *s)
     106    static bool equal(UString::Rep* r, const char* s)
    108107    {
    109108        return Identifier::equal(r, s);
    110109    }
    111110
    112     static void translate(UString::Rep*& location, const char *c, unsigned hash)
     111    static void translate(UString::Rep*& location, const char* c, unsigned hash)
    113112    {
    114113        size_t length = strlen(c);
    115         UChar *d = static_cast<UChar *>(fastMalloc(sizeof(UChar) * length));
     114        UChar* d = static_cast<UChar*>(fastMalloc(sizeof(UChar) * length));
    116115        for (size_t i = 0; i != length; i++)
    117116            d[i] = static_cast<unsigned char>(c[i]); // use unsigned char to zero-extend instead of sign-extend
    118117       
    119         UString::Rep *r = UString::Rep::create(d, static_cast<int>(length)).releaseRef();
     118        UString::Rep* r = UString::Rep::create(d, static_cast<int>(length)).releaseRef();
    120119        r->rc = 0;
    121120        r->_hash = hash;
     
    156155
    157156struct UCharBuffer {
    158     const UChar *s;
     157    const UChar* s;
    159158    unsigned int length;
    160159};
     
    167166    }
    168167
    169     static bool equal(UString::Rep *str, const UCharBuffer& buf)
     168    static bool equal(UString::Rep* str, const UCharBuffer& buf)
    170169    {
    171170        return Identifier::equal(str, buf.s, buf.length);
    172171    }
    173172
    174     static void translate(UString::Rep *& location, const UCharBuffer& buf, unsigned hash)
    175     {
    176         UChar *d = static_cast<UChar *>(fastMalloc(sizeof(UChar) * buf.length));
     173    static void translate(UString::Rep*& location, const UCharBuffer& buf, unsigned hash)
     174    {
     175        UChar* d = static_cast<UChar*>(fastMalloc(sizeof(UChar) * buf.length));
    177176        for (unsigned i = 0; i != buf.length; i++)
    178177            d[i] = buf.s[i];
    179178       
    180         UString::Rep *r = UString::Rep::create(d, buf.length).releaseRef();
     179        UString::Rep* r = UString::Rep::create(d, buf.length).releaseRef();
    181180        r->rc = 0;
    182181        r->_hash = hash;
     
    219218}
    220219
    221 void Identifier::remove(UString::Rep *r)
     220void Identifier::remove(UString::Rep* r)
    222221{
    223222    r->identifierTable()->remove(r);
Note: See TracChangeset for help on using the changeset viewer.