diff --git a/BasiliskII/src/SDL/video_sdl.cpp b/BasiliskII/src/SDL/video_sdl.cpp index 9a218082..77c102bc 100644 --- a/BasiliskII/src/SDL/video_sdl.cpp +++ b/BasiliskII/src/SDL/video_sdl.cpp @@ -343,12 +343,6 @@ static void ErrorAlert(int error) { ErrorAlert(GetString(error)); } - -// Display warning alert -static void WarningAlert(int warning) -{ - WarningAlert(GetString(warning)); -} #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 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 if (!video_vosf_init(monitor)) { - WarningAlert(STR_VOSF_INIT_ERR); + WarningAlert(GetString(STR_VOSF_INIT_ERR)); use_vosf = false; } else if (!video_vosf_profitable()) { diff --git a/BasiliskII/src/Unix/bincue_unix.cpp b/BasiliskII/src/Unix/bincue_unix.cpp index 11c93548..b20b8543 100644 --- a/BasiliskII/src/Unix/bincue_unix.cpp +++ b/BasiliskII/src/Unix/bincue_unix.cpp @@ -799,9 +799,9 @@ static uint8 *fill_buffer(int stream_len) #ifdef USE_SDL_AUDIO void MixAudio_bincue(uint8 *stream, int stream_len) { - uint8 *buf; 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); } } diff --git a/BasiliskII/src/Unix/rpc_unix.cpp b/BasiliskII/src/Unix/rpc_unix.cpp index 378c5dd6..ec76e2e2 100644 --- a/BasiliskII/src/Unix/rpc_unix.cpp +++ b/BasiliskII/src/Unix/rpc_unix.cpp @@ -433,7 +433,9 @@ static struct { int last; int count; } g_message_descriptors = { NULL, 0, 0 }; +#ifdef USE_THREADS static pthread_mutex_t g_message_descriptors_lock = PTHREAD_MUTEX_INITIALIZER; +#endif // Add a user-defined marshaler static int rpc_message_add_callback(const rpc_message_descriptor_t *desc) diff --git a/BasiliskII/src/slirp/ip_icmp.c b/BasiliskII/src/slirp/ip_icmp.c index 75a4614a..55376a8b 100644 --- a/BasiliskII/src/slirp/ip_icmp.c +++ b/BasiliskII/src/slirp/ip_icmp.c @@ -77,7 +77,7 @@ icmp_input(m, hlen) DEBUG_CALL("icmp_input"); 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++; @@ -201,12 +201,12 @@ end_error: #define ICMP_MAXDATALEN (IP_MSS-28) void -icmp_error(msrc, type, code, minsize, message) - struct mbuf *msrc; - u_char type; - u_char code; - int minsize; - char *message; +icmp_error( + struct mbuf *msrc, + u_char type, + u_char code, + int minsize, + char *message) { unsigned hlen, shlen, s_ip_len; register struct ip *ip; @@ -215,7 +215,7 @@ icmp_error(msrc, type, code, minsize, message) DEBUG_CALL("icmp_error"); 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; diff --git a/BasiliskII/src/slirp/ip_input.c b/BasiliskII/src/slirp/ip_input.c index d9426997..cac8493b 100644 --- a/BasiliskII/src/slirp/ip_input.c +++ b/BasiliskII/src/slirp/ip_input.c @@ -72,7 +72,7 @@ ip_input(m) DEBUG_CALL("ip_input"); 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++; diff --git a/BasiliskII/src/slirp/sbuf.c b/BasiliskII/src/slirp/sbuf.c index 6af075e7..278e3687 100644 --- a/BasiliskII/src/slirp/sbuf.c +++ b/BasiliskII/src/slirp/sbuf.c @@ -71,7 +71,7 @@ void sbappend(struct socket *so, struct mbuf *m) DEBUG_CALL("sbappend"); DEBUG_ARG("so = %lx", (long)so); 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 */ if (m->m_len <= 0) { diff --git a/BasiliskII/src/slirp/socket.c b/BasiliskII/src/slirp/socket.c index 2c0e067e..42ba31b2 100644 --- a/BasiliskII/src/slirp/socket.c +++ b/BasiliskII/src/slirp/socket.c @@ -454,7 +454,7 @@ sorecvfrom(so) m->m_len = recvfrom(so->s, m->m_data, len, 0, (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))); if(m->m_len<0) { u_char code=ICMP_UNREACH_PORT; diff --git a/SheepShaver/src/MacOSX/Launcher/DiskType.m b/SheepShaver/src/MacOSX/Launcher/DiskType.m index ec21d458..d3a4f5c7 100755 --- a/SheepShaver/src/MacOSX/Launcher/DiskType.m +++ b/SheepShaver/src/MacOSX/Launcher/DiskType.m @@ -29,7 +29,7 @@ } -(NSString*)description { - return [NSString stringWithFormat:@"DiskType, path:%@ isCDROM:%@", _path, _isCDROM]; + return [NSString stringWithFormat:@"DiskType, path:%@ isCDROM:%hhd", _path, _isCDROM]; } @end diff --git a/SheepShaver/src/kpx_cpu/sheepshaver_glue.cpp b/SheepShaver/src/kpx_cpu/sheepshaver_glue.cpp index 7d6a599c..dc9043b7 100644 --- a/SheepShaver/src/kpx_cpu/sheepshaver_glue.cpp +++ b/SheepShaver/src/kpx_cpu/sheepshaver_glue.cpp @@ -772,7 +772,7 @@ sigsegv_return_t sigsegv_handler(sigsegv_info_t *sip) const uint32 pc = cpu->pc(); // 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) { // "VM settings" during MacOS 8 installation diff --git a/SheepShaver/src/rom_patches.cpp b/SheepShaver/src/rom_patches.cpp index 9dcd826a..83d6f17d 100644 --- a/SheepShaver/src/rom_patches.cpp +++ b/SheepShaver/src/rom_patches.cpp @@ -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) */