shlwapi: Cleanup indentations

James Hawkins truiken at gmail.com
Thu Apr 28 22:10:22 CDT 2005


Hi,

shreg.c had about 3 different styles of indenting and it was very
obvious when editing.  I peronally prefer 4 spaces, but the most
frequent indentation was one tab, so I changed all the indentions to
tabs.  If this is not preferred, let me know, but it is difficult to
work on the file when the lines are all in different places.

Changelog
* Cleanup indentations.

-- 
James Hawkins
-------------- next part --------------
Index: dlls/shlwapi/tests/shreg.c
===================================================================
RCS file: /home/wine/wine/dlls/shlwapi/tests/shreg.c,v
retrieving revision 1.26
diff -u -p -r1.26 shreg.c
--- dlls/shlwapi/tests/shreg.c	22 Mar 2005 18:19:42 -0000	1.26
+++ dlls/shlwapi/tests/shreg.c	29 Apr 2005 02:05:14 -0000
@@ -31,7 +31,7 @@
 #include "shlwapi.h"
 
 /* Keys used for testing */
-#define REG_TEST_KEY        "Software\\Wine\\Test"
+#define REG_TEST_KEY"Software\\Wine\\Test"
 #define REG_CURRENT_VERSION "Software\\Microsoft\\Windows\\CurrentVersion"
 
 static HMODULE hshlwapi;
@@ -56,62 +56,62 @@ static const char * sEmptyBuffer ="01234
 /* delete key and all its subkeys */
 static DWORD delete_key( HKEY hkey, LPSTR parent, LPSTR keyname )
 {
-    HKEY parentKey;
-    DWORD ret;
+	HKEY parentKey;
+	DWORD ret;
 
-    RegCloseKey(hkey);
+	RegCloseKey(hkey);
 
-    /* open the parent of the key to close */
-    ret = RegOpenKeyExA( HKEY_CURRENT_USER, parent, 0, KEY_ALL_ACCESS, &parentKey);
-    if (ret != ERROR_SUCCESS)
-        return ret;
+	/* open the parent of the key to close */
+	ret = RegOpenKeyExA( HKEY_CURRENT_USER, parent, 0, KEY_ALL_ACCESS, &parentKey);
+	if (ret != ERROR_SUCCESS)
+		return ret;
 
-    ret = SHDeleteKeyA( parentKey, keyname );
-    RegCloseKey(parentKey);
+	ret = SHDeleteKeyA( parentKey, keyname );
+	RegCloseKey(parentKey);
 
-    return ret;
+	return ret;
 }
 
 static HKEY create_test_entries(void)
 {
 	HKEY hKey;
-        DWORD ret;
+	DWORD ret;
 
-        SetEnvironmentVariableA("LONGSYSTEMVAR", sEnvvar1);
-        SetEnvironmentVariableA("FOO", sEnvvar2);
+	SetEnvironmentVariableA("LONGSYSTEMVAR", sEnvvar1);
+	SetEnvironmentVariableA("FOO", sEnvvar2);
 
-        ret = RegCreateKeyA(HKEY_CURRENT_USER, REG_TEST_KEY, &hKey);
+	ret = RegCreateKeyA(HKEY_CURRENT_USER, REG_TEST_KEY, &hKey);
 	ok( ERROR_SUCCESS == ret, "RegCreateKeyA failed, ret=%lu\n", ret);
 
 	if (hKey)
 	{
-           ok(!RegSetValueExA(hKey,"Test1",0,REG_EXPAND_SZ, sTestpath1, strlen(sTestpath1)+1), "RegSetValueExA failed\n");
-           ok(!RegSetValueExA(hKey,"Test2",0,REG_SZ, sTestpath1, strlen(sTestpath1)+1), "RegSetValueExA failed\n");
-           ok(!RegSetValueExA(hKey,"Test3",0,REG_EXPAND_SZ, sTestpath2, strlen(sTestpath2)+1), "RegSetValueExA failed\n");
+		ok(!RegSetValueExA(hKey,"Test1",0,REG_EXPAND_SZ, sTestpath1, strlen(sTestpath1)+1), "RegSetValueExA failed\n");
+		ok(!RegSetValueExA(hKey,"Test2",0,REG_SZ, sTestpath1, strlen(sTestpath1)+1), "RegSetValueExA failed\n");
+		ok(!RegSetValueExA(hKey,"Test3",0,REG_EXPAND_SZ, sTestpath2, strlen(sTestpath2)+1), "RegSetValueExA failed\n");
 	}
 
 	sExpLen1 = ExpandEnvironmentStringsA(sTestpath1, sExpTestpath1, sizeof(sExpTestpath1));
 	sExpLen2 = ExpandEnvironmentStringsA(sTestpath2, sExpTestpath2, sizeof(sExpTestpath2));
 
-        ok(sExpLen1 > 0, "Couldn't expand %s\n", sTestpath1);
-        trace("sExplen1 = (%d)\n", sExpLen1);
-        ok(sExpLen2 > 0, "Couldn't expand %s\n", sTestpath2);
-        trace("sExplen2 = (%d)\n", sExpLen2);
+	ok(sExpLen1 > 0, "Couldn't expand %s\n", sTestpath1);
+	trace("sExplen1 = (%d)\n", sExpLen1);
+	ok(sExpLen2 > 0, "Couldn't expand %s\n", sTestpath2);
+	trace("sExplen2 = (%d)\n", sExpLen2);
 
-        return hKey;
+	return hKey;
 }
 
 static void test_SHGetValue(void)
 {
 	DWORD dwSize;
 	DWORD dwType;
-        DWORD dwRet;
+	DWORD dwRet;
 	char buf[MAX_PATH];
 
 	strcpy(buf, sEmptyBuffer);
 	dwSize = MAX_PATH;
 	dwType = -1;
-        dwRet = SHGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", &dwType, buf, &dwSize);
+	dwRet = SHGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", &dwType, buf, &dwSize);
 	ok( ERROR_SUCCESS == dwRet, "SHGetValueA failed, ret=%lu\n", dwRet);
 	ok( 0 == strcmp(sExpTestpath1, buf), "Comparing of (%s) with (%s) failed\n", buf, sExpTestpath1);
 	ok( REG_SZ == dwType, "Expected REG_SZ, got (%lu)\n", dwType);
@@ -119,7 +119,7 @@ static void test_SHGetValue(void)
 	strcpy(buf, sEmptyBuffer);
 	dwSize = MAX_PATH;
 	dwType = -1;
-        dwRet = SHGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test2", &dwType, buf, &dwSize);
+	dwRet = SHGetValueA(HKEY_CURRENT_USER, REG_TEST_KEY, "Test2", &dwType, buf, &dwSize);
 	ok( ERROR_SUCCESS == dwRet, "SHGetValueA failed, ret=%lu\n", dwRet);
 	ok( 0 == strcmp(sTestpath1, buf) , "Comparing of (%s) with (%s) failed\n", buf, sTestpath1);
 	ok( REG_SZ == dwType , "Expected REG_SZ, got (%lu)\n", dwType);
@@ -128,13 +128,13 @@ static void test_SHGetValue(void)
 static void test_SHGetRegPath(void)
 {
 	char buf[MAX_PATH];
-        DWORD dwRet;
+	DWORD dwRet;
 
 	if (!pSHRegGetPathA)
 		return;
 
 	strcpy(buf, sEmptyBuffer);
-        dwRet = (*pSHRegGetPathA)(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", buf, 0);
+	dwRet = (*pSHRegGetPathA)(HKEY_CURRENT_USER, REG_TEST_KEY, "Test1", buf, 0);
 	ok( ERROR_SUCCESS == dwRet, "SHRegGetPathA failed, ret=%lu\n", dwRet);
 	ok( 0 == strcmp(sExpTestpath1, buf) , "Comparing (%s) with (%s) failed\n", buf, sExpTestpath1);
 }
@@ -149,8 +149,8 @@ static void test_SHQUeryValueEx(void)
 	const char * sTestedFunction = "";
 	DWORD nUsedBuffer1,nUsedBuffer2;
 
-        sTestedFunction = "RegOpenKeyExA";
-        dwRet = RegOpenKeyExA(HKEY_CURRENT_USER, REG_TEST_KEY, 0,  KEY_QUERY_VALUE, &hKey);
+	sTestedFunction = "RegOpenKeyExA";
+	dwRet = RegOpenKeyExA(HKEY_CURRENT_USER, REG_TEST_KEY, 0,  KEY_QUERY_VALUE, &hKey);
 	ok( ERROR_SUCCESS == dwRet, "%s failed, ret=%lu\n", sTestedFunction, dwRet);
 
 	/****** SHQueryValueExA ******/
@@ -161,31 +161,31 @@ static void test_SHQUeryValueEx(void)
 	/*
 	 * Case 1.1 All arguments are NULL
 	 */
-        dwRet = SHQueryValueExA( hKey, "Test1", NULL, NULL, NULL, NULL);
+	dwRet = SHQueryValueExA( hKey, "Test1", NULL, NULL, NULL, NULL);
 	ok( ERROR_SUCCESS == dwRet, "%s failed, ret=%lu\n", sTestedFunction, dwRet);
 
 	/*
 	 * Case 1.2 dwType is set
 	 */
 	dwType = -1;
-        dwRet = SHQueryValueExA( hKey, "Test1", NULL, &dwType, NULL, NULL);
+	dwRet = SHQueryValueExA( hKey, "Test1", NULL, &dwType, NULL, NULL);
 	ok( ERROR_SUCCESS == dwRet, "%s failed, ret=%lu\n", sTestedFunction, dwRet);
 	ok( REG_SZ == dwType , "Expected REG_SZ, got (%lu)\n", dwType);
 
 	/*
 	 * dwSize is set
-         * dwExpanded < dwUnExpanded
+ * dwExpanded < dwUnExpanded
 	 */
 	dwSize = 6;
-        dwRet = SHQueryValueExA( hKey, "Test1", NULL, NULL, NULL, &dwSize);
+	dwRet = SHQueryValueExA( hKey, "Test1", NULL, NULL, NULL, &dwSize);
 	ok( ERROR_SUCCESS == dwRet, "%s failed, ret=%lu\n", sTestedFunction, dwRet);
 	ok( dwSize == nUsedBuffer1, "Buffer sizes (%lu) and (%lu) are not equal\n", dwSize, nUsedBuffer1);
 
 	/*
-         * dwExpanded > dwUnExpanded
+ * dwExpanded > dwUnExpanded
 	 */
 	dwSize = 6;
-        dwRet = SHQueryValueExA( hKey, "Test3", NULL, NULL, NULL, &dwSize);
+	dwRet = SHQueryValueExA( hKey, "Test3", NULL, NULL, NULL, &dwSize);
 	ok( ERROR_SUCCESS == dwRet, "%s failed, ret=%lu\n", sTestedFunction, dwRet);
 	ok( dwSize >= nUsedBuffer2, "Buffer size (%lu) should be >= (%lu)\n", dwSize, nUsedBuffer2);
 
@@ -203,7 +203,7 @@ static void test_SHQUeryValueEx(void)
 
 	/*
 	 * string grows during expanding
-         * dwSize is smaller then the size of the unexpanded string
+	 * dwSize is smaller then the size of the unexpanded string
 	 */
 	strcpy(buf, sEmptyBuffer);
 	dwSize = 6;
@@ -214,42 +214,42 @@ static void test_SHQUeryValueEx(void)
 	ok( dwSize >= nUsedBuffer2, "Buffer size (%lu) should be >= (%lu)\n", dwSize, nUsedBuffer2);
 	ok( REG_SZ == dwType , "Expected REG_SZ, got (%lu)\n", dwType);
 
-        /*
-         * string grows during expanding
-         * dwSize is larger then the size of the unexpanded string but smaller than the part before the backslash
-         * if the unexpanded string fits into the buffer it can get cut when expanded
-         */
-        strcpy(buf, sEmptyBuffer);
-        dwSize = strlen(sEnvvar2) - 2;
-        dwType = -1;
-        dwRet = SHQueryValueExA( hKey, "Test3", NULL, &dwType, buf, &dwSize);
-        ok( ERROR_MORE_DATA == dwRet, "Expected ERROR_MORE_DATA, got (%lu)\n", dwRet);
-
-        todo_wine
-        {
-                ok( (0 == strcmp("", buf)) | (0 == strcmp(sTestpath2, buf)),
-                    "Expected empty or unexpanded string (win98), got (%s)\n", buf); 
-        }
+	/*
+	* string grows during expanding
+	* dwSize is larger then the size of the unexpanded string but smaller than the part before the backslash
+	* if the unexpanded string fits into the buffer it can get cut when expanded
+	*/
+	strcpy(buf, sEmptyBuffer);
+	dwSize = strlen(sEnvvar2) - 2;
+	dwType = -1;
+	dwRet = SHQueryValueExA( hKey, "Test3", NULL, &dwType, buf, &dwSize);
+	ok( ERROR_MORE_DATA == dwRet, "Expected ERROR_MORE_DATA, got (%lu)\n", dwRet);
 
-        ok( dwSize >= nUsedBuffer2, "Buffer size (%lu) should be >= (%lu)\n", dwSize, nUsedBuffer2);
-        ok( REG_SZ == dwType , "Expected REG_SZ, got (%lu)\n", dwType);
+	todo_wine
+	{
+		ok( (0 == strcmp("", buf)) | (0 == strcmp(sTestpath2, buf)),
+			"Expected empty or unexpanded string (win98), got (%s)\n", buf); 
+	}
+
+	ok( dwSize >= nUsedBuffer2, "Buffer size (%lu) should be >= (%lu)\n", dwSize, nUsedBuffer2);
+	ok( REG_SZ == dwType , "Expected REG_SZ, got (%lu)\n", dwType);
 
 	/*
-         * string grows during expanding
-         * dwSize is larger then the size of the part before the backslash but smaller then the expanded string
+	 * string grows during expanding
+	 * dwSize is larger then the size of the part before the backslash but smaller then the expanded string
 	 * if the unexpanded string fits into the buffer it can get cut when expanded
 	 */
 	strcpy(buf, sEmptyBuffer);
 	dwSize = sExpLen2 - 4;
 	dwType = -1;
-        dwRet = SHQueryValueExA( hKey, "Test3", NULL, &dwType, buf, &dwSize);
+	dwRet = SHQueryValueExA( hKey, "Test3", NULL, &dwType, buf, &dwSize);
 	ok( ERROR_MORE_DATA == dwRet, "Expected ERROR_MORE_DATA, got (%lu)\n", dwRet);
 
-        todo_wine
-        {
-                ok( (0 == strcmp("", buf)) | (0 == strcmp(sEnvvar2, buf)),
-                    "Expected empty or first part of the string \"%s\", got \"%s\"\n", sEnvvar2, buf);
-        }
+	todo_wine
+	{
+		ok( (0 == strcmp("", buf)) | (0 == strcmp(sEnvvar2, buf)),
+			"Expected empty or first part of the string \"%s\", got \"%s\"\n", sEnvvar2, buf);
+	}
 
 	ok( dwSize >= nUsedBuffer2, "Buffer size (%lu) should be >= (%lu)\n", dwSize, nUsedBuffer2);
 	ok( REG_SZ == dwType , "Expected REG_SZ, got (%lu)\n", dwType);
@@ -271,7 +271,7 @@ static void test_SHQUeryValueEx(void)
 static void test_SHCopyKey(void)
 {
 	HKEY hKeySrc, hKeyDst;
-        DWORD dwRet;
+	DWORD dwRet;
 
 	/* Delete existing destination sub keys */
 	hKeyDst = NULL;
@@ -282,37 +282,37 @@ static void test_SHCopyKey(void)
 	}
 
 	hKeyDst = NULL;
-        dwRet = RegCreateKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination", &hKeyDst);
-        if (dwRet || !hKeyDst)
+	dwRet = RegCreateKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination", &hKeyDst);
+	if (dwRet || !hKeyDst)
 	{
-                ok( 0, "Destination couldn't be created, RegCreateKeyA returned (%lu)\n", dwRet);
+		ok( 0, "Destination couldn't be created, RegCreateKeyA returned (%lu)\n", dwRet);
 		return;
 	}
 
 	hKeySrc = NULL;
-        dwRet = RegOpenKeyA(HKEY_LOCAL_MACHINE, REG_CURRENT_VERSION, &hKeySrc);
-        if (dwRet || !hKeySrc)
+	dwRet = RegOpenKeyA(HKEY_LOCAL_MACHINE, REG_CURRENT_VERSION, &hKeySrc);
+	if (dwRet || !hKeySrc)
 	{
-                ok( 0, "Source couldn't be opened, RegOpenKeyA returned (%lu)\n", dwRet);
+		ok( 0, "Source couldn't be opened, RegOpenKeyA returned (%lu)\n", dwRet);
 		return;
 	}
 
 
 	if (pSHCopyKeyA)
-        {
-                dwRet = (*pSHCopyKeyA)(hKeySrc, NULL, hKeyDst, 0);
-                ok ( ERROR_SUCCESS == dwRet, "Copy failed, ret=(%lu)\n", dwRet);
-        }
+	{
+		dwRet = (*pSHCopyKeyA)(hKeySrc, NULL, hKeyDst, 0);
+		ok ( ERROR_SUCCESS == dwRet, "Copy failed, ret=(%lu)\n", dwRet);
+	}
 
 	RegCloseKey(hKeySrc);
 	RegCloseKey(hKeyDst);
 
-        /* Check we copied the sub keys, i.e. something that's on every windows system (including Wine) */
+	/* Check we copied the sub keys, i.e. something that's on every windows system (including Wine) */
 	hKeyDst = NULL;
-        dwRet = RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination\\Setup", &hKeyDst);
-        if (dwRet || !hKeyDst)
+	dwRet = RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination\\Setup", &hKeyDst);
+	if (dwRet || !hKeyDst)
 	{
-                ok ( 0, "Copy couldn't be opened, RegOpenKeyA returned (%lu)\n", dwRet);
+		ok ( 0, "Copy couldn't be opened, RegOpenKeyA returned (%lu)\n", dwRet);
 		return;
 	}
 
@@ -324,52 +324,52 @@ static void test_SHCopyKey(void)
 
 static void test_SHDeleteKey()
 {
-    HKEY hKeyTest, hKeyS;
-    DWORD dwRet;
-    int sysfail = 1;
-
-    if (!RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY, &hKeyTest))
-    {
-        if (!RegCreateKey(hKeyTest, "ODBC", &hKeyS))
-        {
-            HKEY hKeyO;
-
-            if (!RegCreateKey(hKeyS, "ODBC.INI", &hKeyO))
-            {
-                RegCloseKey (hKeyO);
-
-                if (!RegCreateKey(hKeyS, "ODBCINST.INI", &hKeyO))
-                {
-                    RegCloseKey (hKeyO);
-                    sysfail = 0;
-                }
-            }
-            RegCloseKey (hKeyS);
-        }
-        RegCloseKey (hKeyTest);
-    }
-
-    if (!sysfail)
-    {
-
-        dwRet = SHDeleteKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\ODBC");
-        ok ( ERROR_SUCCESS == dwRet, "SHDeleteKey failed, ret=(%lu)\n", dwRet);
-
-        dwRet = RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\ODBC", &hKeyS);
-        ok ( ERROR_FILE_NOT_FOUND == dwRet, "SHDeleteKey did not delete\n");
-
-        if (dwRet == ERROR_SUCCESS)
-            RegCloseKey (hKeyS);
-    }
-    else
-        ok( 0, "Could not set up SHDeleteKey test\n");
+	HKEY hKeyTest, hKeyS;
+	DWORD dwRet;
+	int sysfail = 1;
+
+	if (!RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY, &hKeyTest))
+	{
+		if (!RegCreateKey(hKeyTest, "ODBC", &hKeyS))
+		{
+			HKEY hKeyO;
+
+			if (!RegCreateKey(hKeyS, "ODBC.INI", &hKeyO))
+			{
+				RegCloseKey (hKeyO);
+
+				if (!RegCreateKey(hKeyS, "ODBCINST.INI", &hKeyO))
+				{
+					RegCloseKey (hKeyO);
+					sysfail = 0;
+				}
+			}
+			RegCloseKey (hKeyS);
+		}
+		RegCloseKey (hKeyTest);
+	}
+
+	if (!sysfail)
+	{
+
+		dwRet = SHDeleteKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\ODBC");
+		ok ( ERROR_SUCCESS == dwRet, "SHDeleteKey failed, ret=(%lu)\n", dwRet);
+
+		dwRet = RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\ODBC", &hKeyS);
+		ok ( ERROR_FILE_NOT_FOUND == dwRet, "SHDeleteKey did not delete\n");
+
+		if (dwRet == ERROR_SUCCESS)
+			RegCloseKey (hKeyS);
+	}
+	else
+		ok( 0, "Could not set up SHDeleteKey test\n");
 }
 
 START_TEST(shreg)
 {
 	HKEY hkey = create_test_entries();
 
-        if (!hkey) return;
+	if (!hkey) return;
 
 	hshlwapi = GetModuleHandleA("shlwapi.dll");
 	if (hshlwapi)
@@ -381,6 +381,6 @@ START_TEST(shreg)
 	test_SHQUeryValueEx();
 	test_SHGetRegPath();
 	test_SHCopyKey();
-        test_SHDeleteKey();
-        delete_key( hkey, "Software\\Wine", "Test" );
+	test_SHDeleteKey();
+	delete_key( hkey, "Software\\Wine", "Test" );
 }


More information about the wine-patches mailing list