diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-12-11 14:11:14 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-12-11 14:11:14 (GMT) |
commit | 76eb475a1c171000446b21fb488202f2b1a124db (patch) | |
tree | 8b054d2dc9f1ba3071bd8194ece265b0445d0f8b /macosx/tkMacOSXColor.c | |
parent | 8fb4a031ef0229ae94bd43a06ac1779baab3049e (diff) | |
parent | 46f4476afd4803621152594669922f4d8b8afc3d (diff) | |
download | tk-76eb475a1c171000446b21fb488202f2b1a124db.zip tk-76eb475a1c171000446b21fb488202f2b1a124db.tar.gz tk-76eb475a1c171000446b21fb488202f2b1a124db.tar.bz2 |
Merge 8.7
Diffstat (limited to 'macosx/tkMacOSXColor.c')
-rw-r--r-- | macosx/tkMacOSXColor.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c index f11e660..3c155f6 100644 --- a/macosx/tkMacOSXColor.c +++ b/macosx/tkMacOSXColor.c @@ -5,11 +5,11 @@ * toolkit, in order to avoid round-trips to the server to * map color names to pixel values. * - * Copyright (c) 1990-1994 The Regents of the University of California. - * Copyright (c) 1994-1996 Sun Microsystems, Inc. - * Copyright 2001-2009, Apple Inc. - * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net> - * Copyright (c) 2020 Marc Culler + * Copyright © 1990-1994 The Regents of the University of California. + * Copyright © 1994-1996 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2006-2009 Daniel A. Steffen <das@users.sourceforge.net> + * Copyright © 2020 Marc Culler * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -177,7 +177,7 @@ TkMacOSXRGBPixel( unsigned long green, unsigned long blue) { - MacPixel p; + MacPixel p = {0}; p.pixel.colortype = rgbColor; p.pixel.value = ((red & 0xff) << 16) | ((green & 0xff) << 8) | @@ -207,7 +207,7 @@ MODULE_SCOPE unsigned long TkMacOSXClearPixel( void) { - MacPixel p; + MacPixel p = {0}; p.pixel.value = 0; p.pixel.colortype = clearColor; return p.ulong; @@ -236,7 +236,7 @@ SystemColorDatum* GetEntryFromPixel( unsigned long pixel) { - MacPixel p; + MacPixel p = {0}; int index = rgbColorIndex; p.ulong = pixel; @@ -314,6 +314,10 @@ GetRGBA( } } break; + case clearColor: + rgba[0] = rgba[1] = rgba[2] = 1.0; + rgba[3] = 0; + break; case semantic: if (entry->index == controlAccentIndex && useFakeAccentColor) { #if MAC_OS_X_VERSION_MIN_REQUIRED < 101400 @@ -332,8 +336,6 @@ GetRGBA( } [color getComponents: rgba]; break; - case clearColor: - rgba[3] = 0; default: break; } @@ -598,7 +600,7 @@ TkpGetColor( if (strncasecmp(name, "system", 6) == 0) { Tcl_HashEntry *hPtr = Tcl_FindHashEntry(&systemColors, name + 6); - MacPixel p; + MacPixel p = {0}; if (hPtr != NULL) { SystemColorDatum *entry = (SystemColorDatum *)Tcl_GetHashValue(hPtr); |