Commit b847b44b authored by darin's avatar darin

Reviewed by Geoff.

        - made changes so the code compiles with the highest warning level
          under MSVC (disabling some warnings, making some code fixes)

        * API/JSCallbackConstructor.cpp:
        (KJS::JSCallbackConstructor::construct):
        * API/JSCallbackFunction.cpp:
        (KJS::JSCallbackFunction::callAsFunction):
        * API/JSCallbackObject.cpp:
        (KJS::JSCallbackObject::init):
        (KJS::JSCallbackObject::construct):
        (KJS::JSCallbackObject::callAsFunction):
        * API/JSObjectRef.cpp:
        (JSPropertyNameArrayGetNameAtIndex):
        * API/JSStringRef.cpp:
        (JSStringCreateWithCharacters):
        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
        * bindings/c/c_utility.cpp:
        (KJS::Bindings::convertUTF8ToUTF16):
        (KJS::Bindings::coerceValueToNPVariantStringType):
        (KJS::Bindings::convertValueToNPVariant):
        * kjs/DateMath.h:
        (KJS::GregorianDateTime::GregorianDateTime):
        * kjs/ExecState.h:
        (KJS::ExecState::hadException):
        * kjs/JSImmediate.h:
        (KJS::JSImmediate::fromDouble):
        (KJS::JSImmediate::toDouble):
        (KJS::JSImmediate::NanAsBits):
        (KJS::JSImmediate::oneAsBits):
        * kjs/Parser.h:
        * kjs/PropertyNameArray.h:
        (KJS::PropertyNameArray::size):
        * kjs/array_object.cpp:
        (ArrayObjectImp::callAsFunction):
        * kjs/bool_object.cpp:
        (BooleanObjectImp::callAsFunction):
        * kjs/collector.cpp:
        (KJS::Collector::allocate):
        (KJS::Collector::markCurrentThreadConservatively):
        (KJS::Collector::collect):
        * kjs/completion.h:
        (KJS::Completion::isValueCompletion):
        * kjs/date_object.cpp:
        (KJS::findMonth):
        * kjs/debugger.cpp:
        (Debugger::sourceParsed):
        (Debugger::sourceUnused):
        (Debugger::exception):
        (Debugger::atStatement):
        (Debugger::callEvent):
        (Debugger::returnEvent):
        * kjs/dtoa.cpp:
        * kjs/error_object.cpp:
        (ErrorObjectImp::callAsFunction):
        (NativeErrorImp::callAsFunction):
        * kjs/function.cpp:
        (KJS::FunctionImp::processVarDecls):
        (KJS::GlobalFuncImp::callAsFunction):
        * kjs/function_object.cpp:
        (FunctionPrototype::callAsFunction):
        * kjs/grammar.y:
        * kjs/identifier.cpp:
        (KJS::CStringTranslator::translate):
        (KJS::Identifier::add):
        * kjs/internal.h:
        * kjs/lexer.cpp:
        (Lexer::lex):
        (Lexer::isIdentStart):
        (Lexer::isIdentPart):
        (isDecimalDigit):
        (Lexer::isHexDigit):
        (Lexer::isOctalDigit):
        (Lexer::matchPunctuator):
        (Lexer::singleEscape):
        (Lexer::convertOctal):
        (Lexer::convertHex):
        (Lexer::convertUnicode):
        (Lexer::record8):
        * kjs/lexer.h:
        * kjs/math_object.cpp:
        (MathFuncImp::callAsFunction):
        * kjs/number_object.cpp:
        (integer_part_noexp):
        (intPow10):
        (NumberProtoFunc::callAsFunction):
        (NumberObjectImp::callAsFunction):
        * kjs/object.cpp:
        (KJS::JSObject::deleteProperty):
        (KJS::JSObject::callAsFunction):
        (KJS::JSObject::toBoolean):
        (KJS::JSObject::toObject):
        * kjs/object.h:
        (KJS::JSObject::getPropertySlot):
        * kjs/property_map.cpp:
        (KJS::isValid):
        (KJS::PropertyMap::put):
        (KJS::PropertyMap::insert):
        (KJS::PropertyMap::containsGettersOrSetters):
        * kjs/property_map.h:
        (KJS::PropertyMap::hasGetterSetterProperties):
        * kjs/property_slot.h:
        * kjs/string_object.cpp:
        (StringInstance::getPropertyNames):
        (StringObjectImp::callAsFunction):
        (StringObjectFuncImp::callAsFunction):
        * kjs/ustring.cpp:
        (KJS::UString::Rep::computeHash):
        (KJS::UString::UString):
        (KJS::UString::from):
        (KJS::UString::append):
        (KJS::UString::ascii):
        (KJS::UString::operator=):
        (KJS::UString::find):
        (KJS::UString::rfind):
        * kjs/ustring.h:
        (KJS::UChar::high):
        (KJS::UChar::low):
        (KJS::UCharReference::low):
        (KJS::UCharReference::high):
        * kjs/value.cpp:
        (KJS::JSValue::toUInt16):
        * kjs/value.h:
        * pcre/pcre_compile.c:
        (get_othercase_range):
        * pcre/pcre_exec.c:
        (match):
        * pcre/pcre_internal.h:
        * wtf/HashFunctions.h:
        (WTF::intHash):
        (WTF::PtrHash::hash):
        * wtf/MathExtras.h:
        (isnan):
        (lround):
        (lroundf):
        * wtf/StringExtras.h:
        (strncasecmp):
        * wtf/unicode/icu/UnicodeIcu.h:
        (WTF::Unicode::isPrintableChar):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@17372 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 696fc2e2
......@@ -65,9 +65,9 @@ JSObject* JSCallbackConstructor::construct(ExecState* exec, const List &args)
JSObjectRef thisRef = toRef(this);
if (m_callback) {
size_t argumentCount = args.size();
int argumentCount = static_cast<int>(args.size());
Vector<JSValueRef, 16> arguments(argumentCount);
for (size_t i = 0; i < argumentCount; i++)
for (int i = 0; i < argumentCount; i++)
arguments[i] = toRef(args[i]);
return toJS(m_callback(ctx, thisRef, argumentCount, arguments, toRef(exec->exceptionSlot())));
}
......
......@@ -54,9 +54,9 @@ JSValue* JSCallbackFunction::callAsFunction(ExecState* exec, JSObject* thisObj,
JSObjectRef thisRef = toRef(this);
JSObjectRef thisObjRef = toRef(thisObj);
size_t argumentCount = args.size();
int argumentCount = static_cast<int>(args.size());
Vector<JSValueRef, 16> arguments(argumentCount);
for (size_t i = 0; i < argumentCount; i++)
for (int i = 0; i < argumentCount; i++)
arguments[i] = toRef(args[i]);
return toJS(m_callback(execRef, thisRef, thisObjRef, argumentCount, arguments, toRef(exec->exceptionSlot())));
}
......
......@@ -58,7 +58,7 @@ void JSCallbackObject::init(ExecState* exec, JSClassRef jsClass, void* data)
} while ((jsClass = jsClass->parentClass));
// initialize from base to derived
for (int i = initRoutines.size() - 1; i >= 0; i--) {
for (int i = static_cast<int>(initRoutines.size()) - 1; i >= 0; i--) {
JSObjectInitializeCallback initialize = initRoutines[i];
initialize(toRef(exec), toRef(this));
}
......@@ -225,9 +225,9 @@ JSObject* JSCallbackObject::construct(ExecState* exec, const List& args)
for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) {
if (JSObjectCallAsConstructorCallback callAsConstructor = jsClass->callAsConstructor) {
size_t argumentCount = args.size();
int argumentCount = static_cast<int>(args.size());
Vector<JSValueRef, 16> arguments(argumentCount);
for (size_t i = 0; i < argumentCount; i++)
for (int i = 0; i < argumentCount; i++)
arguments[i] = toRef(args[i]);
return toJS(callAsConstructor(execRef, thisRef, argumentCount, arguments, toRef(exec->exceptionSlot())));
}
......@@ -277,9 +277,9 @@ JSValue* JSCallbackObject::callAsFunction(ExecState* exec, JSObject* thisObj, co
for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass) {
if (JSObjectCallAsFunctionCallback callAsFunction = jsClass->callAsFunction) {
size_t argumentCount = args.size();
int argumentCount = static_cast<int>(args.size());
Vector<JSValueRef, 16> arguments(argumentCount);
for (size_t i = 0; i < argumentCount; i++)
for (int i = 0; i < argumentCount; i++)
arguments[i] = toRef(args[i]);
return toJS(callAsFunction(execRef, thisRef, thisObjRef, argumentCount, arguments, toRef(exec->exceptionSlot())));
}
......
......@@ -348,7 +348,7 @@ size_t JSPropertyNameArrayGetCount(JSPropertyNameArrayRef array)
JSStringRef JSPropertyNameArrayGetNameAtIndex(JSPropertyNameArrayRef array, size_t index)
{
return toRef(array->array[index].ustring().rep());
return toRef(array->array[static_cast<unsigned>(index)].ustring().rep());
}
void JSPropertyNameAccumulatorAddName(JSPropertyNameAccumulatorRef array, JSStringRef propertyName)
......
......@@ -40,7 +40,7 @@ using namespace KJS;
JSStringRef JSStringCreateWithCharacters(const JSChar* chars, size_t numChars)
{
JSLock lock;
return toRef(UString(reinterpret_cast<const UChar*>(chars), numChars).rep()->ref());
return toRef(UString(reinterpret_cast<const UChar*>(chars), static_cast<int>(numChars)).rep()->ref());
}
JSStringRef JSStringCreateWithUTF8CString(const char* string)
......
2006-10-28 Darin Adler <darin@apple.com>
Reviewed by Geoff.
- made changes so the code compiles with the highest warning level
under MSVC (disabling some warnings, making some code fixes)
* API/JSCallbackConstructor.cpp:
(KJS::JSCallbackConstructor::construct):
* API/JSCallbackFunction.cpp:
(KJS::JSCallbackFunction::callAsFunction):
* API/JSCallbackObject.cpp:
(KJS::JSCallbackObject::init):
(KJS::JSCallbackObject::construct):
(KJS::JSCallbackObject::callAsFunction):
* API/JSObjectRef.cpp:
(JSPropertyNameArrayGetNameAtIndex):
* API/JSStringRef.cpp:
(JSStringCreateWithCharacters):
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* bindings/c/c_utility.cpp:
(KJS::Bindings::convertUTF8ToUTF16):
(KJS::Bindings::coerceValueToNPVariantStringType):
(KJS::Bindings::convertValueToNPVariant):
* kjs/DateMath.h:
(KJS::GregorianDateTime::GregorianDateTime):
* kjs/ExecState.h:
(KJS::ExecState::hadException):
* kjs/JSImmediate.h:
(KJS::JSImmediate::fromDouble):
(KJS::JSImmediate::toDouble):
(KJS::JSImmediate::NanAsBits):
(KJS::JSImmediate::oneAsBits):
* kjs/Parser.h:
* kjs/PropertyNameArray.h:
(KJS::PropertyNameArray::size):
* kjs/array_object.cpp:
(ArrayObjectImp::callAsFunction):
* kjs/bool_object.cpp:
(BooleanObjectImp::callAsFunction):
* kjs/collector.cpp:
(KJS::Collector::allocate):
(KJS::Collector::markCurrentThreadConservatively):
(KJS::Collector::collect):
* kjs/completion.h:
(KJS::Completion::isValueCompletion):
* kjs/date_object.cpp:
(KJS::findMonth):
* kjs/debugger.cpp:
(Debugger::sourceParsed):
(Debugger::sourceUnused):
(Debugger::exception):
(Debugger::atStatement):
(Debugger::callEvent):
(Debugger::returnEvent):
* kjs/dtoa.cpp:
* kjs/error_object.cpp:
(ErrorObjectImp::callAsFunction):
(NativeErrorImp::callAsFunction):
* kjs/function.cpp:
(KJS::FunctionImp::processVarDecls):
(KJS::GlobalFuncImp::callAsFunction):
* kjs/function_object.cpp:
(FunctionPrototype::callAsFunction):
* kjs/grammar.y:
* kjs/identifier.cpp:
(KJS::CStringTranslator::translate):
(KJS::Identifier::add):
* kjs/internal.h:
* kjs/lexer.cpp:
(Lexer::lex):
(Lexer::isIdentStart):
(Lexer::isIdentPart):
(isDecimalDigit):
(Lexer::isHexDigit):
(Lexer::isOctalDigit):
(Lexer::matchPunctuator):
(Lexer::singleEscape):
(Lexer::convertOctal):
(Lexer::convertHex):
(Lexer::convertUnicode):
(Lexer::record8):
* kjs/lexer.h:
* kjs/math_object.cpp:
(MathFuncImp::callAsFunction):
* kjs/number_object.cpp:
(integer_part_noexp):
(intPow10):
(NumberProtoFunc::callAsFunction):
(NumberObjectImp::callAsFunction):
* kjs/object.cpp:
(KJS::JSObject::deleteProperty):
(KJS::JSObject::callAsFunction):
(KJS::JSObject::toBoolean):
(KJS::JSObject::toObject):
* kjs/object.h:
(KJS::JSObject::getPropertySlot):
* kjs/property_map.cpp:
(KJS::isValid):
(KJS::PropertyMap::put):
(KJS::PropertyMap::insert):
(KJS::PropertyMap::containsGettersOrSetters):
* kjs/property_map.h:
(KJS::PropertyMap::hasGetterSetterProperties):
* kjs/property_slot.h:
* kjs/string_object.cpp:
(StringInstance::getPropertyNames):
(StringObjectImp::callAsFunction):
(StringObjectFuncImp::callAsFunction):
* kjs/ustring.cpp:
(KJS::UString::Rep::computeHash):
(KJS::UString::UString):
(KJS::UString::from):
(KJS::UString::append):
(KJS::UString::ascii):
(KJS::UString::operator=):
(KJS::UString::find):
(KJS::UString::rfind):
* kjs/ustring.h:
(KJS::UChar::high):
(KJS::UChar::low):
(KJS::UCharReference::low):
(KJS::UCharReference::high):
* kjs/value.cpp:
(KJS::JSValue::toUInt16):
* kjs/value.h:
* pcre/pcre_compile.c:
(get_othercase_range):
* pcre/pcre_exec.c:
(match):
* pcre/pcre_internal.h:
* wtf/HashFunctions.h:
(WTF::intHash):
(WTF::PtrHash::hash):
* wtf/MathExtras.h:
(isnan):
(lround):
(lroundf):
* wtf/StringExtras.h:
(strncasecmp):
* wtf/unicode/icu/UnicodeIcu.h:
(WTF::Unicode::isPrintableChar):
2006-10-26 W. Andy Carrel <wac@google.com>
Reviewed by Maciej.
......
......@@ -54,10 +54,11 @@
RuntimeLibrary="3"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="1"
Detect64BitPortabilityProblems="false"
WarningLevel="4"
WarnAsError="true"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
DisableSpecificWarnings="4138; 4996; 4355"
DisableSpecificWarnings="4127;4355;4510;4512;4610;4706;4996"
ForcedIncludeFiles=""
/>
<Tool
......@@ -127,10 +128,11 @@
RuntimeLibrary="2"
RuntimeTypeInfo="false"
UsePrecompiledHeader="0"
WarningLevel="1"
Detect64BitPortabilityProblems="false"
WarningLevel="4"
WarnAsError="true"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
DisableSpecificWarnings="4138; 4996; 4355"
DisableSpecificWarnings="4127;4355;4510;4512;4610;4706;4996"
ForcedIncludeFiles=""
/>
<Tool
......
......@@ -49,9 +49,11 @@
BasicRuntimeChecks="3"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="1"
Detect64BitPortabilityProblems="false"
WarningLevel="4"
WarnAsError="true"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
DisableSpecificWarnings="4127;4355;4510;4512;4610;4706;4996"
/>
<Tool
Name="VCManagedResourceCompilerTool"
......
......@@ -50,7 +50,7 @@ void convertUTF8ToUTF16(const NPUTF8 *UTF8Chars, int UTF8Length, NPUTF16 **UTF16
assert(UTF16Chars);
if (UTF8Length == -1)
UTF8Length = strlen(UTF8Chars);
UTF8Length = static_cast<int>(strlen(UTF8Chars));
// UTF16Length maximum length is the length of the UTF8 string, plus one to include terminator
// Without the plus one, it will convert ok, but a warning is generated from the converter as
......@@ -87,7 +87,7 @@ void coerceValueToNPVariantStringType(ExecState *exec, JSValue *value, NPVariant
{
UString ustring = value->toString(exec);
CString cstring = ustring.UTF8String();
NPString string = { (const NPUTF8 *)cstring.c_str(), cstring.size() };
NPString string = { (const NPUTF8 *)cstring.c_str(), static_cast<uint32_t>(cstring.size()) };
NPN_InitializeVariantWithStringCopy(result, &string);
}
......@@ -99,7 +99,7 @@ void convertValueToNPVariant(ExecState *exec, JSValue *value, NPVariant *result)
if (type == StringType) {
UString ustring = value->toString(exec);
CString cstring = ustring.UTF8String();
NPString string = { (const NPUTF8 *)cstring.c_str(), cstring.size() };
NPString string = { (const NPUTF8 *)cstring.c_str(), static_cast<uint32_t>(cstring.size()) };
NPN_InitializeVariantWithStringCopy(result, &string);
} else if (type == NumberType) {
DOUBLE_TO_NPVARIANT(value->toNumber(exec), *result);
......
......@@ -111,8 +111,8 @@ struct GregorianDateTime {
timeZone = new char[inZoneSize];
strncpy(timeZone, inTm.tm_zone, inZoneSize);
#else
utcOffset = (getUTCOffset() / msPerSecond) + (isDST ? secondsPerHour : 0);
timeZone = NULL;
utcOffset = static_cast<int>(getUTCOffset() / msPerSecond + isDST ? secondsPerHour : 0);
timeZone = 0;
#endif
}
......
......@@ -73,7 +73,7 @@ namespace KJS {
void clearException() { m_exception = 0; }
JSValue* exception() const { return m_exception; }
JSValue** exceptionSlot() { return &m_exception; }
bool hadException() const { return m_exception; }
bool hadException() const { return !!m_exception; }
private:
ExecState(Interpreter* interp, Context* con)
......
......@@ -27,6 +27,15 @@
#include <stdint.h>
#include <stdlib.h>
#if COMPILER(MSVC)
#pragma warning(push)
#pragma warning(disable: 4127)
#pragma warning(disable: 4244)
#pragma warning(disable: 4305)
#pragma warning(disable: 4307)
#pragma warning(disable: 4309)
#endif
namespace KJS {
class ExecState;
......@@ -201,9 +210,9 @@ private:
const uint32_t NaN32AsBits = 0x7fc00000;
const uint64_t NaN64AsBits = 0x7ff80000ULL << 32;
if (JSImmediate::is32bit())
if (is32bit())
return NaN32AsBits;
else if (JSImmediate::is64bit())
else if (is64bit())
return NaN64AsBits;
else {
abort();
......@@ -221,9 +230,9 @@ private:
const uint32_t One32AsBits = 0x3f800000;
const uint64_t One64AsBits = 0x3ff00000ULL << 32;
if (JSImmediate::is32bit())
if (is32bit())
return One32AsBits;
else if (JSImmediate::is64bit())
else if (is64bit())
return One64AsBits;
else {
abort();
......@@ -234,4 +243,8 @@ private:
} // namespace KJS
#if COMPILER(MSVC)
#pragma warning(pop)
#endif
#endif
......@@ -31,9 +31,10 @@ namespace KJS {
class Node;
class ProgramNode;
class UChar;
class UString;
struct UChar;
/**
* @internal
*
......
......@@ -40,7 +40,7 @@ namespace KJS {
void add(const Identifier&);
iterator begin() const { return m_vector.begin(); }
iterator end() const { return m_vector.end(); }
int size() const { return m_vector.size(); }
size_t size() const { return m_vector.size(); }
Identifier& operator[](unsigned i) { return m_vector[i]; }
const Identifier& operator[](unsigned i) const { return m_vector[i]; }
......
......@@ -974,7 +974,7 @@ JSObject *ArrayObjectImp::construct(ExecState *exec, const List &args)
}
// ECMA 15.6.1
JSValue *ArrayObjectImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args)
JSValue *ArrayObjectImp::callAsFunction(ExecState *exec, JSObject *, const List &args)
{
// equivalent to 'new Array(....)'
return construct(exec,args);
......
......@@ -114,7 +114,7 @@ JSObject *BooleanObjectImp::construct(ExecState *exec, const List &args)
}
// ECMA 15.6.1
JSValue *BooleanObjectImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args)
JSValue *BooleanObjectImp::callAsFunction(ExecState *exec, JSObject *, const List &args)
{
if (args.isEmpty())
return jsBoolean(false);
......
......@@ -187,7 +187,7 @@ allocateNewBlock:
// could avoid the casts by using a cell offset, but this avoids a relatively-slow multiply
targetBlock->freeList = reinterpret_cast<CollectorCell *>(reinterpret_cast<char *>(newCell + 1) + newCell->u.freeCell.next);
targetBlock->usedCells = targetBlockUsedCells + 1;
targetBlock->usedCells = static_cast<uint32_t>(targetBlockUsedCells + 1);
heap.numLiveObjects = numLiveObjects + 1;
return newCell;
......@@ -300,7 +300,14 @@ gotGoodPointer:
void Collector::markCurrentThreadConservatively()
{
jmp_buf registers;
#if COMPILER(MSVC)
#pragma warning(push)
#pragma warning(disable: 4611)
#endif
setjmp(registers);
#if COMPILER(MSVC)
#pragma warning(pop)
#endif
#if PLATFORM(DARWIN)
pthread_t thread = pthread_self();
......@@ -532,7 +539,7 @@ bool Collector::collect()
}
}
curBlock->usedCells = usedCells;
curBlock->usedCells = static_cast<uint32_t>(usedCells);
curBlock->freeList = freeList;
if (usedCells == 0) {
......
......@@ -53,7 +53,7 @@ namespace KJS {
ComplType complType() const { return comp; }
JSValue *value() const { return val; }
Identifier target() const { return tar; }
bool isValueCompletion() const { return val; }
bool isValueCompletion() const { return !!val; }
private:
ComplType comp;
JSValue *val;
......
......@@ -173,7 +173,7 @@ static JSCell* formatLocaleDate(GregorianDateTime gdt, const LocaleDateTimeForma
// Do the formatting
const int bufsize=128;
char timebuffer[bufsize];
int ret = strftime(timebuffer, bufsize, formatStrings[format], &localTM);
size_t ret = strftime(timebuffer, bufsize, formatStrings[format], &localTM);
if ( ret == 0 )
return jsString("");
......@@ -452,8 +452,6 @@ JSValue *DateProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const
JSValue *result = 0;
UString s;
#if !PLATFORM(DARWIN)
const int bufsize=100;
char timebuffer[bufsize];
CString oldlocale = setlocale(LC_TIME, 0);
if (!oldlocale.size())
oldlocale = setlocale(LC_ALL, 0);
......@@ -792,13 +790,13 @@ static int findMonth(const char *monthStr)
for (int i = 0; i < 3; ++i) {
if (!*monthStr)
return -1;
needle[i] = tolower(*monthStr++);
needle[i] = static_cast<char>(tolower(*monthStr++));
}
needle[3] = '\0';
const char *haystack = "janfebmaraprmayjunjulaugsepoctnovdec";
const char *str = strstr(haystack, needle);
if (str) {
int position = str - haystack;
int position = static_cast<int>(str - haystack);
if (position % 3 == 0)
return position / 3;
}
......
......@@ -96,37 +96,37 @@ bool Debugger::hasHandledException(ExecState *exec, JSValue *exception)
return false;
}
bool Debugger::sourceParsed(ExecState */*exec*/, int /*sourceId*/, const UString &/*sourceURL*/,
bool Debugger::sourceParsed(ExecState*, int /*sourceId*/, const UString &/*sourceURL*/,
const UString &/*source*/, int /*startingLineNumber*/, int /*errorLine*/, const UString & /*errorMsg*/)
{
return true;
}
bool Debugger::sourceUnused(ExecState */*exec*/, int /*sourceId*/)
bool Debugger::sourceUnused(ExecState*, int /*sourceId*/)
{
return true;
}
bool Debugger::exception(ExecState */*exec*/, int /*sourceId*/, int /*lineno*/,
JSValue */*exception*/)
bool Debugger::exception(ExecState*, int /*sourceId*/, int /*lineno*/,
JSValue* /*exception */)
{
return true;
}
bool Debugger::atStatement(ExecState */*exec*/, int /*sourceId*/, int /*firstLine*/,
bool Debugger::atStatement(ExecState*, int /*sourceId*/, int /*firstLine*/,
int /*lastLine*/)
{
return true;
}
bool Debugger::callEvent(ExecState */*exec*/, int /*sourceId*/, int /*lineno*/,
JSObject */*function*/, const List &/*args*/)
bool Debugger::callEvent(ExecState*, int /*sourceId*/, int /*lineno*/,
JSObject* /*function*/, const List &/*args*/)
{
return true;
}
bool Debugger::returnEvent(ExecState */*exec*/, int /*sourceId*/, int /*lineno*/,
JSObject */*function*/)
bool Debugger::returnEvent(ExecState*, int /*sourceId*/, int /*lineno*/,
JSObject* /*function*/)
{
return true;
}
......
......@@ -172,6 +172,12 @@
#include "config.h"
#include "dtoa.h"
#if COMPILER(MSVC)
#pragma warning(disable: 4244)
#pragma warning(disable: 4245)
#pragma warning(disable: 4554)
#endif
#if PLATFORM(BIG_ENDIAN)
#define IEEE_MC68k
#else
......
......@@ -111,7 +111,7 @@ JSObject *ErrorObjectImp::construct(ExecState *exec, const List &args)
}
// ECMA 15.9.2
JSValue *ErrorObjectImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args)
JSValue *ErrorObjectImp::callAsFunction(ExecState *exec, JSObject* /*thisObj*/, const List &args)
{
// "Error()" gives the sames result as "new Error()"
return construct(exec,args);
......@@ -153,7 +153,7 @@ JSObject *NativeErrorImp::construct(ExecState *exec, const List &args)
return obj;
}
JSValue *NativeErrorImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args)
JSValue *NativeErrorImp::callAsFunction(ExecState *exec, JSObject* /*thisObj*/, const List &args)
{
return construct(exec,args);
}
......
......@@ -210,7 +210,7 @@ void FunctionImp::processParameters(ExecState *exec, const List &args)
#endif
}
void FunctionImp::processVarDecls(ExecState */*exec*/)
void FunctionImp::processVarDecls(ExecState*)
{
}
......@@ -752,7 +752,7 @@ static double parseFloat(const UString &s)
return s.toDouble( true /*tolerant*/, false /* NaN for empty string */ );
}
JSValue *GlobalFuncImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args)
JSValue *GlobalFuncImp::callAsFunction(ExecState *exec, JSObject* /*thisObj*/, const List &args)
{
JSValue *res = jsUndefined();
......
......@@ -53,7 +53,7 @@ FunctionPrototype::~FunctionPrototype()
}
// ECMA 15.3.4
JSValue *FunctionPrototype::callAsFunction(ExecState */*exec*/, JSObject */*thisObj*/, const List &/*args*/)
JSValue *FunctionPrototype::callAsFunction(ExecState*, JSObject* /*thisObj*/, const List &/*args*/)
{
return jsUndefined();
}
......
......@@ -63,6 +63,12 @@ static Node *makeFunctionCallNode(Node *func, ArgumentsNode *args);
static Node *makeTypeOfNode(Node *expr);
static Node *makeDeleteNode(Node *expr);
#if COMPILER(MSVC)
#pragma warning(disable: 4065)
#pragma warning(disable: 4244)
#pragma warning(disable: 4702)
#endif
%}
%union {
......
......@@ -45,8 +45,8 @@
namespace WTF {
template<typename T> class DefaultHash;
template<typename T> class StrHash;
template<typename T> struct DefaultHash;
template<typename T> struct StrHash;
template<> struct StrHash<KJS::UString::Rep *> {
static unsigned hash(const KJS::UString::Rep *key) { return key->hash(); }
......@@ -120,12 +120,12 @@ struct CStringTranslator
static void translate(UString::Rep*& location, const char *c, unsigned hash)
{
int length = strlen(c);
size_t length = strlen(c);
UChar *d = static_cast<UChar *>(fastMalloc(sizeof(UChar) * length));
for (int i = 0; i != length; i++)
for (size_t i = 0; i != length; i++)
d[i] = c[i];
UString::Rep *r = UString::Rep::create(d, length).release();
UString::Rep *r = UString::Rep::create(d, static_cast<int>(length)).release();
r->isIdentifier = 1;
r->rc = 0;
r->_hash = hash;
......@@ -138,7 +138,7 @@ PassRefPtr<UString::Rep> Identifier::add(const char *c)
{
if (!c)
return &UString::Rep::null;
int length = strlen(c);
size_t length = strlen(c);
if (length == 0)
return &UString::Rep::empty;
......
......@@ -129,7 +129,7 @@ namespace KJS {
FunctionCode,
AnonymousCode };
class AttachedInterpreter;
struct AttachedInterpreter;
class DebuggerImp {
public:
......