From 3a59fb7b1c7c68c70c3725b086faeeb51236f720 Mon Sep 17 00:00:00 2001 From: Takamichi Horikawa Date: Wed, 25 Jan 2017 23:43:57 +0900 Subject: corrected uncaught mistakes found with msvc --- fmdriver/fmdriver_fmp.c | 2 +- fmdsp/fmdsp.c | 4 ++-- win32/main.c | 10 ++++++---- win32/x86/Makefile | 12 +++++++++--- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/fmdriver/fmdriver_fmp.c b/fmdriver/fmdriver_fmp.c index 6cb401f..33ab925 100644 --- a/fmdriver/fmdriver_fmp.c +++ b/fmdriver/fmdriver_fmp.c @@ -3124,7 +3124,7 @@ static void fmp_title(struct fmdriver_work *work, STATE_ESC, STATE_CSI, STATE_SYNC, - } esc_state; + } esc_state = STATE_NORMAL; for (int si = 0; ; si++) { if ((offset + i) >= datalen) { work->comment[l][0] = 0; diff --git a/fmdsp/fmdsp.c b/fmdsp/fmdsp.c index bf29f56..1da0adf 100644 --- a/fmdsp/fmdsp.c +++ b/fmdsp/fmdsp.c @@ -129,7 +129,7 @@ void fmdsp_vram_init(struct fmdsp *fmdsp, } for (int t = 0; t < 10; t++) { struct fmdriver_track_status *track = &work->track_status[t]; - uint8_t *track_type; + const uint8_t *track_type; switch (track->type) { case FMDRIVER_TRACK_FM: track_type = s_t_fm; @@ -184,7 +184,7 @@ void fmdsp_vram_init(struct fmdsp *fmdsp, void fmdsp_update(struct fmdsp *fmdsp, const struct fmdriver_work *work, uint8_t *vram) { for (int t = 0; t < 10; t++) { - struct fmdriver_track_status *track = &work->track_status[t]; + const struct fmdriver_track_status *track = &work->track_status[t]; switch (track->info) { case FMDRIVER_TRACK_INFO_PPZ8: vramblit(vram, TINFO_X, TRACK_H*t+7, s_t_ppz8, TNAME_W, TNAME_H); diff --git a/win32/main.c b/win32/main.c index a7b5ba2..d4caf05 100644 --- a/win32/main.c +++ b/win32/main.c @@ -90,16 +90,16 @@ static HANDLE pvisearch(const wchar_t *filename, const char *pviname_a) { WPVINAMELEN = 8*2+1+3+1, }; wchar_t pviname[WPVINAMELEN]; - wchar_t pvipath[PATH_MAX]; + wchar_t pvipath[MAX_PATH]; if (MultiByteToWideChar(932, MB_ERR_INVALID_CHARS, pviname_a, -1, pviname, WPVINAMELEN) == 0) { return INVALID_HANDLE_VALUE; } lstrcat(pviname, L".PVI"); - if (lstrlen(filename) >= PATH_MAX) return INVALID_HANDLE_VALUE; + if (lstrlen(filename) >= MAX_PATH) return INVALID_HANDLE_VALUE; lstrcpy(pvipath, filename); PathRemoveFileSpec(pvipath); - if (lstrlen(pvipath) + lstrlen(pviname) + 1 >= PATH_MAX) { + if (lstrlen(pvipath) + lstrlen(pviname) + 1 >= MAX_PATH) { return INVALID_HANDLE_VALUE; } lstrcat(pvipath, L"\\"); @@ -552,7 +552,9 @@ int CALLBACK wWinMain(HINSTANCE hinst, HINSTANCE hpinst, ); ShowWindow(hwnd, cmdshow); - openfile(hwnd, argfile); + if (argfile) { + openfile(hwnd, argfile); + } MSG msg = {0}; while (GetMessage(&msg, 0, 0, 0)) { diff --git a/win32/x86/Makefile b/win32/x86/Makefile index e5aad93..8e16579 100644 --- a/win32/x86/Makefile +++ b/win32/x86/Makefile @@ -35,11 +35,17 @@ LIBS=-nostdlib -s -Wl,-e_entry@4 \ -lgdi32 -lshlwapi -lwinmm -lshell32 $(TARGET): $(OBJS) - $(CC) -o $@ $(OBJS) $(LIBS) - $(STRIP) $@ + @echo " CCLD $@" + @$(CC) -o $@ $(OBJS) $(LIBS) + @$(STRIP) $@ + +%.o: %.c + @echo " CC $@" + @$(CC) $(CFLAGS) -c $< -o $@ %.o: %.rc $(ICON) - $(WINDRES) -o $@ -i $< + @echo " WINDRES $@" + @$(WINDRES) -o $@ -i $< $(ICON): $(ICONFILES) convert $(ICONFILES) -colors 256 $@ -- cgit v1.2.3