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>
This commit is contained in:
Dirk Hohndel 2014-02-27 20:09:57 -08:00
parent 006265d7a0
commit 76e6420f6b
114 changed files with 4370 additions and 3717 deletions

View file

@ -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;