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


Ignore:
Timestamp:
Oct 9, 2004, 3:17:44 PM (21 years ago)
Author:
darin
Message:

Reviewed by Kevin.

  • fixed <rdar://problem/3804661> REGRESSION: JavaScriptCore framework now has two init routines
  • bindings/NP_jsobject.cpp: Fixed unnecessarily-complex globals set up that was creating an init routine.
  • kjs/ustring.cpp: Changed around the UString::Rep::empty construction to not require a global constructor that creates an init routine.
File:
1 edited

Legend:

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

    r7564 r7798  
    143143}
    144144
    145 static UChar dummy;
     145// Hack here to avoid a global with a constructor; point to an unsigned short instead of a UChar.
     146static unsigned short almostUChar;
     147static UChar *const nonNullUCharPointer = reinterpret_cast<UChar *>(&almostUChar);
    146148UString::Rep UString::Rep::null = { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };
    147 UString::Rep UString::Rep::empty = { 0, 0, 1, 0, 0, 0, &dummy, 0, 0, 0, 0 };
     149UString::Rep UString::Rep::empty = { 0, 0, 1, 0, 0, 0, nonNullUCharPointer, 0, 0, 0, 0 };
    148150const int normalStatBufferSize = 4096;
    149151static char *statBuffer = 0;
Note: See TracChangeset for help on using the changeset viewer.