From 7b9bd1880c5eacbf33b55b94463c58b26cfc1544 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Tue, 24 Sep 2013 21:30:07 +0200 Subject: [PATCH 1/3] Add explicit casts for the msvc C++ compiler. --- src/ihex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ihex.c b/src/ihex.c index 5389696..559e4b4 100644 --- a/src/ihex.c +++ b/src/ihex.c @@ -44,7 +44,7 @@ dc_ihex_file_open (dc_ihex_file_t **result, dc_context_t *context, const char *f return DC_STATUS_INVALIDARGS; } - file = malloc (sizeof (dc_ihex_file_t)); + file = (dc_ihex_file_t *) malloc (sizeof (dc_ihex_file_t)); if (file == NULL) { ERROR (context, "Failed to allocate memory."); return DC_STATUS_NOMEMORY; From 3f9f722219a5011355e9fcafbe0732751ae2a57a Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Tue, 24 Sep 2013 21:38:10 +0200 Subject: [PATCH 2/3] Always use the ANSI variant of the Windows functions. --- src/serial_win32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/serial_win32.c b/src/serial_win32.c index cef0704..31b7368 100644 --- a/src/serial_win32.c +++ b/src/serial_win32.c @@ -52,7 +52,7 @@ serial_enumerate (serial_callback_t callback, void *userdata) { // Open the registry key. HKEY hKey; - LONG rc = RegOpenKeyEx (HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM", 0, KEY_QUERY_VALUE, &hKey); + LONG rc = RegOpenKeyExA (HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM", 0, KEY_QUERY_VALUE, &hKey); if (rc != ERROR_SUCCESS) { if (rc == ERROR_FILE_NOT_FOUND) return 0; @@ -74,7 +74,7 @@ serial_enumerate (serial_callback_t callback, void *userdata) DWORD name_len = sizeof (name); DWORD data_len = sizeof (data); DWORD type = 0; - rc = RegEnumValue (hKey, i, name, &name_len, NULL, &type, (LPBYTE) data, &data_len); + rc = RegEnumValueA (hKey, i, name, &name_len, NULL, &type, (LPBYTE) data, &data_len); if (rc != ERROR_SUCCESS) { RegCloseKey(hKey); return -1; From 13db9dc8c064ee5bba35dda1fccb6f840b3b19a4 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Tue, 24 Sep 2013 21:41:03 +0200 Subject: [PATCH 3/3] Update the msvc project file. --- msvc/libdivecomputer.vcproj | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/msvc/libdivecomputer.vcproj b/msvc/libdivecomputer.vcproj index 0505056..95b9b84 100644 --- a/msvc/libdivecomputer.vcproj +++ b/msvc/libdivecomputer.vcproj @@ -246,6 +246,10 @@ RelativePath="..\src\hw_ostc_parser.c" > + + @@ -422,6 +426,10 @@ RelativePath="..\src\uwatec_memomouse_parser.c" > + + @@ -516,6 +524,10 @@ RelativePath="..\include\libdivecomputer\hw_ostc3.h" > + + @@ -664,6 +676,10 @@ RelativePath="..\include\libdivecomputer\uwatec_memomouse.h" > + +