diff --git a/BasiliskII/src/Unix/audio_oss_esd.cpp b/BasiliskII/src/Unix/audio_oss_esd.cpp index 1021c93e..1e6cad42 100644 --- a/BasiliskII/src/Unix/audio_oss_esd.cpp +++ b/BasiliskII/src/Unix/audio_oss_esd.cpp @@ -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]; diff --git a/BasiliskII/src/Unix/prefs_editor_gtk.cpp b/BasiliskII/src/Unix/prefs_editor_gtk.cpp index 08fc1f97..52e87a89 100644 --- a/BasiliskII/src/Unix/prefs_editor_gtk.cpp +++ b/BasiliskII/src/Unix/prefs_editor_gtk.cpp @@ -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); diff --git a/BasiliskII/src/Unix/video_blit.cpp b/BasiliskII/src/Unix/video_blit.cpp index 0a03e0ec..163be1d2 100644 --- a/BasiliskII/src/Unix/video_blit.cpp +++ b/BasiliskII/src/Unix/video_blit.cpp @@ -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> 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> 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> 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> 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> 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> 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= 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; diff --git a/BasiliskII/src/Unix/video_x.cpp b/BasiliskII/src/Unix/video_x.cpp index 4d8268b5..b09e0193 100644 --- a/BasiliskII/src/Unix/video_x.cpp +++ b/BasiliskII/src/Unix/video_x.cpp @@ -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; diff --git a/BasiliskII/src/audio.cpp b/BasiliskII/src/audio.cpp index c3891a1d..239c2896 100644 --- a/BasiliskII/src/audio.cpp +++ b/BasiliskII/src/audio.cpp @@ -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> 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; id[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], diff --git a/BasiliskII/src/extfs.cpp b/BasiliskII/src/extfs.cpp index 2e3a9a95..ca968772 100644 --- a/BasiliskII/src/extfs.cpp +++ b/BasiliskII/src/extfs.cpp @@ -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) diff --git a/BasiliskII/src/slot_rom.cpp b/BasiliskII/src/slot_rom.cpp index da4d6222..5c23a49d 100644 --- a/BasiliskII/src/slot_rom.cpp +++ b/BasiliskII/src/slot_rom.cpp @@ -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> 31); crc += p[i]; } diff --git a/BasiliskII/src/video.cpp b/BasiliskII/src/video.cpp index d60baac3..1b784c20 100644 --- a/BasiliskII/src/video.cpp +++ b/BasiliskII/src/video.cpp @@ -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);