summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs>2006-05-25 23:51:37 (GMT)
committerhobbs <hobbs>2006-05-25 23:51:37 (GMT)
commit186276ae430724ba9c23a9ecb848cb410e52b1c7 (patch)
tree38fc505621b64917c6b353e3adf1b00e0bd224c9 /generic
parent944064482e5a5594377faebe939204f285dc19c1 (diff)
downloadtk-186276ae430724ba9c23a9ecb848cb410e52b1c7.zip
tk-186276ae430724ba9c23a9ecb848cb410e52b1c7.tar.gz
tk-186276ae430724ba9c23a9ecb848cb410e52b1c7.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.c11
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);