diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2007-01-11 15:35:39 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2007-01-11 15:35:39 (GMT) |
commit | a7b45de808c4bca805fab7b4eb90aa6e6f09e2ac (patch) | |
tree | 9afda096b9165b4f20fb70975876d2bf0c1c2c29 /generic | |
parent | a46a8df372318c40d2d0c346578eef7412a7b257 (diff) | |
download | tk-a7b45de808c4bca805fab7b4eb90aa6e6f09e2ac.zip tk-a7b45de808c4bca805fab7b4eb90aa6e6f09e2ac.tar.gz tk-a7b45de808c4bca805fab7b4eb90aa6e6f09e2ac.tar.bz2 |
Many minute fixes to reduce number of minor warnings from GCC.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkImgGIF.c | 22 | ||||
-rw-r--r-- | generic/tkImgPhoto.c | 7 | ||||
-rw-r--r-- | generic/tkImgUtil.c | 4 | ||||
-rw-r--r-- | generic/tkTextDisp.c | 28 | ||||
-rw-r--r-- | generic/ttk/ttkClamTheme.c | 59 | ||||
-rw-r--r-- | generic/ttk/ttkDefaultTheme.c | 11 | ||||
-rw-r--r-- | generic/ttk/ttkElements.c | 7 | ||||
-rw-r--r-- | generic/ttk/ttkEntry.c | 25 | ||||
-rw-r--r-- | generic/ttk/ttkLabel.c | 8 | ||||
-rw-r--r-- | generic/ttk/ttkLayout.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkManager.c | 18 | ||||
-rw-r--r-- | generic/ttk/ttkNotebook.c | 13 | ||||
-rw-r--r-- | generic/ttk/ttkTagSet.c | 6 | ||||
-rw-r--r-- | generic/ttk/ttkTheme.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkTreeview.c | 6 |
15 files changed, 116 insertions, 106 deletions
diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c index b0dbcef..970c253 100644 --- a/generic/tkImgGIF.c +++ b/generic/tkImgGIF.c @@ -32,7 +32,7 @@ * This file also contains code from miGIF. See lower down in file for the * applicable copyright notice for that portion. * - * RCS: @(#) $Id: tkImgGIF.c,v 1.33 2006/07/20 06:24:16 das Exp $ + * RCS: @(#) $Id: tkImgGIF.c,v 1.34 2007/01/11 15:35:39 dkf Exp $ */ /* @@ -1857,10 +1857,10 @@ writeBlock( static void blockOut( miGIFState_t *statePtr, - unsigned char c) + unsigned c) { DEBUGMSG(("blockOut %s\n", binformat(c, 8))); - statePtr->oblock[statePtr->oblen++] = c; + statePtr->oblock[statePtr->oblen++] = (unsigned char) c; if (statePtr->oblen >= 255) { writeBlock(statePtr); } @@ -1887,7 +1887,7 @@ output( statePtr->obuf |= val << statePtr->obits; statePtr->obits += statePtr->outputBits; while (statePtr->obits >= 8) { - blockOut(statePtr, UCHAR(statePtr->obuf & 0xff)); + blockOut(statePtr, statePtr->obuf & 0xff); statePtr->obuf >>= 8; statePtr->obits -= 8; } @@ -1901,7 +1901,7 @@ outputFlush( { DEBUGMSG(("outputFlush\n")); if (statePtr->obits > 0) { - blockOut(statePtr, UCHAR(statePtr->obuf)); + blockOut(statePtr, statePtr->obuf); } blockFlush(statePtr); } @@ -1958,7 +1958,7 @@ isqrt( } } -static unsigned int +static int computeTriangleCount( unsigned int count, unsigned int nrepcodes) @@ -1983,7 +1983,7 @@ computeTriangleCount( } cost += n; } - return cost; + return (int) cost + 1; } static void @@ -2052,7 +2052,8 @@ runlengthFlushClearOrRep( int withclr; DEBUGMSG(("runlengthFlushClearOrRep %d\n", count)); - withclr = 1 + computeTriangleCount(count, statePtr->maxOcodes); + withclr = computeTriangleCount((unsigned) count, + (unsigned) statePtr->maxOcodes); if (withclr < count) { output(statePtr, statePtr->codeClear); didClear(statePtr); @@ -2080,11 +2081,12 @@ runlengthFlushWithTable( if (statePtr->outputCount+repmax+repleft > statePtr->maxOcodes) { repmax = statePtr->maxOcodes - statePtr->outputCount; leftover = count - (repmax * statePtr->runlengthTableMax); - repleft = 1 + computeTriangleCount(leftover, statePtr->maxOcodes); + repleft = computeTriangleCount((unsigned) leftover, + (unsigned) statePtr->maxOcodes); } DEBUGMSG(("runlengthFlushWithTable repmax=%d leftover=%d repleft=%d\n", repmax, leftover, repleft)); - if (1+(int)computeTriangleCount(count, statePtr->maxOcodes) + if (computeTriangleCount((unsigned) count, (unsigned) statePtr->maxOcodes) < repmax+repleft) { output(statePtr, statePtr->codeClear); didClear(statePtr); diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index f5c3e2b..5838ef5 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -17,7 +17,7 @@ * Department of Computer Science, * Australian National University. * - * RCS: @(#) $Id: tkImgPhoto.c,v 1.67 2007/01/03 04:10:54 nijtmans Exp $ + * RCS: @(#) $Id: tkImgPhoto.c,v 1.68 2007/01/11 15:35:39 dkf Exp $ */ #include "tkInt.h" @@ -4907,9 +4907,10 @@ Tk_PhotoPutZoomedBlock( TkDestroyRegion(workRgn); } - TkpBuildRegionFromAlphaData(masterPtr->validRegion, x,y, width,height, + TkpBuildRegionFromAlphaData(masterPtr->validRegion, + (unsigned)x, (unsigned)y, (unsigned)width, (unsigned)height, &masterPtr->pix32[(y * masterPtr->width + x) * 4 + 3], 4, - masterPtr->width * 4); + (unsigned) masterPtr->width * 4); } else { rect.x = x; rect.y = y; diff --git a/generic/tkImgUtil.c b/generic/tkImgUtil.c index 708a374..3c1accf 100644 --- a/generic/tkImgUtil.c +++ b/generic/tkImgUtil.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: tkImgUtil.c,v 1.4 2005/11/15 15:18:21 dkf Exp $ + * RCS: @(#) $Id: tkImgUtil.c,v 1.5 2007/01/11 15:35:39 dkf Exp $ */ #include "tkInt.h" @@ -58,7 +58,7 @@ TkAlignImageData( dataWidth += (alignment - (dataWidth % alignment)); } - data = ckalloc(dataWidth * image->height); + data = ckalloc((unsigned) dataWidth * image->height); destPtr = data; for (i = 0; i < image->height; i++) { diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index d626520..b96542e 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextDisp.c,v 1.60 2006/10/17 23:44:45 hobbs Exp $ + * RCS: @(#) $Id: tkTextDisp.c,v 1.61 2007/01/11 15:35:39 dkf Exp $ */ #include "tkPort.h" @@ -5738,8 +5738,8 @@ TkTextYviewCmd( register CONST char *switchStr = Tcl_GetStringFromObj(objv[2], &switchLength); - if ((switchLength >= 2) - && (strncmp(switchStr, "-pickplace", switchLength) == 0)) { + if ((switchLength >= 2) && (strncmp(switchStr, "-pickplace", + (unsigned) switchLength) == 0)) { pickPlace = 1; if (objc != 4) { Tcl_WrongNumArgs(interp, 3, objv, "lineNum|index"); @@ -7058,13 +7058,10 @@ TkTextCharLayoutProc( bciPtr->width = 0; ciPtr = &bciPtr->ci; - } else { - bciPtr = (BaseCharInfo*) baseCharChunkPtr->clientData; ciPtr = (CharInfo*) ckalloc(sizeof(CharInfo)); baseString = &bciPtr->baseChars; - } lineOffset = Tcl_DStringLength(baseString); @@ -7076,20 +7073,19 @@ TkTextCharLayoutProc( ciPtr->chars = NULL; ciPtr->numBytes = 0; - bytesThatFit = CharChunkMeasureChars( - chunkPtr, line, lineOffset + maxBytes, lineOffset, -1, - chunkPtr->x, maxX, TK_ISOLATE_END, &nextX); + bytesThatFit = CharChunkMeasureChars(chunkPtr, line, + lineOffset + maxBytes, lineOffset, -1, chunkPtr->x, maxX, + TK_ISOLATE_END, &nextX); #else /* !TK_LAYOUT_WITH_BASE_CHUNKS */ - bytesThatFit = CharChunkMeasureChars( - chunkPtr, p, maxBytes, 0, -1, - chunkPtr->x, maxX, TK_ISOLATE_END, &nextX); + bytesThatFit = CharChunkMeasureChars(chunkPtr, p, maxBytes, 0, -1, + chunkPtr->x, maxX, TK_ISOLATE_END, &nextX); #endif /* TK_LAYOUT_WITH_BASE_CHUNKS */ if (bytesThatFit < maxBytes) { if ((bytesThatFit == 0) && noCharsYet) { Tcl_UniChar ch; int chLen = Tcl_UtfToUniChar(p, &ch); - + #if TK_LAYOUT_WITH_BASE_CHUNKS bytesThatFit = CharChunkMeasureChars( chunkPtr, line, lineOffset + chLen, lineOffset, -1, @@ -7154,10 +7150,10 @@ TkTextCharLayoutProc( chunkPtr->breakIndex = -1; #if !TK_LAYOUT_WITH_BASE_CHUNKS - ciPtr = (CharInfo *) ckalloc( - bytesThatFit + Tk_Offset(CharInfo,chars) +1); + ciPtr = (CharInfo *) + ckalloc((unsigned) bytesThatFit + Tk_Offset(CharInfo, chars) + 1); chunkPtr->clientData = (ClientData) ciPtr; - memcpy(ciPtr->chars, p, bytesThatFit); + memcpy(ciPtr->chars, p, (unsigned) bytesThatFit); #endif /* TK_LAYOUT_WITH_BASE_CHUNKS */ ciPtr->numBytes = bytesThatFit; diff --git a/generic/ttk/ttkClamTheme.c b/generic/ttk/ttkClamTheme.c index 188e8a0..0638e52 100644 --- a/generic/ttk/ttkClamTheme.c +++ b/generic/ttk/ttkClamTheme.c @@ -1,5 +1,5 @@ /* - * $Id: ttkClamTheme.c,v 1.3 2006/12/13 17:06:32 jenglish Exp $ + * $Id: ttkClamTheme.c,v 1.4 2007/01/11 15:35:39 dkf Exp $ * * Copyright (C) 2004 Joe English * @@ -324,16 +324,22 @@ RadioIndicatorElementDraw( Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &padding); b = Ttk_PadBox(b, padding); - XFillArc(Tk_Display(tkwin),d,gcb, b.x,b.y,b.width,b.height, 0,360*64); - XDrawArc(Tk_Display(tkwin),d,gcl, b.x,b.y,b.width,b.height, 225*64,180*64); - XDrawArc(Tk_Display(tkwin),d,gcu, b.x,b.y,b.width,b.height, 45*64,180*64); + XFillArc(Tk_Display(tkwin),d,gcb, + b.x,b.y,(unsigned)b.width,(unsigned)b.height, 0,360*64); + XDrawArc(Tk_Display(tkwin),d,gcl, + b.x,b.y,(unsigned)b.width,(unsigned)b.height, 225*64,180*64); + XDrawArc(Tk_Display(tkwin),d,gcu, + b.x,b.y,(unsigned)b.width,(unsigned)b.height, 45*64,180*64); if (state & TTK_STATE_SELECTED) { b = Ttk_PadBox(b,Ttk_UniformPadding(3)); - XFillArc(Tk_Display(tkwin),d,gcf, b.x,b.y,b.width,b.height, 0,360*64); - XDrawArc(Tk_Display(tkwin),d,gcf, b.x,b.y,b.width,b.height, 0,360*64); + XFillArc(Tk_Display(tkwin),d,gcf, + b.x,b.y,(unsigned)b.width,(unsigned)b.height, 0,360*64); + XDrawArc(Tk_Display(tkwin),d,gcf, + b.x,b.y,(unsigned)b.width,(unsigned)b.height, 0,360*64); #if WIN32_XDRAWLINE_HACK - XDrawArc(Tk_Display(tkwin),d,gcf, b.x,b.y,b.width,b.height, 300*64,360*64); + XDrawArc(Tk_Display(tkwin),d,gcf, + b.x,b.y,(unsigned)b.width,(unsigned)b.height, 300*64,360*64); #endif } } @@ -355,9 +361,10 @@ CheckIndicatorElementDraw( Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &padding); b = Ttk_PadBox(b, padding); - XFillRectangle(display,d,gcb, b.x,b.y,b.width,b.height); - XDrawLine(display,d,gcl,b.x,b.y+b.height,b.x+b.width+w,b.y+b.height);/*S*/ - XDrawLine(display,d,gcl,b.x+b.width,b.y,b.x+b.width,b.y+b.height+w); /*E*/ + XFillRectangle(display,d,gcb, b.x,b.y, + (unsigned)b.width,(unsigned)b.height); + XDrawLine(display,d,gcl, b.x,b.y+b.height,b.x+b.width+w,b.y+b.height);/*S*/ + XDrawLine(display,d,gcl, b.x+b.width,b.y,b.x+b.width,b.y+b.height+w); /*E*/ XDrawLine(display,d,gcu,b.x,b.y, b.x,b.y+b.height+w); /*W*/ XDrawLine(display,d,gcu,b.x,b.y, b.x+b.width+w,b.y); /*N*/ @@ -586,8 +593,10 @@ static void TroughElementDraw( ScrollbarElement *sb = elementRecord; GC gcb = Ttk_GCForColor(tkwin,sb->borderColorObj,d); GC gct = Ttk_GCForColor(tkwin,sb->troughColorObj,d); - XFillRectangle(Tk_Display(tkwin), d, gct, b.x, b.y, b.width-1, b.height-1); - XDrawRectangle(Tk_Display(tkwin), d, gcb, b.x, b.y, b.width-1, b.height-1); + XFillRectangle(Tk_Display(tkwin), d, gct, b.x, b.y, + (unsigned)b.width-1, (unsigned)b.height-1); + XDrawRectangle(Tk_Display(tkwin), d, gcb, b.x, b.y, + (unsigned)b.width-1, (unsigned)b.height-1); } static Ttk_ElementSpec TroughElementSpec = { @@ -619,10 +628,10 @@ static void ThumbElementDraw( const int w = WIN32_XDRAWLINE_HACK; DrawSmoothBorder(tkwin, d, b, - sb->borderColorObj, sb->lightColorObj, sb->darkColorObj); - XFillRectangle( - Tk_Display(tkwin), d, BackgroundGC(tkwin, sb->backgroundObj), - b.x+2, b.y+2, b.width-4, b.height-4); + sb->borderColorObj, sb->lightColorObj, sb->darkColorObj); + XFillRectangle(Tk_Display(tkwin), d, + BackgroundGC(tkwin, sb->backgroundObj), b.x+2, b.y+2, + (unsigned)b.width-4, (unsigned)b.height-4); /* * Draw grip: @@ -631,7 +640,7 @@ static void ThumbElementDraw( Tcl_GetIntFromObj(NULL, sb->gripCountObj, &gripCount); lightGC = Ttk_GCForColor(tkwin,sb->lightColorObj,d); darkGC = Ttk_GCForColor(tkwin,sb->borderColorObj,d); - + if (orient == TTK_ORIENT_HORIZONTAL) { dx = 1; dy = 0; x1 = x2 = b.x + b.width / 2 - gripCount; @@ -709,14 +718,14 @@ static void PbarElementDraw( Drawable d, Ttk_Box b, unsigned state) { ScrollbarElement *sb = elementRecord; - + b = Ttk_PadBox(b, Ttk_UniformPadding(2)); if (b.width > 4 && b.height > 4) { DrawSmoothBorder(tkwin, d, b, - sb->borderColorObj, sb->lightColorObj, sb->darkColorObj); - XFillRectangle(Tk_Display(tkwin), d, - BackgroundGC(tkwin, sb->backgroundObj), - b.x+2, b.y+2, b.width-4, b.height-4); + sb->borderColorObj, sb->lightColorObj, sb->darkColorObj); + XFillRectangle(Tk_Display(tkwin), d, + BackgroundGC(tkwin, sb->backgroundObj), + b.x+2, b.y+2, (unsigned)b.width-4, (unsigned)b.height-4); } } @@ -754,11 +763,11 @@ static void ArrowElementDraw( int h, cx, cy; DrawSmoothBorder(tkwin, d, b, - sb->borderColorObj, sb->lightColorObj, sb->darkColorObj); + sb->borderColorObj, sb->lightColorObj, sb->darkColorObj); XFillRectangle( - Tk_Display(tkwin), d, BackgroundGC(tkwin, sb->backgroundObj), - b.x+2, b.y+2, b.width-4, b.height-4); + Tk_Display(tkwin), d, BackgroundGC(tkwin, sb->backgroundObj), + b.x+2, b.y+2, (unsigned)b.width-4, (unsigned)b.height-4); b = Ttk_PadBox(b, Ttk_UniformPadding(3)); h = b.width < b.height ? b.width : b.height; diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c index 966451e..c27591c 100644 --- a/generic/ttk/ttkDefaultTheme.c +++ b/generic/ttk/ttkDefaultTheme.c @@ -1,4 +1,4 @@ -/* $Id: ttkDefaultTheme.c,v 1.5 2006/11/21 02:21:27 jenglish Exp $ +/* $Id: ttkDefaultTheme.c,v 1.6 2007/01/11 15:35:40 dkf Exp $ * * Copyright (c) 2003, Joe English * @@ -297,8 +297,8 @@ BorderElementDraw( if (defaultState == TTK_BUTTON_DEFAULT_ACTIVE) { GC gc = Tk_GCForColor(borderColor, d); - XDrawRectangle(Tk_Display(tkwin), d, gc, - b.x, b.y, b.width-1, b.height-1); + XDrawRectangle(Tk_Display(tkwin), d, gc, + b.x, b.y, (unsigned)b.width-1, (unsigned)b.height-1); } if (defaultState != TTK_BUTTON_DEFAULT_DISABLED) { /* Space for default ring: */ @@ -578,11 +578,12 @@ static void IndicatorElementDraw( /* * Copy onto our target drawable surface. */ + memset(&gcValues, 0, sizeof(gcValues)); copyGC = Tk_GetGC(tkwin, 0, &gcValues); TkPutImage(NULL, 0, display, d, copyGC, img, 0, 0, b.x, b.y, - spec->width, spec->height); + (unsigned)spec->width, (unsigned)spec->height); /* * Tidy up. @@ -1084,7 +1085,7 @@ static void TreeitemIndicatorDraw( b = Ttk_PadBox(b, padding); XDrawRectangle(Tk_Display(tkwin), d, gc, - b.x, b.y, b.width - 1, b.height - 1); + b.x, b.y, (unsigned)b.width - 1, (unsigned)b.height - 1); cx = b.x + (b.width - 1) / 2; cy = b.y + (b.height - 1) / 2; diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c index 171058a..cb2c5b5 100644 --- a/generic/ttk/ttkElements.c +++ b/generic/ttk/ttkElements.c @@ -1,4 +1,4 @@ -/* $Id: ttkElements.c,v 1.4 2006/12/14 19:51:03 jenglish Exp $ +/* $Id: ttkElements.c,v 1.5 2007/01/11 15:35:40 dkf Exp $ * * Copyright (c) 2003, Joe English * @@ -84,7 +84,7 @@ BackgroundElementDraw( XFillRectangle(Tk_Display(tkwin), d, Tk_3DBorderGC(tkwin, backgroundPtr, TK_3D_FLAT_GC), - 0,0, Tk_Width(tkwin), Tk_Height(tkwin)); + 0,0, (unsigned)Tk_Width(tkwin), (unsigned)Tk_Height(tkwin)); } static Ttk_ElementSpec BackgroundElementSpec = @@ -297,7 +297,8 @@ static void DrawFocusRing( mask = GCForeground | GCLineStyle | GCDashList | GCDashOffset | GCLineWidth; gc = Tk_GetGC(tkwin, mask, &gcvalues); - XDrawRectangle(Tk_Display(tkwin), d, gc, b.x, b.y, b.width-1, b.height-1); + XDrawRectangle(Tk_Display(tkwin), d, gc, b.x, b.y, + (unsigned)b.width-1, (unsigned)b.height-1); Tk_FreeGC(Tk_Display(tkwin), gc); } diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index 1d4d765..6ac910a 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -1,5 +1,5 @@ /* - * $Id: ttkEntry.c,v 1.6 2007/01/11 14:49:47 jenglish Exp $ + * $Id: ttkEntry.c,v 1.7 2007/01/11 15:35:40 dkf Exp $ * * DERIVED FROM: tk/generic/tkEntry.c r1.35. * @@ -293,7 +293,7 @@ static char *EntryDisplayString(const char *showChar, int numChars) Tcl_UtfToUniChar(showChar, &ch); size = Tcl_UniCharToUtf(ch, buf); - p = displayString = ckalloc(numChars * size + 1); + p = displayString = ckalloc((unsigned)numChars * size + 1); while (numChars--) { p += Tcl_UniCharToUtf(ch, p); @@ -710,7 +710,7 @@ static void EntryStoreValue(Entry *entryPtr, const char *value) { size_t numBytes = strlen(value); - int numChars = Tcl_NumUtfChars(value, numBytes); + int numChars = Tcl_NumUtfChars(value, (int)numBytes); if (entryPtr->core.flags & VALIDATING) entryPtr->core.flags |= VALIDATION_SET_VALUE; @@ -811,7 +811,7 @@ InsertChars( char *string = entryPtr->entry.string; size_t byteIndex = Tcl_UtfAtIndex(string, index) - string; size_t byteCount = strlen(value); - int charsAdded = Tcl_NumUtfChars(value, byteCount); + int charsAdded = Tcl_NumUtfChars(value, (int)byteCount); size_t newByteCount = entryPtr->entry.numBytes + byteCount + 1; char *new; int code; @@ -1245,8 +1245,9 @@ static void EntryDisplay(void *clientData, Drawable d) Tk_SetCaretPos(tkwin, cursorX, cursorY, cursorHeight); gc = EntryGetGC(entryPtr, es.insertColorObj); - XFillRectangle(Tk_Display(tkwin), d, gc, - cursorX-cursorWidth/2, cursorY, cursorWidth, cursorHeight); + XFillRectangle(Tk_Display(tkwin), d, gc, + cursorX-cursorWidth/2, cursorY, + (unsigned)cursorWidth, (unsigned)cursorHeight); Tk_FreeGC(Tk_Display(tkwin), gc); } @@ -1297,13 +1298,13 @@ EntryIndex( int length; const char *string = Tcl_GetStringFromObj(indexObj, &length); - if (strncmp(string, "end", length) == 0) { + if (strncmp(string, "end", (unsigned) length) == 0) { *indexPtr = entryPtr->entry.numChars; - } else if (strncmp(string, "insert", length) == 0) { + } else if (strncmp(string, "insert", (unsigned) length) == 0) { *indexPtr = entryPtr->entry.insertPos; - } else if (strncmp(string, "left", length) == 0) { /* for debugging */ + } else if (strncmp(string, "left", (unsigned) length) == 0) { /* for debugging */ *indexPtr = entryPtr->entry.xscroll.first; - } else if (strncmp(string, "right", length) == 0) { /* for debugging */ + } else if (strncmp(string, "right", (unsigned) length) == 0) { /* for debugging */ *indexPtr = entryPtr->entry.xscroll.last; } else if (strncmp(string, "sel.", 4) == 0) { if (entryPtr->entry.selectFirst < 0) { @@ -1312,9 +1313,9 @@ EntryIndex( Tk_PathName(entryPtr->core.tkwin), NULL); return TCL_ERROR; } - if (strncmp(string, "sel.first", length) == 0) { + if (strncmp(string, "sel.first", (unsigned) length) == 0) { *indexPtr = entryPtr->entry.selectFirst; - } else if (strncmp(string, "sel.last", length) == 0) { + } else if (strncmp(string, "sel.last", (unsigned) length) == 0) { *indexPtr = entryPtr->entry.selectLast; } else { goto badIndex; diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c index 777c10b..debe10c 100644 --- a/generic/ttk/ttkLabel.c +++ b/generic/ttk/ttkLabel.c @@ -1,4 +1,4 @@ -/* $Id: ttkLabel.c,v 1.5 2006/12/25 17:16:28 jenglish Exp $ +/* $Id: ttkLabel.c,v 1.6 2007/01/11 15:35:40 dkf Exp $ * * text, image, and label elements. * @@ -233,7 +233,8 @@ static void ImageTextElementDraw( return; XFillRectangle(Tk_Display(tkwin), d, - Tk_3DBorderGC(tkwin, bd, TK_3D_FLAT_GC), b.x, b.y, b.width, b.height); + Tk_3DBorderGC(tkwin, bd, TK_3D_FLAT_GC), b.x, b.y, + (unsigned)b.width, (unsigned)b.height); TextDraw(text, tkwin, d, b); TextCleanup(text); @@ -334,7 +335,8 @@ static void StippleOver( gcvalues.fill_style = FillStippled; gcvalues.stipple = stipple; gc = Tk_GetGC(tkwin, mask, &gcvalues); - XFillRectangle(Tk_Display(tkwin),d,gc,x,y,image->width,image->height); + XFillRectangle(Tk_Display(tkwin),d,gc,x,y, + (unsigned)image->width,(unsigned)image->height); Tk_FreeGC(Tk_Display(tkwin), gc); Tk_FreeBitmapFromObj(tkwin, image->stippleObj); } diff --git a/generic/ttk/ttkLayout.c b/generic/ttk/ttkLayout.c index ef4f7b1..55e29f2 100644 --- a/generic/ttk/ttkLayout.c +++ b/generic/ttk/ttkLayout.c @@ -5,7 +5,7 @@ * * Copyright (c) 2003 Joe English. Freely redistributable. * - * $Id: ttkLayout.c,v 1.5 2006/12/10 19:19:44 jenglish Exp $ + * $Id: ttkLayout.c,v 1.6 2007/01/11 15:35:40 dkf Exp $ */ #include <string.h> @@ -1073,7 +1073,7 @@ static void Ttk_DrawNodeList( for (; node; node = node->next) { int border = node->flags & TTK_BORDER; - int substate = state; + Ttk_State substate = state; if (node->flags & TTK_UNIT) substate |= node->state; diff --git a/generic/ttk/ttkManager.c b/generic/ttk/ttkManager.c index e41b36d..378e3cc 100644 --- a/generic/ttk/ttkManager.c +++ b/generic/ttk/ttkManager.c @@ -1,4 +1,4 @@ -/* $Id: ttkManager.c,v 1.1 2006/10/31 01:42:26 hobbs Exp $ +/* $Id: ttkManager.c,v 1.2 2007/01/11 15:35:40 dkf Exp $ * * Copyright 2005, Joe English. Freely redistributable. * @@ -121,7 +121,7 @@ static void ManagerIdleProc(ClientData clientData) * Recompute slave layout when master widget is resized. * Keep the slave's map state in sync with the master's. */ -static const int ManagerEventMask = StructureNotifyMask; +static const unsigned ManagerEventMask = StructureNotifyMask; static void ManagerEventHandler(ClientData clientData, XEvent *eventPtr) { Ttk_Manager *mgr = clientData; @@ -221,16 +221,16 @@ Ttk_Manager *Ttk_CreateManager( mgr->slaves = NULL; mgr->flags = 0; - Tk_CreateEventHandler( - mgr->masterWindow, ManagerEventMask, ManagerEventHandler, mgr); + Tk_CreateEventHandler(mgr->masterWindow, ManagerEventMask, + ManagerEventHandler, mgr); return mgr; } void Ttk_DeleteManager(Ttk_Manager *mgr) { - Tk_DeleteEventHandler( - mgr->masterWindow, ManagerEventMask, ManagerEventHandler, mgr); + Tk_DeleteEventHandler(mgr->masterWindow, ManagerEventMask, + ManagerEventHandler, mgr); while (mgr->nSlaves > 0) { Ttk_ForgetSlave(mgr, mgr->nSlaves - 1); @@ -386,12 +386,12 @@ int Ttk_ConfigureSlave( /* ASSERT: mgr->slaveOptionTable != NULL */ if (Tk_SetOptions(interp, slave->slaveData, mgr->slaveOptionTable, - objc, objv, slave->slaveWindow, &savedOptions, &mask) != TCL_OK) - { + objc, objv, slave->slaveWindow, &savedOptions, &mask) != TCL_OK) { return TCL_ERROR; } - if (mgr->managerSpec->SlaveConfigured(interp,mgr,slave,mask) != TCL_OK) { + if (mgr->managerSpec->SlaveConfigured(interp, mgr, slave, + (unsigned)mask) != TCL_OK) { Tk_RestoreSavedOptions(&savedOptions); return TCL_ERROR; } diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index cd5847e..43aa541 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -1,4 +1,4 @@ -/* $Id: ttkNotebook.c,v 1.6 2007/01/11 14:49:47 jenglish Exp $ +/* $Id: ttkNotebook.c,v 1.7 2007/01/11 15:35:40 dkf Exp $ * Copyright (c) 2004, Joe English * * NOTE-ACTIVE: activeTabIndex is not always correct (it's @@ -672,18 +672,15 @@ static Ttk_ManagerSpec NotebookManagerSpec = /* NotebookEventHandler -- * Tracks the active tab. */ -static const int NotebookEventMask - = StructureNotifyMask - | PointerMotionMask - | LeaveWindowMask - ; +static const unsigned NotebookEventMask = + StructureNotifyMask | PointerMotionMask | LeaveWindowMask; static void NotebookEventHandler(ClientData clientData, XEvent *eventPtr) { Notebook *nb = clientData; if (eventPtr->type == DestroyNotify) { /* Remove self */ - Tk_DeleteEventHandler(nb->core.tkwin, - NotebookEventMask, NotebookEventHandler, clientData); + Tk_DeleteEventHandler(nb->core.tkwin, NotebookEventMask, + NotebookEventHandler, clientData); } else if (eventPtr->type == MotionNotify) { int index = IdentifyTab(nb, eventPtr->xmotion.x, eventPtr->xmotion.y); ActivateTab(nb, index); diff --git a/generic/ttk/ttkTagSet.c b/generic/ttk/ttkTagSet.c index dd4d3a4..ce776b6 100644 --- a/generic/ttk/ttkTagSet.c +++ b/generic/ttk/ttkTagSet.c @@ -1,4 +1,4 @@ -/* $Id: ttkTagSet.c,v 1.1 2006/10/31 01:42:26 hobbs Exp $ +/* $Id: ttkTagSet.c,v 1.2 2007/01/11 15:35:40 dkf Exp $ * * Ttk widget set: tag tables. Half-baked, work in progress. * @@ -31,8 +31,8 @@ struct TtkTagTable { static Ttk_Tag NewTag(Ttk_TagTable tagTable) { Ttk_Tag tag = (Ttk_Tag)ckalloc(sizeof(*tag)); - tag->tagRecord = (Tcl_Obj **)ckalloc(tagTable->tagRecordSize); - memset(tag->tagRecord, 0, tagTable->tagRecordSize); + tag->tagRecord = (Tcl_Obj **)ckalloc((unsigned) tagTable->tagRecordSize); + memset(tag->tagRecord, 0, (unsigned) tagTable->tagRecordSize); return tag; } diff --git a/generic/ttk/ttkTheme.c b/generic/ttk/ttkTheme.c index 305445d..f1c4e9f 100644 --- a/generic/ttk/ttkTheme.c +++ b/generic/ttk/ttkTheme.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * $Id: ttkTheme.c,v 1.4 2006/12/10 19:19:44 jenglish Exp $ + * $Id: ttkTheme.c,v 1.5 2007/01/11 15:35:40 dkf Exp $ */ #include <stdlib.h> @@ -1015,7 +1015,7 @@ int InitializeElementRecord( *dest = styleDefault ? styleDefault : elementDefault; } - if (!AllocateResource(cache, tkwin, dest, elementOption->type)) { + if (!AllocateResource(cache, tkwin, dest, (int) elementOption->type)) { return 0; } } diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index 07a1b71..a7a9b18 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -1,4 +1,4 @@ -/* $Id: ttkTreeview.c,v 1.12 2007/01/11 14:49:47 jenglish Exp $ +/* $Id: ttkTreeview.c,v 1.13 2007/01/11 15:35:40 dkf Exp $ * Copyright (c) 2004, Joe English * * ttk::treeview widget implementation. @@ -1012,7 +1012,7 @@ static int TreeviewInitialize(Tcl_Interp *interp, void *recordPtr) tv->tree.nColumns = tv->tree.nDisplayColumns = 0; tv->tree.columns = NULL; tv->tree.displayColumns = NULL; - tv->tree.showFlags = ~0; + tv->tree.showFlags = ~(unsigned)0; InitColumn(&tv->tree.column0); Tk_InitOptions( @@ -3180,7 +3180,7 @@ static void RowElementDraw( XColor *color = Tk_GetColorFromObj(tkwin, row->backgroundObj); GC gc = Tk_GCForColor(color, d); XFillRectangle(Tk_Display(tkwin), d, gc, - b.x, b.y, b.width, b.height); + b.x, b.y, (unsigned)b.width, (unsigned)b.height); } static Ttk_ElementSpec RowElementSpec = |