Browse Source

Fixes, fix some warnings

pull/44/head
Xadhoom 7 years ago
parent
commit
3feccdc989
  1. 2
      CMakeLists.txt
  2. 2
      SourceS/miniwin/misc.h
  3. 2
      SourceX/dx.cpp
  4. 5
      SourceX/miniwin/misc.cpp
  5. 4
      SourceX/miniwin/misc_io.cpp
  6. 2
      SourceX/miniwin/rand.cpp
  7. 26
      SourceX/storm/storm.cpp

2
CMakeLists.txt

@ -240,7 +240,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
target_compile_options(devilution PRIVATE -fno-aggressive-loop-optimizations)
endif()
# Warnings for devilutionX
target_compile_options(devilutionx PRIVATE -Wall -Wextra -Wno-multichar -Wno-unused-parameter)
target_compile_options(devilutionx PRIVATE -Wall -Wextra -Wno-write-strings -Wno-multichar -Wno-unused-parameter)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Style issues

2
SourceS/miniwin/misc.h

@ -199,7 +199,7 @@ struct DVL_finddata_t {
time_t time_access; /* -1 for FAT file systems */
time_t time_write;
_fsize_t size;
char name[260];
char name[DVL_MAX_PATH];
};
typedef WORD ATOM;

2
SourceX/dx.cpp

@ -384,7 +384,7 @@ void dx_init(HWND hWnd)
return;
}
MainWndProc(NULL, DVL_WM_ACTIVATEAPP, true, NULL);
MainWndProc(NULL, DVL_WM_ACTIVATEAPP, true, 0);
lpDDInterface = &stub_draw;
lpDDSPrimary = &stub_surface;

5
SourceX/miniwin/misc.cpp

@ -276,7 +276,7 @@ HWND FindWindowA(LPCSTR lpClassName, LPCSTR lpWindowName)
void FakeWMDestroy()
{
MainWndProc(NULL, DVL_WM_DESTROY, 0, NULL);
MainWndProc(NULL, DVL_WM_DESTROY, 0, 0);
}
HWND CreateWindowExA(
@ -641,6 +641,7 @@ DWORD GetPrivateProfileStringA(LPCSTR lpAppName, LPCSTR lpKeyName, LPCSTR lpDefa
strncpy(lpReturnedString, lpDefault, nSize);
SRegSaveString(lpAppName, lpKeyName, 0, lpReturnedString);
}
return 0; // dummy return value
}
int MessageBoxA(HWND hWnd, const char *Text, const char *Title, UINT Flags)
@ -706,7 +707,7 @@ LRESULT DefWindowProcA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
if (Msg == DVL_WM_QUERYENDSESSION)
exit(0);
return NULL;
return 0;
}
LONG GetWindowLongA(HWND hWnd, int nIndex)

4
SourceX/miniwin/misc_io.cpp

@ -90,11 +90,11 @@ DWORD SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveH
file->pos = lDistanceToMove;
} else if (dwMoveMethod == DVL_FILE_CURRENT) {
file->pos += lDistanceToMove;
if(file->buf.size() < file->pos + 1)
file->buf.resize(file->pos + 1);
} else {
UNIMPLEMENTED();
}
if(file->buf.size() < file->pos + 1)
file->buf.resize(file->pos + 1);
return file->pos;
}

2
SourceX/miniwin/rand.cpp

@ -1,4 +1,4 @@
#include <stdint.h>
#include <cstdint>
#include "devilution.h"

26
SourceX/storm/storm.cpp

@ -13,6 +13,19 @@ namespace dvl {
DWORD nLastError = 0;
static std::string getIniPath()
{
char path[DVL_MAX_PATH];
int len = GetModuleFileNameA(ghInst, path, DVL_MAX_PATH);
path[len - 1] = '/';
strcat(path, "diablo.ini");
return path;
}
static radon::File ini(getIniPath());
static Mix_Chunk *SFileChunk;
void TranslateFileName(char *dst, int dstLen, const char *src)
{
for (int i = 0; i < dstLen; i++) {
@ -24,18 +37,6 @@ void TranslateFileName(char *dst, int dstLen, const char *src)
}
}
std::string getIniPath()
{
char path[280];
int len = GetModuleFileNameA(ghInst, path, 260);
path[len - 1] = '/';
strcat(path, "diablo.ini");
return path;
}
radon::File ini(getIniPath());
// BOOL SFileCloseArchive(HANDLE hArchive)
// {
// UNIMPLEMENTED();
@ -46,7 +47,6 @@ radon::File ini(getIniPath());
// UNIMPLEMENTED();
// }
Mix_Chunk *SFileChunk;
BOOL SFileDdaBeginEx(HANDLE hFile, DWORD flags, DWORD mask, unsigned __int32 lDistanceToMove,
signed __int32 volume, signed int pan, int a7)
{

Loading…
Cancel
Save