Skip to content

Commit

Permalink
Fix warnings causing test failure
Browse files Browse the repository at this point in the history
Summary:
Fix warnings on Windows.

Original Author: [email protected]
Original Git: fd6a281
Original Reviewed By: neildhar
Original Revision: D68121931

Reviewed By: fbmal7

Differential Revision: D68224905

fbshipit-source-id: 79cf354bc5f0fc84503998beb3b767142115537b
  • Loading branch information
dannysu authored and facebook-github-bot committed Jan 15, 2025
1 parent 3a271eb commit 6f1781d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions lib/VM/JSLib/DateCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ double LocalTimeOffsetCache::getLocalTimeOffset(
int LocalTimeOffsetCache::computeDaylightSaving(int64_t utcTimeMs) {
std::time_t t = utcTimeMs / MS_PER_SECOND;
std::tm tm;
int ltza;
#ifdef _WINDOWS
auto err = ::localtime_s(&tm, &t);
if (err) {
Expand All @@ -68,7 +67,7 @@ int LocalTimeOffsetCache::computeDaylightSaving(int64_t utcTimeMs) {
return 0;
}
int dstOffset = tm.tm_isdst ? MS_PER_HOUR : 0;
ltza = tm.tm_gmtoff * MS_PER_SECOND - dstOffset;
int ltza = tm.tm_gmtoff * MS_PER_SECOND - dstOffset;
// If ltza changes, we need to reset the cache.
if (ltza != ltza_) {
needsToReset_ = true;
Expand Down
2 changes: 1 addition & 1 deletion lib/VM/JSLib/RegExp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1675,7 +1675,7 @@ regExpPrototypeSymbolReplace(void *, Runtime &runtime, NativeArgs args) {
if (LLVM_UNLIKELY(propRes == ExecutionStatus::EXCEPTION)) {
return ExecutionStatus::EXCEPTION;
}
propValue = std::move(propRes->get());
propValue = propRes->get();
auto strRes = toString_RJS(runtime, propValue);
if (LLVM_UNLIKELY(strRes == ExecutionStatus::EXCEPTION)) {
return ExecutionStatus::EXCEPTION;
Expand Down
2 changes: 1 addition & 1 deletion lib/VM/JSProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ findTrap(Handle<JSObject> selfHandle, Runtime &runtime, Predefined::Str name) {
runtime.makeHandle(std::move(*trapVal)),
" is not a Proxy trap function");
}
return runtime.makeHandle<Callable>(std::move(trapVal->get()));
return runtime.makeHandle<Callable>(trapVal->get());
}

} // namespace detail
Expand Down
2 changes: 1 addition & 1 deletion lib/VM/Runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1838,7 +1838,7 @@ ExecutionStatus Runtime::assertBuiltinsUnmodified() {
if (LLVM_UNLIKELY(cr == ExecutionStatus::EXCEPTION)) {
return ExecutionStatus::EXCEPTION;
}
auto currentBuiltin = dyn_vmcast<NativeFunction>(std::move(cr->get()));
auto currentBuiltin = dyn_vmcast<NativeFunction>(cr->get());
if (!currentBuiltin || currentBuiltin != builtins_[methodIndex]) {
return raiseTypeError(
TwineChar16{
Expand Down

0 comments on commit 6f1781d

Please sign in to comment.