diff options
Diffstat (limited to 'windows.c')
-rw-r--r-- | windows.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -21,7 +21,7 @@ const char *system_default_filename(void) /* I don't think this works on Windows */ user = getenv("USERNAME"); - if (! SUCCEEDED(SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, datapath))) { + if (!SUCCEEDED(SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, datapath))) { datapath[0] = '.'; datapath[1] = '\0'; } @@ -31,19 +31,19 @@ const char *system_default_filename(void) return buffer; } -int enumerate_devices (device_callback_t callback, void *userdata) +int enumerate_devices(device_callback_t callback, void *userdata) { // Open the registry key. HKEY hKey; int index = -1; - LONG rc = RegOpenKeyEx (HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM", 0, KEY_QUERY_VALUE, &hKey); + LONG rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM", 0, KEY_QUERY_VALUE, &hKey); if (rc != ERROR_SUCCESS) { return -1; } // Get the number of values. DWORD count = 0; - rc = RegQueryInfoKey (hKey, NULL, NULL, NULL, NULL, NULL, NULL, &count, NULL, NULL, NULL, NULL); + rc = RegQueryInfoKey(hKey, NULL, NULL, NULL, NULL, NULL, NULL, &count, NULL, NULL, NULL, NULL); if (rc != ERROR_SUCCESS) { RegCloseKey(hKey); return -1; @@ -52,10 +52,10 @@ int enumerate_devices (device_callback_t callback, void *userdata) for (i = 0; i < count; ++i) { // Get the value name, data and type. char name[512], data[512]; - DWORD name_len = sizeof (name); - DWORD data_len = sizeof (data); + 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 = RegEnumValue(hKey, i, name, &name_len, NULL, &type, (LPBYTE)data, &data_len); if (rc != ERROR_SUCCESS) { RegCloseKey(hKey); return -1; @@ -66,7 +66,7 @@ int enumerate_devices (device_callback_t callback, void *userdata) continue; // Prevent a possible buffer overflow. - if (data_len >= sizeof (data)) { + if (data_len >= sizeof(data)) { RegCloseKey(hKey); return -1; } @@ -74,7 +74,7 @@ int enumerate_devices (device_callback_t callback, void *userdata) // Null terminate the string. data[data_len] = 0; - callback (data, userdata); + callback(data, userdata); index++; if (is_default_dive_computer_device(name)) index = i; |