Skip to content

Commit

Permalink
fix some warnings in Xcode8 build
Browse files Browse the repository at this point in the history
  • Loading branch information
asvitkine committed Dec 18, 2016
1 parent 5538376 commit 1f211fb
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 59 deletions.
28 changes: 1 addition & 27 deletions BasiliskII/src/SDL/video_sdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,6 @@ static void ErrorAlert(int error)
{
ErrorAlert(GetString(error));
}

// Display warning alert
static void WarningAlert(int warning)
{
WarningAlert(GetString(warning));
}
#endif


Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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()) {
Expand Down
4 changes: 2 additions & 2 deletions BasiliskII/src/Unix/bincue_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
2 changes: 2 additions & 0 deletions BasiliskII/src/Unix/rpc_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
16 changes: 8 additions & 8 deletions BasiliskII/src/slirp/ip_icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;

Expand Down Expand Up @@ -201,12 +201,12 @@ icmp_input(m, hlen)

#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;
Expand All @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion BasiliskII/src/slirp/ip_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;

Expand Down
2 changes: 1 addition & 1 deletion BasiliskII/src/slirp/sbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion BasiliskII/src/slirp/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion SheepShaver/src/MacOSX/Launcher/DiskType.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ -(void)setIsCDROM:(BOOL)cdrom
}

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

@end
2 changes: 1 addition & 1 deletion SheepShaver/src/kpx_cpu/sheepshaver_glue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 0 additions & 17 deletions SheepShaver/src/rom_patches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
*/
Expand Down

0 comments on commit 1f211fb

Please sign in to comment.