mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-12-24 10:32:32 +00:00
fixed a couple of compiler warnings
This commit is contained in:
parent
5fa9b2abe9
commit
90c7198b75
@ -142,7 +142,7 @@ static bool open_dsp(void)
|
||||
silence_byte = 0x80;
|
||||
} else {
|
||||
unsigned long sup_format;
|
||||
ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &format);
|
||||
ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &sup_format);
|
||||
if (sup_format & AFMT_S16_BE) {
|
||||
little_endian = false;
|
||||
format = AFMT_S16_BE;
|
||||
@ -284,8 +284,6 @@ dev_opened:
|
||||
|
||||
void AudioInit(void)
|
||||
{
|
||||
char str[256];
|
||||
|
||||
// Init audio status (reasonable defaults) and feature flags
|
||||
AudioStatus.sample_rate = 44100 << 16;
|
||||
AudioStatus.sample_size = 16;
|
||||
@ -377,8 +375,6 @@ void audio_exit_stream()
|
||||
* Streaming function
|
||||
*/
|
||||
|
||||
static uint32 apple_stream_info; // Mac address of SoundComponentData struct describing next buffer
|
||||
|
||||
static void *stream_func(void *arg)
|
||||
{
|
||||
int16 *silent_buffer = new int16[sound_buffer_size / 2];
|
||||
|
@ -1043,7 +1043,7 @@ static void read_memory_settings(void)
|
||||
// Create "Memory/Misc" pane
|
||||
static void create_memory_pane(GtkWidget *top)
|
||||
{
|
||||
GtkWidget *box, *hbox, *vbox, *hbox2, *label, *scale, *menu;
|
||||
GtkWidget *box, *hbox, *vbox, *hbox2, *label, *scale;
|
||||
|
||||
box = make_pane(top, STR_MEMORY_MISC_PANE_TITLE);
|
||||
|
||||
|
@ -268,7 +268,7 @@ static void Blit_Copy_Raw(uint8 * dest, const uint8 * source, uint32 length)
|
||||
static void Blit_Expand_2_To_8(uint8 * dest, const uint8 * p, uint32 length)
|
||||
{
|
||||
uint8 *q = (uint8 *)dest;
|
||||
for (int i=0; i<length; i++) {
|
||||
for (uint32 i=0; i<length; i++) {
|
||||
uint8 c = *p++;
|
||||
*q++ = c >> 6;
|
||||
*q++ = (c >> 4) & 3;
|
||||
@ -280,7 +280,7 @@ static void Blit_Expand_2_To_8(uint8 * dest, const uint8 * p, uint32 length)
|
||||
static void Blit_Expand_4_To_8(uint8 * dest, const uint8 * p, uint32 length)
|
||||
{
|
||||
uint8 *q = (uint8 *)dest;
|
||||
for (int i=0; i<length; i++) {
|
||||
for (uint32 i=0; i<length; i++) {
|
||||
uint8 c = *p++;
|
||||
*q++ = c >> 4;
|
||||
*q++ = c & 0x0f;
|
||||
@ -294,7 +294,7 @@ static void Blit_Expand_4_To_8(uint8 * dest, const uint8 * p, uint32 length)
|
||||
static void Blit_Expand_2_To_16(uint8 * dest, const uint8 * p, uint32 length)
|
||||
{
|
||||
uint16 *q = (uint16 *)dest;
|
||||
for (int i=0; i<length; i++) {
|
||||
for (uint32 i=0; i<length; i++) {
|
||||
uint8 c = *p++;
|
||||
*q++ = ExpandMap[c >> 6];
|
||||
*q++ = ExpandMap[c >> 4];
|
||||
@ -306,7 +306,7 @@ static void Blit_Expand_2_To_16(uint8 * dest, const uint8 * p, uint32 length)
|
||||
static void Blit_Expand_4_To_16(uint8 * dest, const uint8 * p, uint32 length)
|
||||
{
|
||||
uint16 *q = (uint16 *)dest;
|
||||
for (int i=0; i<length; i++) {
|
||||
for (uint32 i=0; i<length; i++) {
|
||||
uint8 c = *p++;
|
||||
*q++ = ExpandMap[c >> 4];
|
||||
*q++ = ExpandMap[c];
|
||||
@ -316,7 +316,7 @@ static void Blit_Expand_4_To_16(uint8 * dest, const uint8 * p, uint32 length)
|
||||
static void Blit_Expand_8_To_16(uint8 * dest, const uint8 * p, uint32 length)
|
||||
{
|
||||
uint16 *q = (uint16 *)dest;
|
||||
for (int i=0; i<length; i++)
|
||||
for (uint32 i=0; i<length; i++)
|
||||
*q++ = ExpandMap[*p++];
|
||||
}
|
||||
|
||||
@ -327,7 +327,7 @@ static void Blit_Expand_8_To_16(uint8 * dest, const uint8 * p, uint32 length)
|
||||
static void Blit_Expand_2_To_32(uint8 * dest, const uint8 * p, uint32 length)
|
||||
{
|
||||
uint32 *q = (uint32 *)dest;
|
||||
for (int i=0; i<length; i++) {
|
||||
for (uint32 i=0; i<length; i++) {
|
||||
uint8 c = *p++;
|
||||
*q++ = ExpandMap[c >> 6];
|
||||
*q++ = ExpandMap[c >> 4];
|
||||
@ -339,7 +339,7 @@ static void Blit_Expand_2_To_32(uint8 * dest, const uint8 * p, uint32 length)
|
||||
static void Blit_Expand_4_To_32(uint8 * dest, const uint8 * p, uint32 length)
|
||||
{
|
||||
uint32 *q = (uint32 *)dest;
|
||||
for (int i=0; i<length; i++) {
|
||||
for (uint32 i=0; i<length; i++) {
|
||||
uint8 c = *p++;
|
||||
*q++ = ExpandMap[c >> 4];
|
||||
*q++ = ExpandMap[c];
|
||||
@ -349,7 +349,7 @@ static void Blit_Expand_4_To_32(uint8 * dest, const uint8 * p, uint32 length)
|
||||
static void Blit_Expand_8_To_32(uint8 * dest, const uint8 * p, uint32 length)
|
||||
{
|
||||
uint32 *q = (uint32 *)dest;
|
||||
for (int i=0; i<length; i++)
|
||||
for (uint32 i=0; i<length; i++)
|
||||
*q++ = ExpandMap[*p++];
|
||||
}
|
||||
|
||||
|
@ -195,12 +195,12 @@ static bool video_vosf_init(void)
|
||||
return false;
|
||||
|
||||
uint32 a = 0;
|
||||
for (int i = 0; i < mainBuffer.pageCount; i++) {
|
||||
int y1 = a / VideoMonitor.mode.bytes_per_row;
|
||||
for (unsigned i = 0; i < mainBuffer.pageCount; i++) {
|
||||
unsigned y1 = a / VideoMonitor.mode.bytes_per_row;
|
||||
if (y1 >= VideoMonitor.mode.y)
|
||||
y1 = VideoMonitor.mode.y - 1;
|
||||
|
||||
int y2 = (a + mainBuffer.pageSize) / VideoMonitor.mode.bytes_per_row;
|
||||
unsigned y2 = (a + mainBuffer.pageSize) / VideoMonitor.mode.bytes_per_row;
|
||||
if (y2 >= VideoMonitor.mode.y)
|
||||
y2 = VideoMonitor.mode.y - 1;
|
||||
|
||||
@ -332,7 +332,7 @@ static inline void update_display_window_vosf(driver_window *drv)
|
||||
{
|
||||
int page = 0;
|
||||
for (;;) {
|
||||
const int first_page = find_next_page_set(page);
|
||||
const unsigned first_page = find_next_page_set(page);
|
||||
if (first_page >= mainBuffer.pageCount)
|
||||
break;
|
||||
|
||||
@ -395,7 +395,7 @@ static inline void update_display_dga_vosf(void)
|
||||
{
|
||||
int page = 0;
|
||||
for (;;) {
|
||||
const int first_page = find_next_page_set(page);
|
||||
const unsigned first_page = find_next_page_set(page);
|
||||
if (first_page >= mainBuffer.pageCount)
|
||||
break;
|
||||
|
||||
|
@ -184,7 +184,6 @@ static void (*video_refresh)(void);
|
||||
|
||||
// Prototypes
|
||||
static void *redraw_func(void *arg);
|
||||
static int event2keycode(XKeyEvent &ev);
|
||||
|
||||
// From main_unix.cpp
|
||||
extern char *x_display_name;
|
||||
@ -561,7 +560,7 @@ void driver_base::restore_mouse_accel(void)
|
||||
|
||||
// Open display
|
||||
driver_window::driver_window(const video_mode &mode)
|
||||
: gc(0), img(NULL), have_shm(false), mouse_grabbed(false), mac_cursor(0)
|
||||
: gc(0), img(NULL), have_shm(false), mac_cursor(0), mouse_grabbed(false)
|
||||
{
|
||||
int width = mode.x, height = mode.y;
|
||||
int aligned_width = (width + 15) & ~15;
|
||||
@ -2189,7 +2188,7 @@ static void update_display_dynamic(int ticker, driver_window *drv)
|
||||
static void update_display_static(driver_window *drv)
|
||||
{
|
||||
// Incremental update code
|
||||
int wide = 0, high = 0, x1, x2, y1, y2, i, j;
|
||||
unsigned wide = 0, high = 0, x1, x2, y1, y2, i, j;
|
||||
int bytes_per_row = VideoMonitor.mode.bytes_per_row;
|
||||
int bytes_per_pixel = VideoMonitor.mode.bytes_per_row / VideoMonitor.mode.x;
|
||||
uint8 *p, *p2;
|
||||
|
@ -70,7 +70,6 @@ static int32 AudioGetInfo(uint32 infoPtr, uint32 selector, uint32 sourceID)
|
||||
{
|
||||
D(bug(" AudioGetInfo %c%c%c%c, infoPtr %08lx, source ID %08lx\n", selector >> 24, (selector >> 16) & 0xff, (selector >> 8) & 0xff, selector & 0xff, infoPtr, sourceID));
|
||||
M68kRegisters r;
|
||||
int i;
|
||||
|
||||
switch (selector) {
|
||||
case siSampleSize:
|
||||
@ -86,7 +85,7 @@ static int32 AudioGetInfo(uint32 infoPtr, uint32 selector, uint32 sourceID)
|
||||
WriteMacInt16(infoPtr + sil_count, audio_sample_sizes.size());
|
||||
WriteMacInt32(infoPtr + sil_infoHandle, h);
|
||||
uint32 sp = ReadMacInt32(h);
|
||||
for (i=0; i<audio_sample_sizes.size(); i++)
|
||||
for (unsigned i=0; i<audio_sample_sizes.size(); i++)
|
||||
WriteMacInt16(sp + i*2, audio_sample_sizes[i]);
|
||||
break;
|
||||
}
|
||||
@ -104,7 +103,7 @@ static int32 AudioGetInfo(uint32 infoPtr, uint32 selector, uint32 sourceID)
|
||||
WriteMacInt16(infoPtr + sil_count, audio_channel_counts.size());
|
||||
WriteMacInt32(infoPtr + sil_infoHandle, h);
|
||||
uint32 sp = ReadMacInt32(h);
|
||||
for (i=0; i<audio_channel_counts.size(); i++)
|
||||
for (unsigned i=0; i<audio_channel_counts.size(); i++)
|
||||
WriteMacInt16(sp + i*2, audio_channel_counts[i]);
|
||||
break;
|
||||
}
|
||||
@ -122,7 +121,7 @@ static int32 AudioGetInfo(uint32 infoPtr, uint32 selector, uint32 sourceID)
|
||||
WriteMacInt16(infoPtr + sil_count, audio_sample_rates.size());
|
||||
WriteMacInt32(infoPtr + sil_infoHandle, h);
|
||||
uint32 lp = ReadMacInt32(h);
|
||||
for (i=0; i<audio_sample_rates.size(); i++)
|
||||
for (unsigned i=0; i<audio_sample_rates.size(); i++)
|
||||
WriteMacInt32(lp + i*4, audio_sample_rates[i]);
|
||||
break;
|
||||
}
|
||||
@ -187,7 +186,6 @@ static int32 AudioSetInfo(uint32 infoPtr, uint32 selector, uint32 sourceID)
|
||||
{
|
||||
D(bug(" AudioSetInfo %c%c%c%c, infoPtr %08lx, source ID %08lx\n", selector >> 24, (selector >> 16) & 0xff, (selector >> 8) & 0xff, selector & 0xff, infoPtr, sourceID));
|
||||
M68kRegisters r;
|
||||
int i;
|
||||
|
||||
switch (selector) {
|
||||
case siSampleSize:
|
||||
@ -196,7 +194,7 @@ static int32 AudioSetInfo(uint32 infoPtr, uint32 selector, uint32 sourceID)
|
||||
return siDeviceBusyErr;
|
||||
if (infoPtr == AudioStatus.sample_size)
|
||||
return noErr;
|
||||
for (i=0; i<audio_sample_sizes.size(); i++)
|
||||
for (unsigned i=0; i<audio_sample_sizes.size(); i++)
|
||||
if (audio_sample_sizes[i] == infoPtr) {
|
||||
if (audio_set_sample_size(i))
|
||||
return noErr;
|
||||
@ -211,7 +209,7 @@ static int32 AudioSetInfo(uint32 infoPtr, uint32 selector, uint32 sourceID)
|
||||
return siDeviceBusyErr;
|
||||
if (infoPtr == AudioStatus.sample_rate)
|
||||
return noErr;
|
||||
for (i=0; i<audio_sample_rates.size(); i++)
|
||||
for (unsigned i=0; i<audio_sample_rates.size(); i++)
|
||||
if (audio_sample_rates[i] == infoPtr) {
|
||||
if (audio_set_sample_rate(i))
|
||||
return noErr;
|
||||
@ -226,7 +224,7 @@ static int32 AudioSetInfo(uint32 infoPtr, uint32 selector, uint32 sourceID)
|
||||
return siDeviceBusyErr;
|
||||
if (infoPtr == AudioStatus.channels)
|
||||
return noErr;
|
||||
for (i=0; i<audio_channel_counts.size(); i++)
|
||||
for (unsigned i=0; i<audio_channel_counts.size(); i++)
|
||||
if (audio_channel_counts[i] == infoPtr) {
|
||||
if (audio_set_channels(i))
|
||||
return noErr;
|
||||
|
@ -60,10 +60,10 @@ void EmulOp(uint16 opcode, M68kRegisters *r)
|
||||
switch (opcode) {
|
||||
case M68K_EMUL_BREAK: { // Breakpoint
|
||||
printf("*** Breakpoint\n");
|
||||
printf("d0 %08lx d1 %08lx d2 %08lx d3 %08lx\n"
|
||||
"d4 %08lx d5 %08lx d6 %08lx d7 %08lx\n"
|
||||
"a0 %08lx a1 %08lx a2 %08lx a3 %08lx\n"
|
||||
"a4 %08lx a5 %08lx a6 %08lx a7 %08lx\n"
|
||||
printf("d0 %08x d1 %08x d2 %08x d3 %08x\n"
|
||||
"d4 %08x d5 %08x d6 %08x d7 %08x\n"
|
||||
"a0 %08x a1 %08x a2 %08x a3 %08x\n"
|
||||
"a4 %08x a5 %08x a6 %08x a7 %08x\n"
|
||||
"sr %04x\n",
|
||||
r->d[0], r->d[1], r->d[2], r->d[3], r->d[4], r->d[5], r->d[6], r->d[7],
|
||||
r->a[0], r->a[1], r->a[2], r->a[3], r->a[4], r->a[5], r->a[6], r->a[7],
|
||||
@ -538,10 +538,10 @@ void EmulOp(uint16 opcode, M68kRegisters *r)
|
||||
|
||||
default:
|
||||
printf("FATAL: EMUL_OP called with bogus opcode %08x\n", opcode);
|
||||
printf("d0 %08lx d1 %08lx d2 %08lx d3 %08lx\n"
|
||||
"d4 %08lx d5 %08lx d6 %08lx d7 %08lx\n"
|
||||
"a0 %08lx a1 %08lx a2 %08lx a3 %08lx\n"
|
||||
"a4 %08lx a5 %08lx a6 %08lx a7 %08lx\n"
|
||||
printf("d0 %08x d1 %08x d2 %08x d3 %08x\n"
|
||||
"d4 %08x d5 %08x d6 %08x d7 %08x\n"
|
||||
"a0 %08x a1 %08x a2 %08x a3 %08x\n"
|
||||
"a4 %08x a5 %08x a6 %08x a7 %08x\n"
|
||||
"sr %04x\n",
|
||||
r->d[0], r->d[1], r->d[2], r->d[3], r->d[4], r->d[5], r->d[6], r->d[7],
|
||||
r->a[0], r->a[1], r->a[2], r->a[3], r->a[4], r->a[5], r->a[6], r->a[7],
|
||||
|
@ -730,9 +730,6 @@ static int16 get_current_dir(uint32 pb, uint32 dirID, uint32 ¤t_dir, bool
|
||||
if (no_vol_name)
|
||||
WriteMacInt32(pb + ioNamePtr, name_ptr);
|
||||
int16 status = ReadMacInt16(fs_data + fsReturn);
|
||||
int16 more_matches = ReadMacInt16(fs_data + fsReturn + 2);
|
||||
int16 vRefNum = ReadMacInt16(fs_data + fsReturn + 4);
|
||||
uint32 vcb = ReadMacInt32(fs_data + fsReturn + 6);
|
||||
D(bug(" UTDetermineVol() returned %d, status %d\n", r.d[0], status));
|
||||
result = (int16)(r.d[0] & 0xffff);
|
||||
|
||||
@ -967,7 +964,9 @@ static int16 fs_volume_mount(uint32 pb)
|
||||
r.a[0] = fs_data + fsReturn;
|
||||
r.a[1] = fs_data + fsReturn + 2;
|
||||
Execute68k(fs_data + fsAllocateVCB, &r);
|
||||
#if DEBUG
|
||||
uint16 sysVCBLength = ReadMacInt16(fs_data + fsReturn);
|
||||
#endif
|
||||
uint32 vcb = ReadMacInt32(fs_data + fsReturn + 2);
|
||||
D(bug(" UTAllocateVCB() returned %d, vcb %08lx, size %d\n", r.d[0], vcb, sysVCBLength));
|
||||
if (r.d[0] & 0xffff)
|
||||
|
@ -450,7 +450,7 @@ void ChecksumSlotROM(void)
|
||||
p[slot_rom_size - 10] = 0;
|
||||
p[slot_rom_size - 9] = 0;
|
||||
uint32 crc = 0;
|
||||
for (uint32 i=0; i<slot_rom_size; i++) {
|
||||
for (int i=0; i<slot_rom_size; i++) {
|
||||
crc = (crc << 1) | (crc >> 31);
|
||||
crc += p[i];
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ static void set_gray_palette(void)
|
||||
static void load_ramp_palette(void)
|
||||
{
|
||||
// Find tables for gamma correction
|
||||
uint8 *red_gamma, *green_gamma, *blue_gamma;
|
||||
uint8 *red_gamma = NULL, *green_gamma = NULL, *blue_gamma = NULL;
|
||||
bool have_gamma = false;
|
||||
int data_width = 0;
|
||||
if (VidLocal.gamma_table) {
|
||||
@ -511,7 +511,7 @@ int16 VideoDriverControl(uint32 pb, uint32 dce)
|
||||
return paramErr;
|
||||
|
||||
// Find tables for gamma correction
|
||||
uint8 *red_gamma, *green_gamma, *blue_gamma;
|
||||
uint8 *red_gamma = NULL, *green_gamma = NULL, *blue_gamma = NULL;
|
||||
bool have_gamma = false;
|
||||
int data_width = 0;
|
||||
if (VidLocal.gamma_table) {
|
||||
@ -862,26 +862,6 @@ int16 VideoDriverStatus(uint32 pb, uint32 dce)
|
||||
WriteMacInt32(vp + vpVRes, 0x00480000);
|
||||
uint32 pix_type, pix_size, cmp_count, cmp_size, dev_type;
|
||||
switch (i->depth) {
|
||||
case VDEPTH_1BIT:
|
||||
pix_type = 0; pix_size = 1;
|
||||
cmp_count = 1; cmp_size = 1;
|
||||
dev_type = 0; // CLUT
|
||||
break;
|
||||
case VDEPTH_2BIT:
|
||||
pix_type = 0; pix_size = 2;
|
||||
cmp_count = 1; cmp_size = 2;
|
||||
dev_type = 0; // CLUT
|
||||
break;
|
||||
case VDEPTH_4BIT:
|
||||
pix_type = 0; pix_size = 4;
|
||||
cmp_count = 1; cmp_size = 4;
|
||||
dev_type = 0; // CLUT
|
||||
break;
|
||||
case VDEPTH_8BIT:
|
||||
pix_type = 0; pix_size = 8;
|
||||
cmp_count = 1; cmp_size = 8;
|
||||
dev_type = 0; // CLUT
|
||||
break;
|
||||
case VDEPTH_16BIT:
|
||||
pix_type = 0x10; pix_size = 16;
|
||||
cmp_count = 3; cmp_size = 5;
|
||||
@ -892,6 +872,11 @@ int16 VideoDriverStatus(uint32 pb, uint32 dce)
|
||||
cmp_count = 3; cmp_size = 8;
|
||||
dev_type = 2; // direct
|
||||
break;
|
||||
default:
|
||||
pix_type = 0; pix_size = 1 << i->depth;
|
||||
cmp_count = 1; cmp_size = 1 << i->depth;
|
||||
dev_type = 0; // CLUT
|
||||
break;
|
||||
}
|
||||
WriteMacInt16(vp + vpPixelType, pix_type);
|
||||
WriteMacInt16(vp + vpPixelSize, pix_size);
|
||||
|
Loading…
Reference in New Issue
Block a user