diff options
author | donal.k.fellows@manchester.ac.uk <dkf> | 2005-08-10 22:02:21 (GMT) |
---|---|---|
committer | donal.k.fellows@manchester.ac.uk <dkf> | 2005-08-10 22:02:21 (GMT) |
commit | 0a14a4ea9b113d11a59f643f4e3a8dd5e59e9a5e (patch) | |
tree | 9d4e60b064aa3377d392ff30035da3ba8ba121ae /unix/tkUnix.c | |
parent | bfd202baf521dd08d16c667cb7940dda7181bc88 (diff) | |
download | tk-0a14a4ea9b113d11a59f643f4e3a8dd5e59e9a5e.zip tk-0a14a4ea9b113d11a59f643f4e3a8dd5e59e9a5e.tar.gz tk-0a14a4ea9b113d11a59f643f4e3a8dd5e59e9a5e.tar.bz2 |
Getting more systematic about style
Also start removing _ANSI_ARGS_; the core's required ANSI C for a while now
Also fix [Bug 1252702]; size_t doesn't mix with Tcl_GetStringFromObj
Diffstat (limited to 'unix/tkUnix.c')
-rw-r--r-- | unix/tkUnix.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/unix/tkUnix.c b/unix/tkUnix.c index 0f93e93..677569e 100644 --- a/unix/tkUnix.c +++ b/unix/tkUnix.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnix.c,v 1.10 2005/06/02 10:08:07 rmax Exp $ + * RCS: @(#) $Id: tkUnix.c,v 1.11 2005/08/10 22:02:22 dkf Exp $ */ #include <tkInt.h> @@ -115,8 +115,8 @@ Tk_UpdatePointer(tkwin, x, y, state) * * TkpBuildRegionFromAlphaData -- * - * Set up a rectangle of the given region based on the supplied - * alpha data. + * Set up a rectangle of the given region based on the supplied alpha + * data. * * Results: * None @@ -130,14 +130,14 @@ Tk_UpdatePointer(tkwin, x, y, state) void TkpBuildRegionFromAlphaData(region, x, y, width, height, dataPtr, pixelStride, lineStride) - TkRegion region; - unsigned int x, y; /* Where in region to update. */ - unsigned int width, height; /* Size of rectangle to update. */ - unsigned char *dataPtr; /* Data to read from. */ - unsigned int pixelStride; /* num bytes from one piece of alpha - * data to the next in the line. */ - unsigned int lineStride; /* num bytes from one line of alpha - * data to the next line. */ + TkRegion region; /* Region to be updated. */ + unsigned int x, y; /* Where in region to update. */ + unsigned int width, height; /* Size of rectangle to update. */ + unsigned char *dataPtr; /* Data to read from. */ + unsigned int pixelStride; /* Num bytes from one piece of alpha data to + * the next in the line. */ + unsigned int lineStride; /* Num bytes from one line of alpha data to + * the next line. */ { unsigned char *lineDataPtr; unsigned int x1, y1, end; @@ -146,13 +146,20 @@ TkpBuildRegionFromAlphaData(region, x, y, width, height, dataPtr, for (y1 = 0; y1 < height; y1++) { lineDataPtr = dataPtr; for (x1 = 0; x1 < width; x1 = end) { - /* search for first non-transparent pixel */ + /* + * Search for first non-transparent pixel. + */ + while ((x1 < width) && !*lineDataPtr) { x1++; lineDataPtr += pixelStride; } end = x1; - /* search for first transparent pixel */ + + /* + * Search for first transparent pixel. + */ + while ((end < width) && *lineDataPtr) { end++; lineDataPtr += pixelStride; |