summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixSelect.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2007-02-22 13:56:32 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2007-02-22 13:56:32 (GMT)
commitdde89e53698859ca30c7ef441d2b64350d2a8187 (patch)
treed27aec929ff20b2ab6ba34faa14bd56439bf1d33 /unix/tkUnixSelect.c
parent18bcf9971777b9bf6d2eacd064c42f0f7e58ae47 (diff)
downloadtk-dde89e53698859ca30c7ef441d2b64350d2a8187.zip
tk-dde89e53698859ca30c7ef441d2b64350d2a8187.tar.gz
tk-dde89e53698859ca30c7ef441d2b64350d2a8187.tar.bz2
Less of that K&R or wrongly indented function header style!
Diffstat (limited to 'unix/tkUnixSelect.c')
-rw-r--r--unix/tkUnixSelect.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/unix/tkUnixSelect.c b/unix/tkUnixSelect.c
index 9cef53b..ca54913 100644
--- a/unix/tkUnixSelect.c
+++ b/unix/tkUnixSelect.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: tkUnixSelect.c,v 1.18 2005/11/14 15:55:02 dkf Exp $
+ * RCS: @(#) $Id: tkUnixSelect.c,v 1.19 2007/02/22 13:56:34 dkf Exp $
*/
#include "tkInt.h"
@@ -232,8 +232,8 @@ TkSelGetSelection(
*/
void
-TkSelPropProc(eventPtr)
- register XEvent *eventPtr; /* X PropertyChange event. */
+TkSelPropProc(
+ register XEvent *eventPtr) /* X PropertyChange event. */
{
register IncrInfo *incrPtr;
register TkSelHandler *selPtr;
@@ -311,6 +311,7 @@ TkSelPropProc(eventPtr)
length = 0;
} else {
TkSelInProgress ip;
+
ip.selPtr = selPtr;
ip.nextPtr = TkSelGetInProgress();
TkSelSetInProgress(&ip);
@@ -400,9 +401,8 @@ TkSelPropProc(eventPtr)
*/
while (1) {
- result = Tcl_UtfToExternal(NULL, encoding,
- src, srcLen, encodingCvtFlags,
- &incrPtr->converts[i].state,
+ result = Tcl_UtfToExternal(NULL, encoding, src, srcLen,
+ encodingCvtFlags, &incrPtr->converts[i].state,
dst, dstLen, &srcRead, &dstWrote, NULL);
soFar = dst + dstWrote - Tcl_DStringValue(&ds);
encodingCvtFlags &= ~TCL_ENCODING_START;
@@ -450,8 +450,7 @@ TkSelPropProc(eventPtr)
*/
char *propPtr = (char *) SelCvtToX((char *) buffer,
- formatType, (Tk_Window) incrPtr->winPtr,
- &numItems);
+ formatType, (Tk_Window) incrPtr->winPtr, &numItems);
if (propPtr == NULL) {
numItems = 0;
@@ -576,7 +575,7 @@ TkSelEventProc(
}
if (bytesAfter != 0) {
Tcl_SetResult(retrPtr->interp, "selection property too large",
- TCL_STATIC);
+ TCL_STATIC);
retrPtr->result = TCL_ERROR;
XFree(propInfo);
return;
@@ -824,8 +823,9 @@ ConvertSelection(
for (infoPtr = winPtr->dispPtr->selectionInfoPtr; infoPtr != NULL;
infoPtr = infoPtr->nextPtr) {
- if (infoPtr->selection == eventPtr->selection)
+ if (infoPtr->selection == eventPtr->selection) {
break;
+ }
}
if (infoPtr == NULL) {
goto refuse;
@@ -877,8 +877,8 @@ ConvertSelection(
* below).
*/
- incr.converts = (ConvertInfo *) ckalloc((unsigned)
- (incr.numConversions*sizeof(ConvertInfo)));
+ incr.converts = (ConvertInfo *)
+ ckalloc((unsigned) incr.numConversions * sizeof(ConvertInfo));
incr.numIncrs = 0;
for (i = 0; i < incr.numConversions; i++) {
Atom target, property, type;
@@ -961,9 +961,8 @@ ConvertSelection(
* allows us to pass our utf-8 information untouched.
*/
- XChangeProperty(reply.display, reply.requestor,
- property, type, 8, PropModeReplace,
- (unsigned char *) buffer, numItems);
+ XChangeProperty(reply.display, reply.requestor, property, type, 8,
+ PropModeReplace, (unsigned char *) buffer, numItems);
} else if ((type == XA_STRING)
|| (type == winPtr->dispPtr->compoundTextAtom)) {
Tcl_DString ds;
@@ -980,7 +979,7 @@ ConvertSelection(
} else {
encoding = Tcl_GetEncoding(NULL, "iso2022");
}
- Tcl_UtfToExternalDString(encoding, (char*)buffer, -1, &ds);
+ Tcl_UtfToExternalDString(encoding, (char *) buffer, -1, &ds);
XChangeProperty(reply.display, reply.requestor, property, type, 8,
PropModeReplace, (unsigned char *) Tcl_DStringValue(&ds),
Tcl_DStringLength(&ds));