On 4/24/07, Tom Spear speeddymon@gmail.com wrote:
This patch makes the wine uninstaller check HKCU for uninstall entries in addition to HKLM.
+const int numrootkeys = 2; +static const DWORD maxSubkeyNameLen = 255;
const variables should be all uppercase to differentiate them from non-const variables. One of the const variables is static and the other not, what gives?
@@ -148,7 +149,6 @@ WINE_ERR( "The remove option requires a parameter.\n"); return 1; } - RemoveSpecificProgram( argv[i++] );
Don't make random whitespace changes.
+ for (x=0; x<sizeof(hkeyroot[0]); ++x) + {
sizeof(hkeyroot[0]) = 4, which means you're going to index hkeyroot two indexes out of bounds. I think you're looking for sizeof(hkeyroot) / sizeof(hkeyroot[0]).
+ WINE_TRACE("allocated entry #%d: %s (%s), %s\n", + numentries, wine_dbgstr_w(entries[numentries-1].key), wine_dbgstr_w(entries[numentries-1].descr), wine_dbgstr_w(entries[numentries-1].command));
You mixed tabs and spaces, and that line is too long.
On 4/24/07, James Hawkins truiken@gmail.com wrote:
On 4/24/07, Tom Spear speeddymon@gmail.com wrote:
This patch makes the wine uninstaller check HKCU for uninstall entries in addition to HKLM.
+const int numrootkeys = 2; +static const DWORD maxSubkeyNameLen = 255;
const variables should be all uppercase to differentiate them from non-const variables. One of the const variables is static and the other not, what gives?
Fixed the names to all caps, and removed numrootkeys as it was not used anyways.
@@ -148,7 +149,6 @@ WINE_ERR( "The remove option requires a parameter.\n"); return 1; }
RemoveSpecificProgram( argv[i++] );
Don't make random whitespace changes.
Undid the random whitespace change. Any others?
- for (x=0; x<sizeof(hkeyroot[0]); ++x)
- {
sizeof(hkeyroot[0]) = 4, which means you're going to index hkeyroot two indexes out of bounds. I think you're looking for sizeof(hkeyroot) / sizeof(hkeyroot[0]).
Fixed
WINE_TRACE("allocated entry #%d: %s (%s), %s\n",
numentries, wine_dbgstr_w(entries[numentries-1].key),
wine_dbgstr_w(entries[numentries-1].descr), wine_dbgstr_w(entries[numentries-1].command));
You mixed tabs and spaces, and that line is too long.
Who originally wrote this damn code and how did it get by you in the first place? If it's too long, please give more info on how I can make it shorter, while still getting the same output. Especially since I didnt write that line.
Tab was due to vim, and has been fixed.
New patch attached.
-- James Hawkins
Tom Spear schrieb:
On 4/24/07, James Hawkins truiken@gmail.com wrote:
On 4/24/07, Tom Spear speeddymon@gmail.com wrote:
This patch makes the wine uninstaller check HKCU for uninstall entries in addition to HKLM.
+const int numrootkeys = 2; +static const DWORD maxSubkeyNameLen = 255;
const variables should be all uppercase to differentiate them from non-const variables.
Imo it's more common to use all uppercase names only for macros. And i think it is mostly done that way in wine. In fact you have to look quite hard to find an all uppercase variable name ;)
But are there any reasons why making that a variable at all? #define MAX_SUBKEY_LEN 255
Undid the random whitespace change. Any others?
it is still there in try4 - + RemoveSpecificProgram( argv[i++] );
there is one more - if(count != 0) + if (count != 0)
WINE_TRACE("allocated entry #%d: %s (%s), %s\n",
numentries, wine_dbgstr_w(entries[numentries-1].key),
wine_dbgstr_w(entries[numentries-1].descr), wine_dbgstr_w(entries[numentries-1].command));
You mixed tabs and spaces, and that line is too long.
Who originally wrote this damn code and how did it get by you in the first place? If it's too long, please give more info on how I can make it shorter, while still getting the same output. Especially since I didnt write that line.
As a suggestion: uninst_entry *entry; ... entry = &entries[numentries - 1];
Now you only need to write entry->xxx instead of entries[numentries - 1].xxx in that whole block and get slightly shorter lines.
On 4/25/07, Peter Beutner p.beutner@gmx.net wrote:
Tom Spear schrieb: Imo it's more common to use all uppercase names only for macros. And i think it is mostly done that way in wine. In fact you have to look quite hard to find an all uppercase variable name ;)
I agree, which is why I had it with certain letters capitalized, originally.
But are there any reasons why making that a variable at all? #define MAX_SUBKEY_LEN 255
No particular reason other than trying to keep the with the same format as the rest of the file.
Undid the random whitespace change. Any others?
it is still there in try4
RemoveSpecificProgram( argv[i++] );
there is one more
if(count != 0)
if (count != 0)
Fixed.
WINE_TRACE("allocated entry #%d: %s (%s), %s\n",
numentries, wine_dbgstr_w(entries[numentries-1].key),
wine_dbgstr_w(entries[numentries-1].descr), wine_dbgstr_w(entries[numentries-1].command));
You mixed tabs and spaces, and that line is too long.
Who originally wrote this damn code and how did it get by you in the first place? If it's too long, please give more info on how I can make it shorter, while still getting the same output. Especially since I didnt write that line.
As a suggestion: uninst_entry *entry; ... entry = &entries[numentries - 1];
Now you only need to write entry->xxx instead of entries[numentries - 1].xxx in that whole block and get slightly shorter lines.
That is very helpful, thanks!
Hopefully here is the last try, coming up in my next email.