Ignore:
Timestamp:
Oct 24, 2010, 4:20:06 PM (15 years ago)
Author:
Patrick Gansterer
Message:

2010-10-24 Patrick Gansterer <Patrick Gansterer>

Reviewed by David Kilzer.

Add WTF_ARRAY_LENGTH macro to WTF
https://bugs.webkit.org/show_bug.cgi?id=32828

Unify the different implementations and usages.

  • interpreter/Interpreter.cpp: (JSC::Interpreter::privateExecute):
  • runtime/DatePrototype.cpp: (JSC::formatLocaleDate):
  • runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::reset):
  • runtime/JSONObject.cpp: (JSC::Stringifier::appendQuotedString): (JSC::Stringifier::toJSON): (JSC::Stringifier::appendStringifiedValue):
  • runtime/UString.cpp: (JSC::UString::number):
  • wtf/DateMath.cpp: (WTF::parseDateFromNullTerminatedCharacters):
  • wtf/StdLibExtras.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/StdLibExtras.h

    r70419 r70425  
    111111}
    112112
     113// Macro that returns a compile time constant with the length of an array, but gives an error if passed a non-array.
     114template<typename T, size_t Size> char (&ArrayLengthHelperFunction(T (&)[Size]))[Size];
     115#define WTF_ARRAY_LENGTH(array) sizeof(::WTF::ArrayLengthHelperFunction(array))
     116
    113117} // namespace WTF
    114118
Note: See TracChangeset for help on using the changeset viewer.