diff options
author | hobbs <hobbs> | 2006-05-25 23:51:37 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2006-05-25 23:51:37 (GMT) |
commit | e940c0c151ce0b503e5379ce1d637da0dc5cb6dc (patch) | |
tree | 38fc505621b64917c6b353e3adf1b00e0bd224c9 /generic | |
parent | 6b344d74f7bbd06f084d0dac0fa60fecc274cce9 (diff) | |
download | tk-e940c0c151ce0b503e5379ce1d637da0dc5cb6dc.zip tk-e940c0c151ce0b503e5379ce1d637da0dc5cb6dc.tar.gz tk-e940c0c151ce0b503e5379ce1d637da0dc5cb6dc.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); |