fix some warnings in Xcode8 build

This commit is contained in:
Alexei Svitkine 2016-12-17 22:04:57 -05:00
parent 5538376dc8
commit 1f211fb37b
10 changed files with 18 additions and 59 deletions

View File

@ -343,12 +343,6 @@ static void ErrorAlert(int error)
{ {
ErrorAlert(GetString(error)); ErrorAlert(GetString(error));
} }
// Display warning alert
static void WarningAlert(int warning)
{
WarningAlert(GetString(warning));
}
#endif #endif
@ -387,26 +381,6 @@ static int palette_size(int mode)
} }
} }
// Return bytes per pixel for requested depth
static inline int bytes_per_pixel(int depth)
{
int bpp;
switch (depth) {
case 8:
bpp = 1;
break;
case 15: case 16:
bpp = 2;
break;
case 24: case 32:
bpp = 4;
break;
default:
abort();
}
return bpp;
}
// Map video_mode depth ID to numerical depth value // Map video_mode depth ID to numerical depth value
static int mac_depth_of_video_depth(int video_depth) static int mac_depth_of_video_depth(int video_depth)
{ {
@ -690,7 +664,7 @@ void driver_base::init()
// Check whether we can initialize the VOSF subsystem and it's profitable // Check whether we can initialize the VOSF subsystem and it's profitable
if (!video_vosf_init(monitor)) { if (!video_vosf_init(monitor)) {
WarningAlert(STR_VOSF_INIT_ERR); WarningAlert(GetString(STR_VOSF_INIT_ERR));
use_vosf = false; use_vosf = false;
} }
else if (!video_vosf_profitable()) { else if (!video_vosf_profitable()) {

View File

@ -799,9 +799,9 @@ static uint8 *fill_buffer(int stream_len)
#ifdef USE_SDL_AUDIO #ifdef USE_SDL_AUDIO
void MixAudio_bincue(uint8 *stream, int stream_len) void MixAudio_bincue(uint8 *stream, int stream_len)
{ {
uint8 *buf;
if (audio_enabled && (player.audiostatus == CDROM_AUDIO_PLAY)) { if (audio_enabled && (player.audiostatus == CDROM_AUDIO_PLAY)) {
if (buf = fill_buffer(stream_len)) uint8 *buf = fill_buffer(stream_len);
if (buf)
SDL_MixAudio(stream, buf, stream_len, SDL_MIX_MAXVOLUME); SDL_MixAudio(stream, buf, stream_len, SDL_MIX_MAXVOLUME);
} }
} }

View File

@ -433,7 +433,9 @@ static struct {
int last; int last;
int count; int count;
} g_message_descriptors = { NULL, 0, 0 }; } g_message_descriptors = { NULL, 0, 0 };
#ifdef USE_THREADS
static pthread_mutex_t g_message_descriptors_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t g_message_descriptors_lock = PTHREAD_MUTEX_INITIALIZER;
#endif
// Add a user-defined marshaler // Add a user-defined marshaler
static int rpc_message_add_callback(const rpc_message_descriptor_t *desc) static int rpc_message_add_callback(const rpc_message_descriptor_t *desc)

View File

@ -77,7 +77,7 @@ icmp_input(m, hlen)
DEBUG_CALL("icmp_input"); DEBUG_CALL("icmp_input");
DEBUG_ARG("m = %lx", (long )m); DEBUG_ARG("m = %lx", (long )m);
DEBUG_ARG("m_len = %d", m->m_len); DEBUG_ARG("m_len = %zu", m->m_len);
icmpstat.icps_received++; icmpstat.icps_received++;
@ -201,12 +201,12 @@ end_error:
#define ICMP_MAXDATALEN (IP_MSS-28) #define ICMP_MAXDATALEN (IP_MSS-28)
void void
icmp_error(msrc, type, code, minsize, message) icmp_error(
struct mbuf *msrc; struct mbuf *msrc,
u_char type; u_char type,
u_char code; u_char code,
int minsize; int minsize,
char *message; char *message)
{ {
unsigned hlen, shlen, s_ip_len; unsigned hlen, shlen, s_ip_len;
register struct ip *ip; register struct ip *ip;
@ -215,7 +215,7 @@ icmp_error(msrc, type, code, minsize, message)
DEBUG_CALL("icmp_error"); DEBUG_CALL("icmp_error");
DEBUG_ARG("msrc = %lx", (long )msrc); DEBUG_ARG("msrc = %lx", (long )msrc);
DEBUG_ARG("msrc_len = %d", msrc->m_len); DEBUG_ARG("msrc_len = %zu", msrc->m_len);
if(type!=ICMP_UNREACH && type!=ICMP_TIMXCEED) goto end_error; if(type!=ICMP_UNREACH && type!=ICMP_TIMXCEED) goto end_error;

View File

@ -72,7 +72,7 @@ ip_input(m)
DEBUG_CALL("ip_input"); DEBUG_CALL("ip_input");
DEBUG_ARG("m = %lx", (long)m); DEBUG_ARG("m = %lx", (long)m);
DEBUG_ARG("m_len = %d", m->m_len); DEBUG_ARG("m_len = %zu", m->m_len);
ipstat.ips_total++; ipstat.ips_total++;

View File

@ -71,7 +71,7 @@ void sbappend(struct socket *so, struct mbuf *m)
DEBUG_CALL("sbappend"); DEBUG_CALL("sbappend");
DEBUG_ARG("so = %lx", (long)so); DEBUG_ARG("so = %lx", (long)so);
DEBUG_ARG("m = %lx", (long)m); DEBUG_ARG("m = %lx", (long)m);
DEBUG_ARG("m->m_len = %d", m->m_len); DEBUG_ARG("m->m_len = %zu", m->m_len);
/* Shouldn't happen, but... e.g. foreign host closes connection */ /* Shouldn't happen, but... e.g. foreign host closes connection */
if (m->m_len <= 0) { if (m->m_len <= 0) {

View File

@ -454,7 +454,7 @@ sorecvfrom(so)
m->m_len = recvfrom(so->s, m->m_data, len, 0, m->m_len = recvfrom(so->s, m->m_data, len, 0,
(struct sockaddr *)&addr, &addrlen); (struct sockaddr *)&addr, &addrlen);
DEBUG_MISC((dfd, " did recvfrom %d, errno = %d-%s\n", DEBUG_MISC((dfd, " did recvfrom %zu, errno = %d-%s\n",
m->m_len, errno,strerror(errno))); m->m_len, errno,strerror(errno)));
if(m->m_len<0) { if(m->m_len<0) {
u_char code=ICMP_UNREACH_PORT; u_char code=ICMP_UNREACH_PORT;

View File

@ -29,7 +29,7 @@
} }
-(NSString*)description { -(NSString*)description {
return [NSString stringWithFormat:@"DiskType, path:%@ isCDROM:%@", _path, _isCDROM]; return [NSString stringWithFormat:@"DiskType, path:%@ isCDROM:%hhd", _path, _isCDROM];
} }
@end @end

View File

@ -772,7 +772,7 @@ sigsegv_return_t sigsegv_handler(sigsegv_info_t *sip)
const uint32 pc = cpu->pc(); const uint32 pc = cpu->pc();
// Fault in Mac ROM or RAM? // Fault in Mac ROM or RAM?
bool mac_fault = (pc >= ROMBase) && (pc < (ROMBase + ROM_AREA_SIZE)) || (pc >= RAMBase) && (pc < (RAMBase + RAMSize)) || (pc >= DR_CACHE_BASE && pc < (DR_CACHE_BASE + DR_CACHE_SIZE)); bool mac_fault = (pc >= ROMBase && pc < (ROMBase + ROM_AREA_SIZE)) || (pc >= RAMBase && pc < (RAMBase + RAMSize)) || (pc >= DR_CACHE_BASE && pc < (DR_CACHE_BASE + DR_CACHE_SIZE));
if (mac_fault) { if (mac_fault) {
// "VM settings" during MacOS 8 installation // "VM settings" during MacOS 8 installation

View File

@ -664,23 +664,6 @@ static const uint8 adbop_patch[] = { // Call ADBOp() completion procedure
}; };
/*
* Copy PowerPC code to ROM image and reverse bytes if necessary
*/
static inline void memcpy_powerpc_code(void *dst, const void *src, size_t len)
{
#ifdef WORDS_BIGENDIAN
(void)memcpy(dst, src, len);
#else
uint32 *d = (uint32 *)dst;
uint32 *s = (uint32 *)src;
for (int i = 0; i < len/4; i++)
d[i] = htonl(s[i]);
#endif
}
/* /*
* Install ROM patches (RAMBase and KernelDataAddr must be set) * Install ROM patches (RAMBase and KernelDataAddr must be set)
*/ */