shithub: cstory

Download patch

ref: 8114f88dd1f27674e2a43527c943ae7e8e0cb1e7
parent: b6fccd509dbb8e261760876f954c87b102cb5c2f
author: Clownacy <Clownacy@users.noreply.github.com>
date: Fri Sep 6 11:21:43 EDT 2019

Shut up some build warnings

--- a/src/Dialog.cpp
+++ b/src/Dialog.cpp
@@ -19,6 +19,8 @@
 // TODO - Inaccurate stack frame
 INT_PTR __stdcall VersionDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 {
+	(void)lParam;
+
 	char string_buffer[104];
 
 	int year;
@@ -58,6 +60,8 @@
 
 INT_PTR __stdcall DebugMuteDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 {
+	(void)lParam;
+
 	switch (Msg)
 	{
 		case WM_INITDIALOG:
@@ -100,6 +104,8 @@
 
 INT_PTR __stdcall DebugSaveDialog(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 {
+	(void)lParam;
+
 	char string[100];
 
 	switch (Msg)
--- a/src/Generic.cpp
+++ b/src/Generic.cpp
@@ -27,7 +27,7 @@
 	months[10] = "Oct";
 	months[11] = "Nov";
 	months[12] = "Dec";
-	sscanf(__DATE__, "%s %d %d", &month_string, day, year);
+	sscanf(__DATE__, "%s %d %d", month_string, day, year);
 
 	for (i = 0; i < 12; ++i)	// This being 12 instead of 13 might be a bug, but it works anyway by accident
 		if (!memcmp(&month_string, months[i], 3))
--- a/src/Input.cpp
+++ b/src/Input.cpp
@@ -137,7 +137,11 @@
 	directinput_objects->device = _joystick;
 
 	char string[0x100];
-	sprintf(string, "DeviceGUID = %x\n", lpddi->guidInstance);
+#ifdef FIX_BUGS
+	sprintf(string, "DeviceGUID = %lx\n", lpddi->guidInstance.Data1);
+#else
+	sprintf(string, "DeviceGUID = %x\n", (unsigned int)lpddi->guidInstance.Data1);
+#endif
 	OutputDebugStringA(string);
 
 	return FALSE;
--- a/src/Main.cpp
+++ b/src/Main.cpp
@@ -98,6 +98,10 @@
 
 int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
 {
+	(void)hPrevInstance;
+	(void)lpCmdLine;
+	(void)nShowCmd;
+
 	int i;
 
 	hObject = OpenMutexA(MUTEX_ALL_ACCESS, 0, mutex_name);
--- a/src/Organya.cpp
+++ b/src/Organya.cpp
@@ -753,7 +753,8 @@
 
 BOOL InitMMTimer();
 BOOL StartTimer(DWORD dwTimer);
-VOID CALLBACK TimerProc(UINT uTID,UINT uMsg,DWORD dwUser,DWORD dwParam1,DWORD dwParam2);
+//VOID CALLBACK TimerProc(UINT uTID,UINT uMsg,DWORD dwUser,DWORD dwParam1,DWORD dwParam2);	// The original code used the wrong types
+VOID CALLBACK TimerProc(UINT uTID,UINT uMsg,DWORD_PTR dwUser,DWORD_PTR dwParam1,DWORD_PTR dwParam2);
 BOOL QuitMMTimer();
 
 /*■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/
@@ -802,7 +803,7 @@
 	(
 		dwTimer,                   // タイマー時間 (Timer time)
 		10,                        // 許容できるタイマー精度 (Acceptable timer accuracy)
-		(LPTIMECALLBACK)TimerProc, // コールバックプロシージャ (Callback procedure)
+		TimerProc,                 // コールバックプロシージャ (Callback procedure)
 		0,                         // ユーザーがコールバック関数のdwUserに送る情報値 (Information value sent by user to dwUser in callback function)
 		TIME_PERIODIC              // タイマー時間毎にイベントを発生させる (Generate an event every timer time)
 	);
@@ -818,8 +819,15 @@
 /*■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/
 // タイマーのコールバック関数 (Timer callback function)
 /*■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/
-VOID CALLBACK TimerProc(UINT uTID,UINT uMsg,DWORD dwUser,DWORD dwParam1,DWORD dwParam2)
+//VOID CALLBACK TimerProc(UINT uTID,UINT uMsg,DWORD dwUser,DWORD dwParam1,DWORD dwParam2)	// The original code used the wrong types
+VOID CALLBACK TimerProc(UINT uTID,UINT uMsg,DWORD_PTR dwUser,DWORD_PTR dwParam1,DWORD_PTR dwParam2)
 {
+	(void)uTID;
+	(void)uMsg;
+	(void)dwUser;
+	(void)dwParam1;
+	(void)dwParam2;
+
 	DWORD dwNowTime;
 	dwNowTime = timeGetTime();
 	//===================================================================================