diff options
author | dgp <dgp@users.sourceforge.net> | 2015-02-12 13:45:52 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2015-02-12 13:45:52 (GMT) |
commit | 186fd507fce8e72ceb25fa41cfe1c65429dd3398 (patch) | |
tree | 76d87a1336cc0ae03ff1717e7404dbbed46f098f /generic | |
parent | df8fe8d77386421fadafe0b14472529c573a3f8b (diff) | |
parent | f0588ea6f1632841dfe7ed350ea5c0e78331882d (diff) | |
download | tk-186fd507fce8e72ceb25fa41cfe1c65429dd3398.zip tk-186fd507fce8e72ceb25fa41cfe1c65429dd3398.tar.gz tk-186fd507fce8e72ceb25fa41cfe1c65429dd3398.tar.bz2 |
Silence some compiler warnings.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkBind.c | 36 | ||||
-rw-r--r-- | generic/tkBitmap.c | 2 | ||||
-rw-r--r-- | generic/tkFont.c | 7 | ||||
-rw-r--r-- | generic/tkInt.decls | 3 | ||||
-rw-r--r-- | generic/tkIntPlatDecls.h | 6 | ||||
-rw-r--r-- | generic/tkStubInit.c | 1 | ||||
-rw-r--r-- | generic/ttk/ttkLabel.c | 2 |
7 files changed, 31 insertions, 26 deletions
diff --git a/generic/tkBind.c b/generic/tkBind.c index 35f2795..9cd3b7b 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -16,9 +16,9 @@ #ifdef _WIN32 #include "tkWinInt.h" -#endif - -#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* UNIX */ +#elif defined(MAC_OSX_TK) +#include "tkMacOSXInt.h" +#else #include "tkUnixInt.h" #endif @@ -167,7 +167,7 @@ typedef struct { * button (0 means any buttons are OK). For * virtual events, specifies the Tk_Uid of the * virtual event name (never 0). */ -} Pattern; +} TkPattern; /* * The following structure defines a pattern sequence, which consists of one @@ -209,7 +209,7 @@ typedef struct PatSeq { * for end of list). Needed to implement * Tk_DeleteAllBindings. In a virtual event * table, always NULL. */ - Pattern pats[1]; /* Array of "numPats" patterns. Only one + TkPattern pats[1]; /* Array of "numPats" patterns. Only one * element is declared here but in actuality * enough space will be allocated for * "numPats" patterns. To match, pats[0] must @@ -636,7 +636,7 @@ static PatSeq * MatchPatterns(TkDisplay *dispPtr, static int NameToWindow(Tcl_Interp *interp, Tk_Window main, Tcl_Obj *objPtr, Tk_Window *tkwinPtr); static int ParseEventDescription(Tcl_Interp *interp, - const char **eventStringPtr, Pattern *patPtr, + const char **eventStringPtr, TkPattern *patPtr, unsigned long *eventMaskPtr); static void DoWarp(ClientData clientData); @@ -1604,7 +1604,7 @@ MatchPatterns( for ( ; psPtr != NULL; psPtr = psPtr->nextSeqPtr) { XEvent *eventPtr = &bindPtr->eventRing[bindPtr->curEvent]; Detail *detailPtr = &bindPtr->detailRing[bindPtr->curEvent]; - Pattern *patPtr = psPtr->pats; + TkPattern *patPtr = psPtr->pats; Window window = eventPtr->xany.window; int patCount, ringCount, flags, state, modMask, i; @@ -1818,7 +1818,7 @@ MatchPatterns( */ if (bestPtr != NULL) { - Pattern *patPtr2; + TkPattern *patPtr2; if (matchPtr->numPats != bestPtr->numPats) { if (bestPtr->numPats > matchPtr->numPats) { @@ -2887,7 +2887,7 @@ HandleEventGenerate( const char *name, *windowName; int count, flags, synch, i, number, warp; Tcl_QueuePosition pos; - Pattern pat; + TkPattern pat; Tk_Window tkwin, tkwin2; TkWindow *mainPtr; unsigned long eventMask; @@ -3626,10 +3626,10 @@ FindSequence( unsigned long *maskPtr) /* *maskPtr is filled in with the event types * on which this pattern sequence depends. */ { - Pattern pats[EVENT_BUFFER_SIZE]; + TkPattern pats[EVENT_BUFFER_SIZE]; int numPats, virtualFound; const char *p; - Pattern *patPtr; + TkPattern *patPtr; PatSeq *psPtr; Tcl_HashEntry *hPtr; int flags, count, isNew; @@ -3715,7 +3715,7 @@ FindSequence( key.type = patPtr->eventType; key.detail = patPtr->detail; hPtr = Tcl_CreateHashEntry(patternTablePtr, (char *) &key, &isNew); - sequenceSize = numPats*sizeof(Pattern); + sequenceSize = numPats*sizeof(TkPattern); if (!isNew) { for (psPtr = Tcl_GetHashValue(hPtr); psPtr != NULL; psPtr = psPtr->nextSeqPtr) { @@ -3741,7 +3741,7 @@ FindSequence( return NULL; } - psPtr = ckalloc(sizeof(PatSeq) + (numPats-1)*sizeof(Pattern)); + psPtr = ckalloc(sizeof(PatSeq) + (numPats-1)*sizeof(TkPattern)); psPtr->numPats = numPats; psPtr->script = NULL; psPtr->flags = flags; @@ -3785,7 +3785,7 @@ ParseEventDescription( const char **eventStringPtr,/* On input, holds a pointer to start of event * string. On exit, gets pointer to rest of * string after parsed event. */ - Pattern *patPtr, /* Filled with the pattern parsed from the + TkPattern *patPtr, /* Filled with the pattern parsed from the * event string. */ unsigned long *eventMaskPtr)/* Filled with event mask of matched event. */ { @@ -4073,7 +4073,7 @@ static Tcl_Obj * GetPatternObj( PatSeq *psPtr) { - Pattern *patPtr; + TkPattern *patPtr; int patsLeft, needMods; const ModInfo *modPtr; const EventInfo *eiPtr; @@ -4121,15 +4121,15 @@ GetPatternObj( Tcl_AppendToObj(patternObj, "<", 1); if ((psPtr->flags & PAT_NEARBY) && (patsLeft > 1) - && (memcmp(patPtr, patPtr-1, sizeof(Pattern)) == 0)) { + && (memcmp(patPtr, patPtr-1, sizeof(TkPattern)) == 0)) { patsLeft--; patPtr--; if ((patsLeft > 1) && - (memcmp(patPtr, patPtr-1, sizeof(Pattern)) == 0)) { + (memcmp(patPtr, patPtr-1, sizeof(TkPattern)) == 0)) { patsLeft--; patPtr--; if ((patsLeft > 1) && - (memcmp(patPtr, patPtr-1, sizeof(Pattern)) == 0)) { + (memcmp(patPtr, patPtr-1, sizeof(TkPattern)) == 0)) { patsLeft--; patPtr--; Tcl_AppendToObj(patternObj, "Quadruple-", 10); diff --git a/generic/tkBitmap.c b/generic/tkBitmap.c index 729fff4..88f3e2b 100644 --- a/generic/tkBitmap.c +++ b/generic/tkBitmap.c @@ -305,7 +305,7 @@ GetBitmap( TkBitmap *bitmapPtr, *existingBitmapPtr; TkPredefBitmap *predefPtr; Pixmap bitmap; - int isNew, width, height, dummy2; + int isNew, width = 0, height = 0, dummy2; TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr; ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); diff --git a/generic/tkFont.c b/generic/tkFont.c index 722d16f..447f9e1 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -2994,13 +2994,6 @@ PointInQuadrilateral( } static inline int -sign( - double value) -{ - return (value < 0.0) ? -1 : (value > 0.0) ? 1 : 0; -} - -static inline int SidesIntersect( double ax1, double ay1, double ax2, double ay2, double bx1, double by1, double bx2, double by2) diff --git a/generic/tkInt.decls b/generic/tkInt.decls index b9356d2..ebbadba 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -1032,6 +1032,9 @@ declare 53 aqua { declare 54 aqua { void *TkMacOSXDrawable(Drawable drawable) } +declare 55 aqua { + int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr) +} ############################################################################## diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index 15ed775..3a2a8aa 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -255,6 +255,9 @@ EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin); EXTERN unsigned long TkpGetMS(void); /* 54 */ EXTERN void * TkMacOSXDrawable(Drawable drawable); +/* 55 */ +EXTERN int TkpScanWindowId(Tcl_Interp *interp, + const char *string, Window *idPtr); #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ /* 0 */ @@ -395,6 +398,7 @@ typedef struct TkIntPlatStubs { void (*reserved52)(void); unsigned long (*tkpGetMS) (void); /* 53 */ void * (*tkMacOSXDrawable) (Drawable drawable); /* 54 */ + int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 55 */ #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ void (*tkCreateXEventSource) (void); /* 0 */ @@ -622,6 +626,8 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; (tkIntPlatStubsPtr->tkpGetMS) /* 53 */ #define TkMacOSXDrawable \ (tkIntPlatStubsPtr->tkMacOSXDrawable) /* 54 */ +#define TkpScanWindowId \ + (tkIntPlatStubsPtr->tkpScanWindowId) /* 55 */ #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ #define TkCreateXEventSource \ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 5a3e1ce..f621d82 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -559,6 +559,7 @@ static const TkIntPlatStubs tkIntPlatStubs = { 0, /* 52 */ TkpGetMS, /* 53 */ TkMacOSXDrawable, /* 54 */ + TkpScanWindowId, /* 55 */ #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ TkCreateXEventSource, /* 0 */ diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c index d51388b..1037840 100644 --- a/generic/ttk/ttkLabel.c +++ b/generic/ttk/ttkLabel.c @@ -293,6 +293,7 @@ static void ImageCleanup(ImageElement *image) TtkFreeImageSpec(image->imageSpec); } +#ifndef MAC_OSX_TK /* * StippleOver -- * Draw a stipple over the image area, to make it look "grayed-out" @@ -317,6 +318,7 @@ static void StippleOver( Tk_FreeBitmapFromObj(tkwin, image->stippleObj); } } +#endif static void ImageDraw( ImageElement *image, Tk_Window tkwin,Drawable d,Ttk_Box b,Ttk_State state) |