summaryrefslogtreecommitdiffstats
path: root/generic/tkConfig.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2007-05-03 21:53:12 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2007-05-03 21:53:12 (GMT)
commit1d327cff35030c574230508e600a5f587b64b321 (patch)
tree5bdaa4174986647477e1456659d073f03134c273 /generic/tkConfig.c
parentb4a1780d87be0a45798fe19a90a8317bf235404a (diff)
downloadtk-1d327cff35030c574230508e600a5f587b64b321.zip
tk-1d327cff35030c574230508e600a5f587b64b321.tar.gz
tk-1d327cff35030c574230508e600a5f587b64b321.tar.bz2
Missed a place (or rather not all versions of GCC catch it.)
Diffstat (limited to 'generic/tkConfig.c')
-rw-r--r--generic/tkConfig.c57
1 files changed, 21 insertions, 36 deletions
diff --git a/generic/tkConfig.c b/generic/tkConfig.c
index 8745183..614d244 100644
--- a/generic/tkConfig.c
+++ b/generic/tkConfig.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkConfig.c,v 1.23 2007/02/12 21:53:06 dkf Exp $
+ * RCS: @(#) $Id: tkConfig.c,v 1.24 2007/05/03 21:53:13 dkf Exp $
*/
/*
@@ -1435,79 +1435,64 @@ Tk_RestoreSavedOptions(
= savePtr->items[i].valuePtr;
}
if (specPtr->internalOffset >= 0) {
+ register char *ptr = (char *) &savePtr->items[i].internalForm;
+
switch (specPtr->type) {
case TK_OPTION_BOOLEAN:
- *((int *) internalPtr) =
- *((int *) &savePtr->items[i].internalForm);
+ *((int *) internalPtr) = *((int *) ptr);
break;
case TK_OPTION_INT:
- *((int *) internalPtr) =
- *((int *) &savePtr->items[i].internalForm);
+ *((int *) internalPtr) = *((int *) ptr);
break;
case TK_OPTION_DOUBLE:
- *((double *) internalPtr) =
- *((double *) &savePtr->items[i].internalForm);
+ *((double *) internalPtr) = *((double *) ptr);
break;
case TK_OPTION_STRING:
- *((char **) internalPtr) =
- *((char **) &savePtr->items[i].internalForm);
+ *((char **) internalPtr) = *((char **) ptr);
break;
case TK_OPTION_STRING_TABLE:
- *((int *) internalPtr) =
- *((int *) &savePtr->items[i].internalForm);
+ *((int *) internalPtr) = *((int *) ptr);
break;
case TK_OPTION_COLOR:
- *((XColor **) internalPtr) =
- *((XColor **) &savePtr->items[i].internalForm);
+ *((XColor **) internalPtr) = *((XColor **) ptr);
break;
case TK_OPTION_FONT:
- *((Tk_Font *) internalPtr) =
- *((Tk_Font *) &savePtr->items[i].internalForm);
+ *((Tk_Font *) internalPtr) = *((Tk_Font *) ptr);
break;
case TK_OPTION_STYLE:
- *((Tk_Style *) internalPtr) =
- *((Tk_Style *) &savePtr->items[i].internalForm);
+ *((Tk_Style *) internalPtr) = *((Tk_Style *) ptr);
break;
case TK_OPTION_BITMAP:
- *((Pixmap *) internalPtr) =
- *((Pixmap *) &savePtr->items[i].internalForm);
+ *((Pixmap *) internalPtr) = *((Pixmap *) ptr);
break;
case TK_OPTION_BORDER:
- *((Tk_3DBorder *) internalPtr) =
- *((Tk_3DBorder *) &savePtr->items[i].internalForm);
+ *((Tk_3DBorder *) internalPtr) = *((Tk_3DBorder *) ptr);
break;
case TK_OPTION_RELIEF:
- *((int *) internalPtr) =
- *((int *) &savePtr->items[i].internalForm);
+ *((int *) internalPtr) = *((int *) ptr);
break;
case TK_OPTION_CURSOR:
- *((Tk_Cursor *) internalPtr) =
- *((Tk_Cursor *) &savePtr->items[i].internalForm);
+ *((Tk_Cursor *) internalPtr) = *((Tk_Cursor *) ptr);
Tk_DefineCursor(savePtr->tkwin, *((Tk_Cursor *) internalPtr));
break;
case TK_OPTION_JUSTIFY:
- *((Tk_Justify *) internalPtr) =
- *((Tk_Justify *) &savePtr->items[i].internalForm);
+ *((Tk_Justify *) internalPtr) = *((Tk_Justify *) ptr);
break;
case TK_OPTION_ANCHOR:
- *((Tk_Anchor *) internalPtr) =
- *((Tk_Anchor *) &savePtr->items[i].internalForm);
+ *((Tk_Anchor *) internalPtr) = *((Tk_Anchor *) ptr);
break;
case TK_OPTION_PIXELS:
- *((int *) internalPtr) =
- *((int *) &savePtr->items[i].internalForm);
+ *((int *) internalPtr) = *((int *) ptr);
break;
case TK_OPTION_WINDOW:
- *((Tk_Window *) internalPtr) =
- *((Tk_Window *) &savePtr->items[i].internalForm);
+ *((Tk_Window *) internalPtr) = *((Tk_Window *) ptr);
break;
case TK_OPTION_CUSTOM: {
Tk_ObjCustomOption *custom = optionPtr->extra.custom;
if (custom->restoreProc != NULL) {
- custom->restoreProc(custom->clientData,
- savePtr->tkwin, internalPtr,
- (char *)&savePtr->items[i].internalForm);
+ custom->restoreProc(custom->clientData, savePtr->tkwin,
+ internalPtr, ptr);
}
break;
}