summaryrefslogtreecommitdiffstats
path: root/windows.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-27 20:09:57 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-27 20:09:57 -0800
commit76e6420f6b3503b76bd3eec00ab0e53d6ea17a20 (patch)
tree8b50298f41bd29d55bbd6f4301f36ad31dc0b008 /windows.c
parent006265d7a088cff4fea665159dbb454956c2cd76 (diff)
downloadsubsurface-76e6420f6b3503b76bd3eec00ab0e53d6ea17a20.tar.gz
Massive automated whitespace cleanup
I know everyone will hate it. Go ahead. Complain. Call me names. At least now things are consistent and reproducible. If you want changes, have your complaint come with a patch to scripts/whitespace.pl so that we can automate it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'windows.c')
-rw-r--r--windows.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/windows.c b/windows.c
index 042e1c619..7e3c50742 100644
--- a/windows.c
+++ b/windows.c
@@ -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;