diff options
author | hobbs <hobbs> | 2006-05-25 23:51:37 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2006-05-25 23:51:37 (GMT) |
commit | c10cbf2c8a673ec745bb3c50d0dd53bd0c94e7b0 (patch) | |
tree | 38fc505621b64917c6b353e3adf1b00e0bd224c9 /generic | |
parent | 73595b628469375e509b39df65cbf11c02ffd513 (diff) | |
download | tk-c10cbf2c8a673ec745bb3c50d0dd53bd0c94e7b0.zip tk-c10cbf2c8a673ec745bb3c50d0dd53bd0c94e7b0.tar.gz tk-c10cbf2c8a673ec745bb3c50d0dd53bd0c94e7b0.tar.bz2 |
* generic/tkMenu.c (DeleteMenuCloneEntries): Modify entry index
changes to work around VC6 optimization bug. [Bug 1224330]
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkMenu.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/generic/tkMenu.c b/generic/tkMenu.c index e272ee1..5936e96 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMenu.c,v 1.20.2.6 2005/11/27 02:44:25 das Exp $ + * RCS: @(#) $Id: tkMenu.c,v 1.20.2.7 2006/05/25 23:51:37 hobbs Exp $ */ /* @@ -3489,7 +3489,7 @@ DeleteMenuCloneEntries(menuPtr, first, last) { TkMenu *menuListPtr; - int numDeleted, i; + int numDeleted, i, j; numDeleted = last + 1 - first; for (menuListPtr = menuPtr->masterMenuPtr; menuListPtr != NULL; @@ -3499,9 +3499,10 @@ DeleteMenuCloneEntries(menuPtr, first, last) DestroyMenuEntry); } for (i = last + 1; i < menuListPtr->numEntries; i++) { - menuListPtr->entries[i - numDeleted] = menuListPtr->entries[i]; - menuListPtr->entries[i - numDeleted]->index = i - numDeleted; - } + j = i - numDeleted; + menuListPtr->entries[j] = menuListPtr->entries[i]; + menuListPtr->entries[j]->index = j; + } menuListPtr->numEntries -= numDeleted; if (menuListPtr->numEntries == 0) { ckfree((char *) menuListPtr->entries); |