diff options
author | Takamichi Horikawa <takamichiho@gmail.com> | 2018-01-05 23:30:41 +0900 |
---|---|---|
committer | Takamichi Horikawa <takamichiho@gmail.com> | 2018-01-05 23:30:41 +0900 |
commit | 98f4e72f1ae492771a755bf86c88da7c21f20720 (patch) | |
tree | b1c85eadbe23432f956bc3377ea88a8449672175 | |
parent | df6915f07e6cc13600a750b4fb4a8adf482b45f2 (diff) |
removed most compiler warnings
-rw-r--r-- | common/fmplayer_file.c | 6 | ||||
-rw-r--r-- | fmdriver/fmdriver_fmp.c | 2 | ||||
-rw-r--r-- | fmdsp/font_fmdsp_small.c | 2 | ||||
-rw-r--r-- | gtk/oscilloview-gl.c | 3 | ||||
-rw-r--r-- | pacc/pacc-d3d9.c | 1 | ||||
-rw-r--r-- | pacc/pacc-gl.c | 2 | ||||
-rw-r--r-- | win32/about.c | 5 | ||||
-rw-r--r-- | win32/amd64/Makefile | 2 | ||||
-rw-r--r-- | win32/configdialog.c | 6 | ||||
-rw-r--r-- | win32/main.c | 3 | ||||
-rw-r--r-- | win32/oscilloview.c | 7 | ||||
-rw-r--r-- | win32/toneview.c | 5 | ||||
-rw-r--r-- | win32/x86/Makefile | 2 |
13 files changed, 44 insertions, 2 deletions
diff --git a/common/fmplayer_file.c b/common/fmplayer_file.c index ce7e1dc..3d74432 100644 --- a/common/fmplayer_file.c +++ b/common/fmplayer_file.c @@ -14,9 +14,14 @@ void fmplayer_file_free(const struct fmplayer_file *fmfileptr) { } static void opna_writereg_dummy(struct fmdriver_work *work, unsigned addr, unsigned data) { + (void)work; + (void)addr; + (void)data; } static unsigned opna_readreg_dummy(struct fmdriver_work *work, unsigned addr) { + (void)work; + (void)addr; return 0xff; } @@ -26,6 +31,7 @@ struct dummy_opna { }; static uint8_t opna_status_dummy(struct fmdriver_work *work, bool a1) { + (void)a1; struct dummy_opna *opna = work->opna; if (!opna->timerb_loop) { if (work->loop_cnt >= opna->loopcnt) { diff --git a/fmdriver/fmdriver_fmp.c b/fmdriver/fmdriver_fmp.c index 635ae4b..89cfc19 100644 --- a/fmdriver/fmdriver_fmp.c +++ b/fmdriver/fmdriver_fmp.c @@ -2231,6 +2231,7 @@ static void fmp_part_pit_pdzf( struct fmdriver_work *work,
struct fmp_part *part
) {
+ (void)work;
if (part->pdzf.mode != 2) return;
if (--part->pdzf.pit.delay) return;
part->pdzf.pit.delay = 1;
@@ -3205,6 +3206,7 @@ static void fmp_title( struct fmdriver_work *work,
struct driver_fmp *fmp,
uint16_t offset) {
+ (void)work;
int l = 0;
int li = 0;
for (int si = 0;; si++) {
diff --git a/fmdsp/font_fmdsp_small.c b/fmdsp/font_fmdsp_small.c index 6f89797..245f085 100644 --- a/fmdsp/font_fmdsp_small.c +++ b/fmdsp/font_fmdsp_small.c @@ -5,6 +5,7 @@ static const void *fmdsp_font_get(const struct fmdsp_font *font, uint16_t addr, enum fmdsp_font_type type) { + (void)font; if (type != FMDSP_FONT_ANK) return 0; if (addr >> 8) return 0; return &fontdat[addr*6]; @@ -16,6 +17,7 @@ const struct fmdsp_font font_fmdsp_small = { static const void *fmdsp_font_medium_get(const struct fmdsp_font *font, uint16_t addr, enum fmdsp_font_type type) { + (void)font; if (type != FMDSP_FONT_ANK) return 0; if (addr >> 8) return 0; return &fmdsp_medium_dat[addr*8]; diff --git a/gtk/oscilloview-gl.c b/gtk/oscilloview-gl.c index 40d6813..01e7808 100644 --- a/gtk/oscilloview-gl.c +++ b/gtk/oscilloview-gl.c @@ -27,6 +27,7 @@ static struct { static void on_glarea_unrealize(GtkWidget *w, gpointer ptr) { (void)w; + (void)ptr; GtkGLArea *area = GTK_GL_AREA(w); gtk_gl_area_make_current(area); if (gtk_gl_area_get_error(area)) return; @@ -118,6 +119,8 @@ static void on_realize(GtkWidget *w, gpointer ptr) { static gboolean on_render(GtkGLArea *area, GdkGLContext *ctx, gpointer ptr) { + (void)area; + (void)ctx; (void)ptr; if (!atomic_flag_test_and_set_explicit( &oscilloview_g.flag, memory_order_acquire)) { diff --git a/pacc/pacc-d3d9.c b/pacc/pacc-d3d9.c index df78f6a..55555c5 100644 --- a/pacc/pacc-d3d9.c +++ b/pacc/pacc-d3d9.c @@ -71,6 +71,7 @@ static void pacc_buf_delete(struct pacc_buf *pb) { static struct pacc_buf *pacc_gen_buf( struct pacc_ctx *pc, struct pacc_tex *pt, enum pacc_buf_mode mode) { + (void)mode; struct pacc_buf *pb = malloc(sizeof(*pb)); if (!pb) goto err; *pb = (struct pacc_buf) { diff --git a/pacc/pacc-gl.c b/pacc/pacc-gl.c index ada045e..ae0db0e 100644 --- a/pacc/pacc-gl.c +++ b/pacc/pacc-gl.c @@ -188,6 +188,7 @@ static void pacc_buf_delete(struct pacc_buf *pb) { static struct pacc_buf *pacc_gen_buf( struct pacc_ctx *pc, struct pacc_tex *pt, enum pacc_buf_mode mode) { + (void)pc; struct pacc_buf *pb = malloc(sizeof(*pb)); if (!pb) goto err; *pb = (struct pacc_buf) { @@ -432,6 +433,7 @@ static void pacc_tex_delete(struct pacc_tex *pt) { } static struct pacc_tex *pacc_gen_tex(struct pacc_ctx *pc, int w, int h) { + (void)pc; struct pacc_tex *pt = malloc(sizeof(*pt)); if (!pt) goto err; *pt = (struct pacc_tex) { diff --git a/win32/about.c b/win32/about.c index ff8f165..344bd30 100644 --- a/win32/about.c +++ b/win32/about.c @@ -24,6 +24,7 @@ static struct { } g; static void on_destroy(HWND hwnd) { + (void)hwnd; DestroyWindow(g.static_main); DestroyWindow(g.static_info); DestroyWindow(g.static_help); @@ -50,6 +51,7 @@ static void update_status(void) { } static bool on_create(HWND hwnd, const CREATESTRUCT *cs) { + (void)cs; RECT wr = { .left = 0, .top = 0, @@ -121,11 +123,14 @@ static bool on_create(HWND hwnd, const CREATESTRUCT *cs) { } static void on_activate(HWND hwnd, bool activate, HWND targetwnd, WINBOOL state) { + (void)targetwnd; + (void)state; if (activate) g_currentdlg = hwnd; else g_currentdlg = 0; } static void on_command(HWND hwnd, int id, HWND hwnd_c, UINT code) { + (void)hwnd_c; if (code == BN_CLICKED && (id == ID_OK)) { DestroyWindow(hwnd); } diff --git a/win32/amd64/Makefile b/win32/amd64/Makefile index fb1393f..805ca8b 100644 --- a/win32/amd64/Makefile +++ b/win32/amd64/Makefile @@ -17,7 +17,7 @@ PREFIX=$(ARCH)-w64-mingw32- CC=$(PREFIX)gcc WINDRES=$(PREFIX)windres STRIP=$(PREFIX)strip -CFLAGS=-std=c99 -O2 -Wall -Werror -Wextra -pedantic -Wno-unused-parameter -Wno-missing-field-initializers -I../.. \ +CFLAGS=-std=c99 -O2 -Wall -Werror -Wextra -pedantic -I../.. \ $(addprefix -D,$(DEFINES)) SSECFLAGS=-mssse3 -O3 LIBS=-mwindows -municode \ diff --git a/win32/configdialog.c b/win32/configdialog.c index 82ca5b5..3d15220 100644 --- a/win32/configdialog.c +++ b/win32/configdialog.c @@ -104,6 +104,7 @@ static LRESULT groupbox_wndproc( } static void on_destroy(HWND hwnd) { + (void)hwnd; DestroyWindow(g.radio_ppz8_none); DestroyWindow(g.radio_ppz8_linear); DestroyWindow(g.radio_ppz8_sinc); @@ -130,6 +131,8 @@ static void update_ssg_mix(void) { } static void on_command(HWND hwnd, int id, HWND hwnd_c, UINT code) { + (void)hwnd; + (void)hwnd_c; switch (id) { case ID_CHECK_FM_HIRES_SIN: fmplayer_config.fm_hires_sin = Button_GetCheck(g.check_fm_hires_sin); @@ -195,6 +198,7 @@ static void on_command(HWND hwnd, int id, HWND hwnd_c, UINT code) { } static bool on_create(HWND hwnd, const CREATESTRUCT *cs) { + (void)cs; RECT wr; wr.left = 0; wr.right = WIN_W; @@ -337,6 +341,8 @@ static bool on_create(HWND hwnd, const CREATESTRUCT *cs) { } static void on_activate(HWND hwnd, bool activate, HWND targetwnd, WINBOOL state) { + (void)targetwnd; + (void)state; if (activate) g_currentdlg = hwnd; else g_currentdlg = 0; } diff --git a/win32/main.c b/win32/main.c index fa7d7e2..946c7db 100644 --- a/win32/main.c +++ b/win32/main.c @@ -316,6 +316,7 @@ static void toggle_2x(HWND hwnd) { } static bool proc_key(UINT vk, bool down, int repeat) { + (void)repeat; if (down) { if (VK_F1 <= vk && vk <= VK_F12) { if (GetKeyState(VK_CONTROL) & 0x8000U) { @@ -682,6 +683,8 @@ static void on_key(HWND hwnd, UINT vk, BOOL down, int repeat, UINT scan) { } static void on_activate(HWND hwnd, bool activate, HWND targetwnd, WINBOOL state) { + (void)targetwnd; + (void)state; if (activate) g_currentdlg = hwnd; else g_currentdlg = 0; } diff --git a/win32/oscilloview.c b/win32/oscilloview.c index 3414cd4..a4bd8cf 100644 --- a/win32/oscilloview.c +++ b/win32/oscilloview.c @@ -29,6 +29,7 @@ static struct { } g; static void on_destroy(HWND hwnd) { + (void)hwnd; g.oscilloview = 0; timeKillEvent(g.mmtimer); DeleteObject(g.whitepen); @@ -38,10 +39,16 @@ static void on_destroy(HWND hwnd) { static void CALLBACK mmtimer_cb(UINT timerid, UINT msg, DWORD_PTR userptr, DWORD_PTR dw1, DWORD_PTR dw2) { + (void)timerid; + (void)msg; + (void)userptr; + (void)dw1; + (void)dw2; PostMessage(g.oscilloview, WM_USER, 0, 0); } static bool on_create(HWND hwnd, const CREATESTRUCT *cs) { + (void)cs; g.whitepen = CreatePen(PS_SOLID, 1, RGB(255, 255, 255)); ShowWindow(hwnd, SW_SHOW); //SetTimer(hwnd, TIMER_UPDATE, 16, 0); diff --git a/win32/toneview.c b/win32/toneview.c index ab0b3df..b943331 100644 --- a/win32/toneview.c +++ b/win32/toneview.c @@ -48,6 +48,7 @@ static struct { extern HWND g_currentdlg; static void on_destroy(HWND hwnd) { + (void)hwnd; for (int i = 0; i < 6; i++) { DestroyWindow(g.tonelabel[i]); DestroyWindow(g.copybutton[i]); @@ -133,6 +134,7 @@ static LRESULT static_wndproc( } static bool on_create(HWND hwnd, const CREATESTRUCT *cs) { + (void)cs; g.format_disp = -1; RECT wr; wr.left = 0; @@ -200,6 +202,7 @@ static bool on_create(HWND hwnd, const CREATESTRUCT *cs) { } static void on_timer(HWND hwnd, UINT id) { + (void)hwnd; if (id == TIMER_UPDATE) { if (!atomic_flag_test_and_set_explicit( &toneview_g.flag, memory_order_acquire)) { @@ -227,6 +230,8 @@ static void on_timer(HWND hwnd, UINT id) { } static void on_activate(HWND hwnd, bool activate, HWND targetwnd, WINBOOL state) { + (void)targetwnd; + (void)state; if (activate) g_currentdlg = hwnd; else g_currentdlg = 0; } diff --git a/win32/x86/Makefile b/win32/x86/Makefile index 3437d66..6dfc3f5 100644 --- a/win32/x86/Makefile +++ b/win32/x86/Makefile @@ -19,7 +19,7 @@ WINDRES=$(PREFIX)windres STRIP=$(PREFIX)strip CFLAGS=-std=c99 -O2 -Wall -Wextra -Werror -pedantic -I../.. \ $(addprefix -D,$(DEFINES)) \ - -march=i586 -Wno-unused-parameter -Wno-missing-field-initializers + -march=i586 SSECFLAGS=-mssse3 -O3 LIBS=-s -mwindows -municode \ $(addprefix -l,$(LIBBASE)) |