summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2007-05-03 15:21:31 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2007-05-03 15:21:31 (GMT)
commitb4a1780d87be0a45798fe19a90a8317bf235404a (patch)
tree4b65e0e57b4ff5c4424e1dd85c980a9425cd118c
parent458541e13fd91e5f1323f40e835d5d9fca59d32c (diff)
downloadtk-b4a1780d87be0a45798fe19a90a8317bf235404a.zip
tk-b4a1780d87be0a45798fe19a90a8317bf235404a.tar.gz
tk-b4a1780d87be0a45798fe19a90a8317bf235404a.tar.bz2
Tackle [Bug 1711985]
-rw-r--r--ChangeLog9
-rw-r--r--generic/tkCanvPs.c22
-rw-r--r--generic/tkOption.c11
-rw-r--r--unix/tkUnixRFont.c27
-rw-r--r--unix/tkUnixSend.c14
5 files changed, 47 insertions, 36 deletions
diff --git a/ChangeLog b/ChangeLog
index 8502b22..ec21526 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-05-03 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * generic/tkCanvPs.c (TkCanvPostscriptCmd):
+ * generic/tkOption.c (GetDefaultOptions):
+ * unix/tkUnixRFont.c (TkpGetFontAttrsForChar, InitFont)
+ (TkpGetFontFamilies, TkpGetSubFonts):
+ * unix/tkUnixSend.c (TkpTestsendCmd): Squelch warnings from GCC type
+ aliasing. [Bug 1711985]
+
2007-04-29 Daniel Steffen <das@users.sourceforge.net>
* unix/configure.in: fix for default case in tk debug build detection.
diff --git a/generic/tkCanvPs.c b/generic/tkCanvPs.c
index 5fcdd15..a650d46 100644
--- a/generic/tkCanvPs.c
+++ b/generic/tkCanvPs.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkCanvPs.c,v 1.16 2005/11/04 15:23:05 dkf Exp $
+ * RCS: @(#) $Id: tkCanvPs.c,v 1.17 2007/05/03 15:21:32 dkf Exp $
*/
#include "tkInt.h"
@@ -161,7 +161,7 @@ TkCanvPostscriptCmd(
* this command enough to know that argv[1] is
* "postscript". */
{
- TkPostscriptInfo psInfo;
+ TkPostscriptInfo psInfo, *psInfoPtr = &psInfo;
Tk_PostscriptInfo oldInfoPtr;
int result;
Tk_Item *itemPtr;
@@ -191,7 +191,7 @@ TkCanvPostscriptCmd(
return result;
}
oldInfoPtr = canvasPtr->psInfo;
- canvasPtr->psInfo = (Tk_PostscriptInfo) &psInfo;
+ canvasPtr->psInfo = (Tk_PostscriptInfo) psInfoPtr;
psInfo.x = canvasPtr->xOrigin;
psInfo.y = canvasPtr->yOrigin;
psInfo.width = -1;
@@ -493,14 +493,14 @@ TkCanvPostscriptCmd(
Tcl_AppendResult(interp, string, NULL);
sprintf(string,
"%d %.15g moveto %d %.15g lineto %d %.15g lineto %d %.15g",
- psInfo.x,
- Tk_PostscriptY((double)psInfo.y, (Tk_PostscriptInfo)&psInfo),
- psInfo.x2,
- Tk_PostscriptY((double)psInfo.y, (Tk_PostscriptInfo)&psInfo),
- psInfo.x2,
- Tk_PostscriptY((double)psInfo.y2, (Tk_PostscriptInfo)&psInfo),
- psInfo.x,
- Tk_PostscriptY((double)psInfo.y2, (Tk_PostscriptInfo)&psInfo));
+ psInfo.x, Tk_PostscriptY((double)psInfo.y,
+ (Tk_PostscriptInfo)psInfoPtr),
+ psInfo.x2, Tk_PostscriptY((double)psInfo.y,
+ (Tk_PostscriptInfo)psInfoPtr),
+ psInfo.x2, Tk_PostscriptY((double)psInfo.y2,
+ (Tk_PostscriptInfo)psInfoPtr),
+ psInfo.x, Tk_PostscriptY((double)psInfo.y2,
+ (Tk_PostscriptInfo)psInfoPtr));
Tcl_AppendResult(interp, string,
" lineto closepath clip newpath\n", NULL);
}
diff --git a/generic/tkOption.c b/generic/tkOption.c
index b26e57e..b930f8c 100644
--- a/generic/tkOption.c
+++ b/generic/tkOption.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkOption.c,v 1.19 2007/04/17 14:36:49 dkf Exp $
+ * RCS: @(#) $Id: tkOption.c,v 1.20 2007/05/03 15:21:32 dkf Exp $
*/
#include "tkPort.h"
@@ -1569,7 +1569,7 @@ GetDefaultOptions(
TkWindow *winPtr) /* Fetch option defaults for main window
* associated with this. */
{
- char *regProp;
+ char *regProp, **regPropPtr = &regProp;
int result, actualFormat;
unsigned long numItems, bytesAfter;
Atom actualType;
@@ -1580,10 +1580,9 @@ GetDefaultOptions(
regProp = NULL;
result = XGetWindowProperty(winPtr->display,
- RootWindow(winPtr->display, 0),
- XA_RESOURCE_MANAGER, 0, 100000,
- False, XA_STRING, &actualType, &actualFormat,
- &numItems, &bytesAfter, (unsigned char **) &regProp);
+ RootWindow(winPtr->display, 0), XA_RESOURCE_MANAGER, 0, 100000,
+ False, XA_STRING, &actualType, &actualFormat, &numItems,
+ &bytesAfter, (unsigned char **) regPropPtr);
if ((result == Success) && (actualType == XA_STRING)
&& (actualFormat == 8)) {
diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c
index 96097fa..04f54de 100644
--- a/unix/tkUnixRFont.c
+++ b/unix/tkUnixRFont.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixRFont.c,v 1.16 2007/02/27 13:59:53 dkf Exp $
+ * RCS: @(#) $Id: tkUnixRFont.c,v 1.17 2007/05/03 15:21:32 dkf Exp $
*/
#include "tkUnixInt.h"
@@ -119,7 +119,7 @@ InitFont(
{
TkFontAttributes *faPtr;
TkFontMetrics *fmPtr;
- char *family;
+ char *family, **familyPtr = &family;
int weight, slant, spacing, i;
double size;
FcFontSet *set;
@@ -183,7 +183,7 @@ InitFont(
*/
if (XftPatternGetString(ftFont->pattern, XFT_FAMILY, 0,
- &family) != XftResultMatch) {
+ familyPtr) != XftResultMatch) {
family = "Unknown";
}
@@ -399,7 +399,7 @@ TkpGetFontFamilies(
Tcl_Obj *resultPtr, *strPtr;
XftFontSet *list;
int i;
- char *family;
+ char *family, **familyPtr = &family;
resultPtr = Tcl_NewListObj(0, NULL);
@@ -407,7 +407,7 @@ TkpGetFontFamilies(
XFT_FAMILY, 0);
for (i = 0; i < list->nfont; i++) {
if (XftPatternGetString(list->fonts[i], XFT_FAMILY, 0,
- &family) == XftResultMatch) {
+ familyPtr) == XftResultMatch) {
strPtr = Tcl_NewStringObj(Tk_GetUid(family), -1);
Tcl_ListObjAppendElement(NULL, resultPtr, strPtr);
}
@@ -438,7 +438,9 @@ TkpGetSubFonts(
Tcl_Obj *objv[3], *listPtr, *resultPtr;
UnixFtFont *fontPtr = (UnixFtFont *) tkfont;
FcPattern *pattern;
- char *family, *foundry, *encoding;
+ char *family, **familyPtr = &family;
+ char *foundry, **foundryPtr = &foundry;
+ char *encoding, **encodingPtr = &encoding;
int i;
resultPtr = Tcl_NewListObj(0, NULL);
@@ -448,15 +450,15 @@ TkpGetSubFonts(
fontPtr->faces[i].source);
if (XftPatternGetString(pattern, XFT_FAMILY, 0,
- &family) != XftResultMatch) {
+ familyPtr) != XftResultMatch) {
family = "Unknown";
}
if (XftPatternGetString(pattern, XFT_FOUNDRY, 0,
- &foundry) != XftResultMatch) {
+ foundryPtr) != XftResultMatch) {
foundry = "Unknown";
}
if (XftPatternGetString(pattern, XFT_ENCODING, 0,
- &encoding) != XftResultMatch) {
+ encodingPtr) != XftResultMatch) {
encoding = "Unknown";
}
objv[0] = Tcl_NewStringObj(family, -1);
@@ -473,8 +475,8 @@ TkpGetSubFonts(
*
* TkpGetFontAttrsForChar --
*
- * Retrieve the font attributes of the actual font used to render
- * a given character.
+ * Retrieve the font attributes of the actual font used to render a given
+ * character.
*
* Results:
* None.
@@ -499,12 +501,13 @@ TkpGetFontAttrsForChar(
XftFont *xftFontPtr = GetFont(fontPtr, ucs4);
/* Actual font used to render the character */
const char *family; /* Font family name */
+ const char **familyPtr = &family;
double size; /* Font size */
int weight; /* Font weight */
int slant; /* Font slant */
if (XftPatternGetString(xftFontPtr->pattern, XFT_FAMILY, 0,
- &family) != XftResultMatch) {
+ familyPtr) != XftResultMatch) {
family = "Unknown";
}
if (XftPatternGetDouble(xftFontPtr->pattern, XFT_SIZE, 0,
diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c
index 17d1288..b348ab8 100644
--- a/unix/tkUnixSend.c
+++ b/unix/tkUnixSend.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixSend.c,v 1.16 2007/02/27 14:52:57 dkf Exp $
+ * RCS: @(#) $Id: tkUnixSend.c,v 1.17 2007/05/03 15:21:32 dkf Exp $
*/
#include "tkPort.h"
@@ -586,7 +586,7 @@ ValidateName(
int result, actualFormat, argc, i;
unsigned long length, bytesAfter;
Atom actualType;
- char *property;
+ char *property, **propertyPtr = &property;
Tk_ErrorHandler handler;
CONST char **argv;
@@ -602,7 +602,7 @@ ValidateName(
result = XGetWindowProperty(dispPtr->display, commWindow,
dispPtr->appNameProperty, 0, MAX_PROP_WORDS,
False, XA_STRING, &actualType, &actualFormat,
- &length, &bytesAfter, (unsigned char **) &property);
+ &length, &bytesAfter, (unsigned char **) propertyPtr);
if ((result == Success) && (actualType == None)) {
XWindowAttributes atts;
@@ -1340,7 +1340,7 @@ SendEventProc(
XEvent *eventPtr) /* Information about event. */
{
TkDisplay *dispPtr = (TkDisplay *) clientData;
- char *propInfo;
+ char *propInfo, **propInfoPtr = &propInfo;
register char *p;
int result, actualFormat;
unsigned long numItems, bytesAfter;
@@ -1362,7 +1362,7 @@ SendEventProc(
result = XGetWindowProperty(dispPtr->display,
Tk_WindowId(dispPtr->commTkwin), dispPtr->commProperty, 0,
MAX_PROP_WORDS, True, XA_STRING, &actualType, &actualFormat,
- &numItems, &bytesAfter, (unsigned char **) &propInfo);
+ &numItems, &bytesAfter, (unsigned char **) propInfoPtr);
/*
* If the property doesn't exist or is improperly formed then ignore it.
@@ -1903,7 +1903,7 @@ TkpTestsendCmd(
int result, actualFormat;
unsigned long length, bytesAfter;
Atom actualType, propName;
- char *property, *p, *end;
+ char *property, **propertyPtr = &property, *p, *end;
Window w;
if ((argc != 4) && (argc != 5)) {
@@ -1923,7 +1923,7 @@ TkpTestsendCmd(
property = NULL;
result = XGetWindowProperty(winPtr->dispPtr->display, w, propName,
0, 100000, False, XA_STRING, &actualType, &actualFormat,
- &length, &bytesAfter, (unsigned char **) &property);
+ &length, &bytesAfter, (unsigned char **) propertyPtr);
if ((result == Success) && (actualType != None)
&& (actualFormat == 8) && (actualType == XA_STRING)) {
for (p = property; (unsigned long)(p-property) < length; p++) {