Bug 1257408 - Fix VS2015 C4312 warnings in js/src. r=nbp
authorJan de Mooij <jdemooij@mozilla.com>
Sat, 19 Mar 2016 11:04:33 +0100
changeset 289455 d1fca8995788d8628ac82e84f362b1f183464afd
parent 289454 3151c74f2edbff6693160760c150bf0f0f40b97f
child 289456 72cf6912e30ab538e97cd37c8d3e8351a7834884
push id30102
push userryanvm@gmail.com
push dateSat, 19 Mar 2016 15:23:17 +0000
treeherdermozilla-central@720fb3d55e28 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp
bugs1257408
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1257408 - Fix VS2015 C4312 warnings in js/src. r=nbp
js/src/gdb/tests/test-Interpreter.cpp
js/src/jit/Registers.h
js/src/jit/shared/Assembler-shared.h
--- a/js/src/gdb/tests/test-Interpreter.cpp
+++ b/js/src/gdb/tests/test-Interpreter.cpp
@@ -67,26 +67,26 @@ FRAGMENT(Interpreter, Regs) {
   breakpoint();
 
   (void) regs;
 }
 
 FRAGMENT(Interpreter, AbstractFramePtr) {
 
     js::AbstractFramePtr sfidptr;
-    GDBTestInitAbstractFramePtr(sfidptr, (js::ScriptFrameIter::Data*) 0xdeeb0);
+    GDBTestInitAbstractFramePtr(sfidptr, (js::ScriptFrameIter::Data*) uintptr_t(0xdeeb0));
 
     js::AbstractFramePtr ifptr;
-    GDBTestInitAbstractFramePtr(ifptr, (js::InterpreterFrame*) 0x8badf00);
+    GDBTestInitAbstractFramePtr(ifptr, (js::InterpreterFrame*) uintptr_t(0x8badf00));
 
     js::AbstractFramePtr bfptr;
-    GDBTestInitAbstractFramePtr(bfptr, (js::jit::BaselineFrame*) 0xbadcafe0);
+    GDBTestInitAbstractFramePtr(bfptr, (js::jit::BaselineFrame*) uintptr_t(0xbadcafe0));
 
     js::AbstractFramePtr rfptr;
-    GDBTestInitAbstractFramePtr(rfptr, (js::jit::RematerializedFrame*) 0xdabbad00);
+    GDBTestInitAbstractFramePtr(rfptr, (js::jit::RematerializedFrame*) uintptr_t(0xdabbad00));
 
     breakpoint();
 
     (void) sfidptr;
     (void) ifptr;
     (void) bfptr;
     (void) rfptr;
 }
--- a/js/src/jit/Registers.h
+++ b/js/src/jit/Registers.h
@@ -141,19 +141,19 @@ class RegisterDump
 class MachineState
 {
     mozilla::Array<Registers::RegisterContent*, Registers::Total> regs_;
     mozilla::Array<FloatRegisters::RegisterContent*, FloatRegisters::Total> fpregs_;
 
   public:
     MachineState() {
 #ifndef JS_CODEGEN_NONE
-        for (unsigned i = 0; i < Registers::Total; i++)
+        for (uintptr_t i = 0; i < Registers::Total; i++)
             regs_[i] = reinterpret_cast<Registers::RegisterContent*>(i + 0x100);
-        for (unsigned i = 0; i < FloatRegisters::Total; i++)
+        for (uintptr_t i = 0; i < FloatRegisters::Total; i++)
             fpregs_[i] = reinterpret_cast<FloatRegisters::RegisterContent*>(i + 0x200);
 #endif
     }
 
     static MachineState FromBailout(RegisterDump::GPRArray& regs, RegisterDump::FPUArray& fpregs);
 
     void setRegisterLocation(Register reg, uintptr_t* up) {
         regs_[reg.code()] = (Registers::RegisterContent*) up;
--- a/js/src/jit/shared/Assembler-shared.h
+++ b/js/src/jit/shared/Assembler-shared.h
@@ -541,17 +541,17 @@ class CodeLocationJump
     uint8_t* jumpTableEntry_;
 #endif
 
   public:
     CodeLocationJump() {
         raw_ = nullptr;
         setUninitialized();
 #ifdef JS_SMALL_BRANCH
-        jumpTableEntry_ = (uint8_t*) 0xdeadab1e;
+        jumpTableEntry_ = (uint8_t*) uintptr_t(0xdeadab1e);
 #endif
     }
     CodeLocationJump(JitCode* code, CodeOffsetJump base) {
         *this = base;
         repoint(code);
     }
 
     void operator = (CodeOffsetJump base) {