Skip to content

Fix MSVC C4146 warnings #8366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/burp/backup.epp
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ void compress(const UCHAR* data, ULONG length)
{
for (q = p + 2; q < end && (q[-2] != q[-1] || q[-1] != q[0]); q++)
;
ULONG run = (q < end) ? q - p - 2 : end - p;
SLONG run = (q < end) ? q - p - 2 : end - p;
if (run)
{
for (; run > 127; run -= 127)
Expand Down
4 changes: 2 additions & 2 deletions src/dsql/WinNodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ void FirstValueWinNode::aggInit(thread_db* tdbb, Request* request) const

dsc* FirstValueWinNode::winPass(thread_db* tdbb, Request* request, SlidingWindow* window) const
{
if (!window->moveWithinFrame(-(window->getRecordPosition() - window->getFrameStart())))
if (!window->moveWithinFrame(-static_cast<SINT64>(window->getRecordPosition() - window->getFrameStart())))
return NULL;

dsc* desc = EVL_expr(tdbb, request, arg);
Expand Down Expand Up @@ -583,7 +583,7 @@ dsc* NthValueWinNode::winPass(thread_db* tdbb, Request* request, SlidingWindow*
const SLONG fromPos = desc ? MOV_get_long(tdbb, desc, 0) : FROM_FIRST;

if (fromPos == FROM_FIRST)
records += -(window->getRecordPosition() - window->getFrameStart()) - 1;
records += -static_cast<SINT64>(window->getRecordPosition() - window->getFrameStart()) - 1;
else
records = window->getFrameEnd() - window->getRecordPosition() - records + 1;

Expand Down
4 changes: 2 additions & 2 deletions src/jrd/sqz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ ULONG Difference::makeNoDiff(ULONG length)
if (output >= end)
return 0;

const auto max = MIN(length, 127);
const int max = MIN(length, 127);
*output++ = -max;
length -= max;
}
Expand Down Expand Up @@ -644,7 +644,7 @@ ULONG Difference::make(ULONG length1, const UCHAR* rec1,
if (output >= end)
return 0;

const auto max = MIN(count, 127);
const int max = MIN(count, 127);
*output++ = -max;
count -= max;
}
Expand Down
Loading