From c10cbf2c8a673ec745bb3c50d0dd53bd0c94e7b0 Mon Sep 17 00:00:00 2001 From: hobbs Date: Thu, 25 May 2006 23:51:37 +0000 Subject: * generic/tkMenu.c (DeleteMenuCloneEntries): Modify entry index changes to work around VC6 optimization bug. [Bug 1224330] --- generic/tkMenu.c | 11 ++++++----- 1 file 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); -- cgit v0.12