diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2012-03-07 14:30:58 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2012-03-07 14:30:58 (GMT) |
commit | a1be27aaab68d7bf4ff2be1f1785336b6dd3cb6d (patch) | |
tree | c424e4e080a680ca9c48011b3b24ef02cbae05d1 | |
parent | caa178407bf99803afd0702ce1225cda259ccc73 (diff) | |
parent | 82592272d14f80ff692543ef1340d36f4aeef4a3 (diff) | |
download | tk-a1be27aaab68d7bf4ff2be1f1785336b6dd3cb6d.zip tk-a1be27aaab68d7bf4ff2be1f1785336b6dd3cb6d.tar.gz tk-a1be27aaab68d7bf4ff2be1f1785336b6dd3cb6d.tar.bz2 |
Minor: code style improvements.
-rw-r--r-- | generic/tkObj.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/generic/tkObj.c b/generic/tkObj.c index 2e45e0e..8877d42 100644 --- a/generic/tkObj.c +++ b/generic/tkObj.c @@ -368,10 +368,9 @@ static void FreePixelInternalRep( Tcl_Obj *objPtr) /* Pixel object with internal rep to free. */ { - PixelRep *pixelPtr; - if (!SIMPLE_PIXELREP(objPtr)) { - pixelPtr = GET_COMPLEXPIXEL(objPtr); + PixelRep *pixelPtr = GET_COMPLEXPIXEL(objPtr); + ckfree(pixelPtr); } SET_SIMPLEPIXEL(objPtr, 0); @@ -401,13 +400,13 @@ DupPixelInternalRep( register Tcl_Obj *srcPtr, /* Object with internal rep to copy. */ register Tcl_Obj *copyPtr) /* Object with internal rep to set. */ { - PixelRep *oldPtr, *newPtr; - copyPtr->typePtr = srcPtr->typePtr; if (SIMPLE_PIXELREP(srcPtr)) { SET_SIMPLEPIXEL(copyPtr, GET_SIMPLEPIXEL(srcPtr)); } else { + PixelRep *oldPtr, *newPtr; + oldPtr = GET_COMPLEXPIXEL(srcPtr); newPtr = ckalloc(sizeof(PixelRep)); newPtr->value = oldPtr->value; |