Skip to content

Commit

Permalink
[osx] Fix as_nsdragoperation function
Browse files Browse the repository at this point in the history
The variable used as the return value of the function had an undefined
initial value which lead to unpredictable return values. Also took the
chance to refactor the initial value of the variable used in
as_dropoperation
martincapello committed Sep 3, 2024
1 parent f645a69 commit 3a90c7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions os/osx/dnd.mm
Original file line number Diff line number Diff line change
@@ -72,7 +72,7 @@

NSDragOperation as_nsdragoperation(const os::DropOperation op)
{
NSDragOperation nsdop;
NSDragOperation nsdop = NSDragOperationNone;
if (static_cast<int>(op) & static_cast<int>(os::DropOperation::Copy))
nsdop |= NSDragOperationCopy;

@@ -87,7 +87,7 @@ NSDragOperation as_nsdragoperation(const os::DropOperation op)

os::DropOperation as_dropoperation(const NSDragOperation nsdop)
{
int op = 0;
int op = static_cast<int>(os::DropOperation::None);
if (nsdop & NSDragOperationCopy)
op |= static_cast<int>(os::DropOperation::Copy);

0 comments on commit 3a90c7a

Please sign in to comment.