Fix two MSVC warnings. no_r=me.

This commit is contained in:
Jason Orendorff 2010-08-02 09:44:24 -05:00
parent faaaf8264b
commit 8ed74ae25b
2 changed files with 11 additions and 1 deletions

View File

@ -42,6 +42,12 @@
#include "jstl.h"
/* Silence dire "bugs in previous versions of MSVC have been fixed" warnings */
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4345)
#endif
namespace js {
/*
@ -786,4 +792,8 @@ Vector<T,N,AP>::replaceRawBuffer(T *p, size_t length)
} /* namespace js */
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#endif /* jsvector_h_ */

View File

@ -84,7 +84,7 @@ pm_finalize(JSContext* cx, JSObject* obj)
PerfMeasurement* p = GetPM(cx, obj, #name); \
if (!p) \
return JS_FALSE; \
return JS_NewNumberValue(cx, p->name, vp); \
return JS_NewNumberValue(cx, jsdouble(p->name), vp); \
}
GETTER(cpu_cycles)