mirror of
https://github.com/holub/mame
synced 2025-04-24 01:11:11 +03:00
patch up on OSX
This commit is contained in:
parent
a0ce6c3b37
commit
0ceae26bb4
@ -583,7 +583,7 @@ static void debugwin_view_update(debug_view &view, void *osdprivate)
|
||||
if (wholeLineScroll)
|
||||
{
|
||||
CGFloat const clamp = [self bounds].size.height - fontHeight - proposedVisibleRect.size.height;
|
||||
proposedVisibleRect.origin.y = std::min((int)proposedVisibleRect.origin.y, std::max((int)clamp, 0));
|
||||
proposedVisibleRect.origin.y = std::min(proposedVisibleRect.origin.y, std::max(clamp, CGFloat(0)));
|
||||
proposedVisibleRect.origin.y -= fmod(proposedVisibleRect.origin.y, fontHeight);
|
||||
}
|
||||
return proposedVisibleRect;
|
||||
@ -668,7 +668,7 @@ static void debugwin_view_update(debug_view &view, void *osdprivate)
|
||||
inTextContainer:textContainer];
|
||||
if (start == 0)
|
||||
box.origin.x = 0;
|
||||
box.size.width = std::max((int)([self bounds].size.width - box.origin.x), 0);
|
||||
box.size.width = std::max([self bounds].size.width - box.origin.x, CGFloat(0));
|
||||
[[self backgroundForAttribute:attr] set];
|
||||
[NSBezierPath fillRect:NSMakeRect(box.origin.x,
|
||||
row * fontHeight,
|
||||
|
@ -350,7 +350,7 @@ NSString *const MAMEAuxiliaryDebugWindowWillCloseNotification = @"MAMEAuxiliaryD
|
||||
windowFrame.size.height = std::min(windowFrame.size.height, available.size.height);
|
||||
|
||||
// arbitrary additional height limit
|
||||
windowFrame.size.height = std::min((int)windowFrame.size.height, 320);
|
||||
windowFrame.size.height = std::min(windowFrame.size.height, CGFloat(320));
|
||||
|
||||
// place it in the bottom right corner and apply
|
||||
windowFrame.origin.x = available.origin.x + available.size.width - windowFrame.size.width;
|
||||
|
@ -44,7 +44,7 @@
|
||||
borderType:[logScroll borderType]];
|
||||
|
||||
// this thing starts with no content, so its prefered height may be very small
|
||||
desired.height = std::max((int)desired.height, 240);
|
||||
desired.height = std::max(desired.height, CGFloat(240));
|
||||
[self cascadeWindowWithDesiredSize:desired forView:logScroll];
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ private:
|
||||
EFFECT_COUNT_MAX = 10
|
||||
};
|
||||
|
||||
UINT32 clamped_latency() const { return std::max(std::min(UINT32(m_audio_latency), UINT32(LATENCY_MAX)), UINT32(LATENCY_MIN)); }
|
||||
UINT32 clamped_latency() const { return unsigned(std::max(std::min(m_audio_latency, int(LATENCY_MAX)), int(LATENCY_MIN))); }
|
||||
UINT32 buffer_avail() const { return ((m_writepos >= m_playpos) ? m_buffer_size : 0) + m_playpos - m_writepos; }
|
||||
UINT32 buffer_used() const { return ((m_playpos > m_writepos) ? m_buffer_size : 0) + m_writepos - m_playpos; }
|
||||
|
||||
@ -228,7 +228,7 @@ int sound_coreaudio::init(const osd_options &options)
|
||||
|
||||
// Allocate buffer
|
||||
m_headroom = m_sample_bytes * (clamped_latency() * sample_rate() / 40);
|
||||
m_buffer_size = m_sample_bytes * std::max(UINT32(sample_rate() * (clamped_latency() + 3) / 40), 256U);
|
||||
m_buffer_size = m_sample_bytes * std::max<UINT32>(sample_rate() * (clamped_latency() + 3) / 40, 256U);
|
||||
m_buffer = global_alloc_array_clear<INT8>(m_buffer_size);
|
||||
if (!m_buffer)
|
||||
{
|
||||
|
@ -444,12 +444,12 @@ UINT64 stream_fill(imgtool_stream *f, unsigned char b, UINT64 sz)
|
||||
char buf[1024];
|
||||
|
||||
outsz = 0;
|
||||
memset(buf, b, std::min(sz, UINT64(sizeof(buf))));
|
||||
memset(buf, b, (std::min<UINT64>)(sz, sizeof(buf)));
|
||||
|
||||
while(sz)
|
||||
while (sz)
|
||||
{
|
||||
outsz += stream_write(f, buf, std::min(sz, UINT64(sizeof(buf))));
|
||||
sz -= std::min(sz, UINT64(sizeof(buf)));
|
||||
outsz += stream_write(f, buf, (std::min<UINT64>)(sz, sizeof(buf)));
|
||||
sz -= (std::min<UINT64>)(sz, sizeof(buf));
|
||||
}
|
||||
return outsz;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user