Skip to content

Commit e577fad

Browse files
authored
chore: Prevent conflict between clang-format and MSVC by wrapping inline assembly blocks in curly braces (#2811)
1 parent 8bc8922 commit e577fad

2 files changed

Lines changed: 16 additions & 10 deletions

File tree

Core/Libraries/Source/WWVegas/WWMath/wwmath.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,10 @@ WWINLINE long WWMath::Float_To_Long(double f)
336336
{
337337
#if defined(_MSC_VER) && defined(_M_IX86)
338338
long retval;
339-
__asm fld qword ptr [f]
340-
__asm fistp dword ptr [retval]
339+
__asm {
340+
fld qword ptr [f]
341+
fistp dword ptr [retval]
342+
}
341343
return retval;
342344
#else
343345
return (long) f;

Core/Libraries/Source/profile/internal.h

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,24 @@ class ProfileFastCS
5858
#define ts_lock _emit 0xF0
5959
DASSERT(((unsigned)&nFlag % 4) == 0);
6060

61-
__asm mov ebx, [nFlag]
62-
__asm ts_lock
63-
__asm bts dword ptr [ebx], 0
64-
__asm jc The_Bit_Was_Previously_Set_So_Try_Again
61+
__asm {
62+
mov ebx, [nFlag]
63+
ts_lock
64+
bts dword ptr [ebx], 0
65+
jc The_Bit_Was_Previously_Set_So_Try_Again
66+
}
6567
return;
6668

6769
The_Bit_Was_Previously_Set_So_Try_Again:
6870
// can't use SwitchToThread() here because Win9X doesn't have it!
6971
if (testEvent)
7072
::WaitForSingleObject(testEvent,1);
71-
__asm mov ebx, [nFlag]
72-
__asm ts_lock
73-
__asm bts dword ptr [ebx], 0
74-
__asm jc The_Bit_Was_Previously_Set_So_Try_Again
73+
__asm {
74+
mov ebx, [nFlag]
75+
ts_lock
76+
bts dword ptr [ebx], 0
77+
jc The_Bit_Was_Previously_Set_So_Try_Again
78+
}
7579
}
7680

7781
void ThreadSafeClearFlag()

0 commit comments

Comments
 (0)