Skip to content

Commit

Permalink
Fix compiler warnings in Xcode 13.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleneideck committed Mar 31, 2022
1 parent f4ea06e commit 8ddfb81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions BGMApp/BGMApp/BGMAppVolumes.m
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,11 @@ - (void) showHideExtraControls:(BGMAVM_ShowMoreControlsButton*)button {
[((NSRunningApplication*)menuItem.representedObject).localizedName UTF8String];

// Using this function (instead of just ==) shouldn't be necessary, but just in case.
#if DEBUG
BOOL(^nearEnough)(CGFloat x, CGFloat y) = ^BOOL(CGFloat x, CGFloat y) {
return fabs(x - y) < 0.01; // We don't need much precision.
};
#endif

bool allSubviewsShowing = true;
for (NSView* subview in menuItem.view.subviews) {
Expand Down
10 changes: 5 additions & 5 deletions BGMApp/BGMApp/BGMAudioDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ bool BGMAudioDevice::HasSettableMasterVolume(AudioObjectPropertyScope inScope
bool BGMAudioDevice::HasSettableVirtualMasterVolume(AudioObjectPropertyScope inScope) const
{
AudioObjectPropertyAddress virtualMasterVolumeAddress = {
kAudioHardwareServiceDeviceProperty_VirtualMasterVolume,
kAudioHardwareServiceDeviceProperty_VirtualMainVolume,
inScope,
kAudioObjectPropertyElementMaster
};
Expand Down Expand Up @@ -220,7 +220,7 @@ bool BGMAudioDevice::GetVirtualMasterVolumeScalar(AudioObjectPropertyScope in
Float32& outVirtualMasterVolume) const
{
AudioObjectPropertyAddress virtualMasterVolumeAddress = {
kAudioHardwareServiceDeviceProperty_VirtualMasterVolume,
kAudioHardwareServiceDeviceProperty_VirtualMainVolume,
inScope,
kAudioObjectPropertyElementMaster
};
Expand Down Expand Up @@ -265,7 +265,7 @@ bool BGMAudioDevice::SetVirtualMasterVolumeScalar(AudioObjectPropertyScope in
bool didGetVirtualMasterBalance = GetVirtualMasterBalance(inScope, virtualMasterBalance);

AudioObjectPropertyAddress virtualMasterVolumeAddress = {
kAudioHardwareServiceDeviceProperty_VirtualMasterVolume,
kAudioHardwareServiceDeviceProperty_VirtualMainVolume,
inScope,
kAudioObjectPropertyElementMaster
};
Expand All @@ -277,7 +277,7 @@ bool BGMAudioDevice::SetVirtualMasterVolumeScalar(AudioObjectPropertyScope in

// Reset the balance
AudioObjectPropertyAddress virtualMasterBalanceAddress = {
kAudioHardwareServiceDeviceProperty_VirtualMasterBalance,
kAudioHardwareServiceDeviceProperty_VirtualMainBalance,
inScope,
kAudioObjectPropertyElementMaster
};
Expand Down Expand Up @@ -310,7 +310,7 @@ bool BGMAudioDevice::GetVirtualMasterBalance(AudioObjectPropertyScope inScope
Float32& outVirtualMasterBalance) const
{
AudioObjectPropertyAddress virtualMasterBalanceAddress = {
kAudioHardwareServiceDeviceProperty_VirtualMasterBalance,
kAudioHardwareServiceDeviceProperty_VirtualMainBalance,
inScope,
kAudioObjectPropertyElementMaster
};
Expand Down

0 comments on commit 8ddfb81

Please sign in to comment.