summaryrefslogtreecommitdiffstats
path: root/windows.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2011-11-24 22:32:10 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2011-11-24 22:34:39 -0800
commit042c77c0fc6969d2d969fb68f1db51d33364d034 (patch)
tree61e61ce37755029d5f370aadb2d4a7b2e05324a4 /windows.c
parent290ce56d0181c0c7e7d6e1af3eb27d3015cffca7 (diff)
downloadsubsurface-042c77c0fc6969d2d969fb68f1db51d33364d034.tar.gz
Improve cross compile support and fix windows.c
This should make the Makefile much more robust when cross compiling. The windows.c code is now compile tested but not functionally tested. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'windows.c')
-rw-r--r--windows.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/windows.c b/windows.c
index df04aa0f2..91323ebe8 100644
--- a/windows.c
+++ b/windows.c
@@ -38,7 +38,7 @@ void subsurface_set_conf(char *name, pref_type_t type, const void *value)
switch (type) {
case PREF_BOOL:
/* we simply store the value as DWORD */
- RegSetValueEx(hkey, TEXT(name), 0, REG_DWORD, (DWORD)value, 4);
+ RegSetValueEx(hkey, TEXT(name), 0, REG_DWORD, value, 4);
break;
case PREF_STRING:
RegSetValueEx(hkey, TEXT(name), 0, REG_SZ, value, strlen(value));
@@ -47,6 +47,7 @@ void subsurface_set_conf(char *name, pref_type_t type, const void *value)
const void *subsurface_get_conf(char *name, pref_type_t type)
{
+ LONG success;
char *string;
int len;
@@ -57,7 +58,7 @@ const void *subsurface_get_conf(char *name, pref_type_t type)
string = malloc(80);
len = 80;
success = RegQueryValueEx(hkey, TEXT(name), NULL, NULL,
- (LPBYTE) string, &len );
+ (LPBYTE) string, (LPDWORD)&len );
if (success != ERROR_SUCCESS) {
/* that's what happens the first time we start - just return NULL */
free(string);
@@ -72,6 +73,6 @@ const void *subsurface_get_conf(char *name, pref_type_t type)
void subsurface_close_conf(void)
{
if (RegFlushKey(hkey) != ERROR_SUCCESS)
- printf("RegFlushKey failed %ld\n");
+ printf("RegFlushKey failed \n");
RegCloseKey(hkey);
}