summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog23
-rw-r--r--generic/tkImgPhoto.c47
2 files changed, 34 insertions, 36 deletions
diff --git a/ChangeLog b/ChangeLog
index c40f579..507fd54 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,13 @@
+2003-07-17 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkImgPhoto.c (ImgPhotoCmd): Rewrote subcommand processing
+ to never jump to the end of the switch. I find that confusing as
+ I can't see whether there's processing still to be done from a
+ quick glance at the code, unlike with a direct return. [Bug 771988]
+
2003-07-16 Don Porter <dgp@users.sourceforge.net>
- * generic/tkPack.c (ConfigureSlaves): silence compiler warning
+ * generic/tkPack.c (ConfigureSlaves): silence compiler warning
[Bug 771982]
2003-07-16 Jeff Hobbs <jeffh@ActiveState.com>
@@ -59,7 +66,7 @@
2003-06-26 Vince Darley <vincentdarley@users.sourceforge.net>
* library/menu.tcl: workaround problem on some Windows systems
- by trying to avoid posting a menu offscreen.
+ by trying to avoid posting a menu offscreen.
2003-06-09 Joe English <jenglish@users.sourceforge.net>
@@ -232,12 +239,12 @@
2003-04-25 Jeff Hobbs <jeffh@ActiveState.com>
- * generic/tkButton.h: Rewrote the handling
+ * generic/tkButton.h: Rewrote the handling
* generic/tkButton.c (TkButtonWorldChanged): of compound *buttons
- * mac/tkMacButton.c (TkpDisplayButton): to correctly display
+ * mac/tkMacButton.c (TkpDisplayButton): to correctly display
* macosx/tkMacOSXButton.c (TkpDisplayButton): mixture of disabledfg,
* unix/tkUnixButton.c (TkpDisplayButton): selectcolor, indicator,
- * win/tkWinButton.c (TkpDisplayButton): etc. *buttons will
+ * win/tkWinButton.c (TkpDisplayButton): etc. *buttons will
now only stipple the image, unless no disabledfg is given, in which
case it will stipple the whole button.
@@ -380,8 +387,8 @@
2003-03-18 Don Porter <dgp@users.sourceforge.net>
- * tests/unixWm.test (unixWm-41.2): Corrected typo in 2003-03-13
- commit. Thanks Larry Virden. [Bug 705567]
+ * tests/unixWm.test (unixWm-41.2): Corrected typo in 2003-03-13
+ commit. Thanks Larry Virden. [Bug 705567]
2003-03-18 Daniel Steffen <das@users.sourceforge.net>
@@ -1233,7 +1240,7 @@
* generic/tkImgPhoto.c (ImgPhotoConfigureMaster): fix arg handling
for missing -format or -data options. [Bug #624974]
- * tests/text.test: properly return the number of
+ * tests/text.test: properly return the number of
* unix/tkUnixFont.c (ControlUtfProc): bytes consumed. [Bug #624732]
2002-10-17 Daniel Steffen <das@users.sourceforge.net>
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index 3849556..02ab477 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -16,7 +16,7 @@
* Department of Computer Science,
* Australian National University.
*
- * RCS: @(#) $Id: tkImgPhoto.c,v 1.37 2003/03/06 15:05:36 dkf Exp $
+ * RCS: @(#) $Id: tkImgPhoto.c,v 1.38 2003/07/17 10:11:03 dkf Exp $
*/
#include "tkInt.h"
@@ -686,11 +686,11 @@ ImgPhotoCmd(clientData, interp, objc, objv)
if (objc == 2) {
Tk_PhotoBlank(masterPtr);
+ return TCL_OK;
} else {
Tcl_WrongNumArgs(interp, 2, objv, (char *) NULL);
return TCL_ERROR;
}
- break;
case PHOTO_CGET: {
char *arg;
@@ -704,17 +704,15 @@ ImgPhotoCmd(clientData, interp, objc, objv)
if (masterPtr->dataString) {
Tcl_SetObjResult(interp, masterPtr->dataString);
}
- return TCL_OK;
- }
- if (strncmp(arg,"-format", length) == 0) {
+ } else if (strncmp(arg,"-format", length) == 0) {
if (masterPtr->format) {
Tcl_SetObjResult(interp, masterPtr->format);
}
- return TCL_OK;
+ } else {
+ Tk_ConfigureValue(interp, Tk_MainWindow(interp), configSpecs,
+ (char *) masterPtr, Tcl_GetString(objv[2]), 0);
}
- Tk_ConfigureValue(interp, Tk_MainWindow(interp), configSpecs,
- (char *) masterPtr, Tcl_GetString(objv[2]), 0);
- break;
+ return TCL_OK;
}
case PHOTO_CONFIGURE:
@@ -877,15 +875,11 @@ ImgPhotoCmd(clientData, interp, objc, objv)
+ options.fromY * block.pitch;
block.width = options.fromX2 - options.fromX;
block.height = options.fromY2 - options.fromY;
- if (Tk_PhotoPutZoomedBlock(interp, (Tk_PhotoHandle) masterPtr, &block,
- options.toX, options.toY, options.toX2 - options.toX,
+ return Tk_PhotoPutZoomedBlock(interp, (Tk_PhotoHandle) masterPtr,
+ &block, options.toX, options.toY, options.toX2 - options.toX,
options.toY2 - options.toY, options.zoomX, options.zoomY,
options.subsampleX, options.subsampleY,
- options.compositingRule) != TCL_OK) {
- return TCL_ERROR;
- }
-
- break;
+ options.compositingRule);
case PHOTO_DATA: {
char *data;
@@ -970,7 +964,6 @@ ImgPhotoCmd(clientData, interp, objc, objv)
ckfree(data);
}
return result;
- break;
}
case PHOTO_GET: {
@@ -1003,7 +996,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
sprintf(string, "%d %d %d", pixelPtr[0], pixelPtr[1],
pixelPtr[2]);
Tcl_AppendResult(interp, string, (char *) NULL);
- break;
+ return TCL_OK;
}
case PHOTO_PUT:
@@ -1127,15 +1120,12 @@ ImgPhotoCmd(clientData, interp, objc, objv)
block.offset[1] = 1;
block.offset[2] = 2;
block.offset[3] = 0;
- if (Tk_PhotoPutBlock(interp, (ClientData)masterPtr, &block,
+ result = Tk_PhotoPutBlock(interp, (ClientData)masterPtr, &block,
options.toX, options.toY, options.toX2 - options.toX,
options.toY2 - options.toY,
- TK_PHOTO_COMPOSITE_SET) != TCL_OK) {
- ckfree((char *) block.pixelPtr);
- return TCL_ERROR;
- }
+ TK_PHOTO_COMPOSITE_SET);
ckfree((char *) block.pixelPtr);
- break;
+ return result;
case PHOTO_READ: {
Tcl_Obj *format;
@@ -1246,7 +1236,6 @@ ImgPhotoCmd(clientData, interp, objc, objv)
Tcl_Close(NULL, chan);
}
return result;
- break;
}
case PHOTO_REDITHER:
@@ -1282,7 +1271,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
(masterPtr->width - x), (masterPtr->height - y),
masterPtr->width, masterPtr->height);
}
- break;
+ return TCL_OK;
case PHOTO_TRANS: {
static CONST char *photoTransOptions[] = {
@@ -1397,10 +1386,11 @@ ImgPhotoCmd(clientData, interp, objc, objv)
Tk_ImageChanged(masterPtr->tkMaster, x, y, 1, 1,
masterPtr->width, masterPtr->height);
masterPtr->flags &= ~IMAGE_CHANGED;
+ return TCL_OK;
}
}
- return TCL_OK;
+ panic("unexpected fallthrough");
}
case PHOTO_WRITE: {
@@ -1522,7 +1512,8 @@ ImgPhotoCmd(clientData, interp, objc, objv)
}
}
- return TCL_OK;
+ panic("unexpected fallthrough");
+ return TCL_ERROR; /* NOT REACHED */
}
/*