diff options
author | nijtmans <nijtmans> | 2008-11-02 09:54:02 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2008-11-02 09:54:02 (GMT) |
commit | 3f4d370ae15172753a938aad0c06ab185d04c1f1 (patch) | |
tree | b014c8108a140f535206360d6933a9d1d81e4d60 /generic | |
parent | 29597ea689d5780ba013bc4c4d5035bd015a295b (diff) | |
download | tk-3f4d370ae15172753a938aad0c06ab185d04c1f1.zip tk-3f4d370ae15172753a938aad0c06ab185d04c1f1.tar.gz tk-3f4d370ae15172753a938aad0c06ab185d04c1f1.tar.bz2 |
more internal -Wwrite-strings warning fixes
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkFont.c | 38 | ||||
-rw-r--r-- | generic/tkFont.h | 10 | ||||
-rw-r--r-- | generic/ttk/ttkDefaultTheme.c | 24 | ||||
-rw-r--r-- | generic/ttk/ttkState.c | 6 | ||||
-rw-r--r-- | generic/ttk/ttkTheme.h | 6 |
5 files changed, 42 insertions, 42 deletions
diff --git a/generic/tkFont.c b/generic/tkFont.c index 4caace0..a0fac74 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.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: tkFont.c,v 1.47 2008/10/15 06:41:06 nijtmans Exp $ + * RCS: @(#) $Id: tkFont.c,v 1.48 2008/11/02 09:54:02 nijtmans Exp $ */ #include "tkInt.h" @@ -190,27 +190,27 @@ static const char *const fontOpt[] = { * the alias list are also automatically tried. */ -static char *timesAliases[] = { +static const char *const timesAliases[] = { "Times", /* Unix. */ "Times New Roman", /* Windows. */ "New York", /* Mac. */ NULL }; -static char *helveticaAliases[] = { +static const char *const helveticaAliases[] = { "Helvetica", /* Unix. */ "Arial", /* Windows. */ "Geneva", /* Mac. */ NULL }; -static char *courierAliases[] = { +static const char *const courierAliases[] = { "Courier", /* Unix and Mac. */ "Courier New", /* Windows. */ NULL }; -static char *minchoAliases[] = { +static const char *const minchoAliases[] = { "mincho", /* Unix. */ "\357\274\255\357\274\263 \346\230\216\346\234\235", /* Windows (MS mincho). */ @@ -219,7 +219,7 @@ static char *minchoAliases[] = { NULL }; -static char *gothicAliases[] = { +static const char *const gothicAliases[] = { "gothic", /* Unix. */ "\357\274\255\357\274\263 \343\202\264\343\202\267\343\203\203\343\202\257", /* Windows (MS goshikku). */ @@ -228,7 +228,7 @@ static char *gothicAliases[] = { NULL }; -static char *dingbatsAliases[] = { +static const char *const dingbatsAliases[] = { "dingbats", "zapfdingbats", "itc zapfdingbats", /* Unix. */ /* Windows. */ @@ -236,7 +236,7 @@ static char *dingbatsAliases[] = { NULL }; -static char **fontAliases[] = { +static const char *const *const fontAliases[] = { timesAliases, helveticaAliases, courierAliases, @@ -252,7 +252,7 @@ static char **fontAliases[] = { * be examined also. */ -static char *systemClass[] = { +static const char *const systemClass[] = { "fixed", /* Unix. */ /* Windows. */ "chicago", "osaka", "sistemny", @@ -260,7 +260,7 @@ static char *systemClass[] = { NULL }; -static char *serifClass[] = { +static const char *const serifClass[] = { "times", "palatino", "mincho", /* All platforms. */ "song ti", /* Unix. */ @@ -270,7 +270,7 @@ static char *serifClass[] = { NULL }; -static char *sansClass[] = { +static const char *const sansClass[] = { "helvetica", "gothic", /* All platforms. */ /* Unix. */ "ms sans serif", "traditional arabic", @@ -279,7 +279,7 @@ static char *sansClass[] = { NULL }; -static char *monoClass[] = { +static const char *const monoClass[] = { "courier", "gothic", /* All platforms. */ "fangsong ti", /* Unix. */ "simplified arabic fixed", /* Windows. */ @@ -287,11 +287,11 @@ static char *monoClass[] = { NULL }; -static char *symbolClass[] = { +static const char *const symbolClass[] = { "symbol", "dingbats", "wingdings", NULL }; -static char **fontFallbacks[] = { +static const char *const *const fontFallbacks[] = { systemClass, serifClass, sansClass, @@ -306,7 +306,7 @@ static char **fontFallbacks[] = { * found, all font families in the system are examined. */ -static char *globalFontClass[] = { +static const char *const globalFontClass[] = { "symbol", /* All platforms. */ /* Unix. */ "lucida sans unicode", /* Windows. */ @@ -3674,7 +3674,7 @@ TkFontGetPoints( *------------------------------------------------------------------------- */ -char ** +const char *const * TkFontGetAliasList( const char *faceName) /* Font name to test for aliases. */ { @@ -3707,7 +3707,7 @@ TkFontGetAliasList( *------------------------------------------------------------------------- */ -char *** +const char *const *const * TkFontGetFallbacks(void) { return fontFallbacks; @@ -3732,7 +3732,7 @@ TkFontGetFallbacks(void) *------------------------------------------------------------------------- */ -char ** +const char *const * TkFontGetGlobalClass(void) { return globalFontClass; @@ -3755,7 +3755,7 @@ TkFontGetGlobalClass(void) *------------------------------------------------------------------------- */ -char ** +const char *const * TkFontGetSymbolClass(void) { return symbolClass; diff --git a/generic/tkFont.h b/generic/tkFont.h index 1253700..078e151 100644 --- a/generic/tkFont.h +++ b/generic/tkFont.h @@ -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: tkFont.h,v 1.11 2008/05/02 10:28:18 dkf Exp $ + * RCS: @(#) $Id: tkFont.h,v 1.12 2008/11/02 09:54:02 nijtmans Exp $ */ #ifndef _TKFONT @@ -197,12 +197,12 @@ typedef struct TkXLFDAttributes { MODULE_SCOPE int TkFontParseXLFD(const char *string, TkFontAttributes *faPtr, TkXLFDAttributes *xaPtr); -MODULE_SCOPE char ** TkFontGetAliasList(const char *faceName); -MODULE_SCOPE char *** TkFontGetFallbacks(void); +MODULE_SCOPE CONST86 char *CONST86 * TkFontGetAliasList(const char *faceName); +MODULE_SCOPE CONST86 char *CONST86 *CONST86 * TkFontGetFallbacks(void); MODULE_SCOPE int TkFontGetPixels(Tk_Window tkwin, int size); MODULE_SCOPE int TkFontGetPoints(Tk_Window tkwin, int size); -MODULE_SCOPE char ** TkFontGetGlobalClass(void); -MODULE_SCOPE char ** TkFontGetSymbolClass(void); +MODULE_SCOPE CONST86 char *CONST86 * TkFontGetGlobalClass(void); +MODULE_SCOPE CONST86 char *CONST86 * TkFontGetSymbolClass(void); MODULE_SCOPE int TkCreateNamedFont(Tcl_Interp *interp, Tk_Window tkwin, const char *name, TkFontAttributes *faPtr); MODULE_SCOPE int TkDeleteNamedFont(Tcl_Interp *interp, diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c index c8558af..95b4e38 100644 --- a/generic/ttk/ttkDefaultTheme.c +++ b/generic/ttk/ttkDefaultTheme.c @@ -1,4 +1,4 @@ -/* $Id: ttkDefaultTheme.c,v 1.12 2008/07/04 19:05:04 jenglish Exp $ +/* $Id: ttkDefaultTheme.c,v 1.13 2008/11/02 09:54:02 nijtmans Exp $ * * Copyright (c) 2003, Joe English * @@ -39,7 +39,7 @@ static const int WIN32_XDRAWLINE_HACK = 0; enum BorderColor { FLAT = 1, LITE = 2, DARK = 3, BRDR = 4 }; /* top-left outer, top-left inner, bottom-right inner, bottom-right outer */ -static int shadowColors[6][4] = +static int const shadowColors[6][4] = { { FLAT, FLAT, FLAT, FLAT }, /* TK_RELIEF_FLAT = 0*/ { DARK, LITE, DARK, LITE }, /* TK_RELIEF_GROOVE = 1*/ @@ -50,7 +50,7 @@ static int shadowColors[6][4] = }; /* top-left, bottom-right */ -static int thinShadowColors[6][4] = +static int const thinShadowColors[6][4] = { { FLAT, FLAT }, /* TK_RELIEF_FLAT = 0*/ { DARK, LITE }, /* TK_RELIEF_GROOVE = 1*/ @@ -204,7 +204,7 @@ void TtkArrowSize(int h, ArrowDirection dir, int *widthPtr, int *heightPtr) * TtkDrawArrow, TtkFillArrow -- * Draw an arrow in the indicated direction inside the specified box. */ -/*public*/ +/*public*/ void TtkFillArrow( Display *display, Drawable d, GC gc, Ttk_Box b, ArrowDirection dir) { @@ -214,7 +214,7 @@ void TtkFillArrow( XDrawLines(display, d, gc, points, 4, CoordModeOrigin); } -/*public*/ +/*public*/ void TtkDrawArrow( Display *display, Drawable d, GC gc, Ttk_Box b, ArrowDirection dir) { @@ -296,7 +296,7 @@ static void BorderElementDraw( if (defaultState == TTK_BUTTON_DEFAULT_ACTIVE) { GC gc = Tk_GCForColor(borderColor, d); - XDrawRectangle(Tk_Display(tkwin), d, gc, + XDrawRectangle(Tk_Display(tkwin), d, gc, b.x, b.y, b.width-1, b.height-1); } if (defaultState != TTK_BUTTON_DEFAULT_DISABLED) { @@ -379,13 +379,13 @@ typedef struct int width; /* Width of each image */ int height; /* Height of each image */ int nimages; /* #images / row */ - char **pixels; /* array[height] of char[width*nimage] */ + const char *const *pixels; /* array[height] of char[width*nimage] */ Ttk_StateTable *map;/* used to look up image index by state */ } IndicatorSpec; #if 0 /*XPM*/ -static char *button_images[] = { +static const char *const button_images[] = { /* width height ncolors chars_per_pixel */ "52 26 7 1", /* colors */ @@ -408,7 +408,7 @@ static Ttk_StateTable checkbutton_states[] = { 3, TTK_STATE_SELECTED|TTK_STATE_DISABLED, 0 }, { 0, 0, 0 } }; -static char *checkbutton_pixels[] = { +static const char *const checkbutton_pixels[] = { "AAAAAAAAAAAABAAAAAAAAAAAABAAAAAAAAAAAABAAAAAAAAAAAAB", "AEEEEEEEEEECBAEEEEEEEEEECBAEEEEEEEEEECBAEEEEEEEEEECB", "AEDDDDDDDDDCBAEDDDDDDDDDCBAEFFFFFFFFFCBAEFFFFFFFFFCB", @@ -440,7 +440,7 @@ static Ttk_StateTable radiobutton_states[] = { 0, 0, 0 } }; -static char *radiobutton_pixels[] = { +static const char *const radiobutton_pixels[] = { "FFFFAAAAFFFFFFFFFAAAAFFFFFFFFFAAAAFFFFFFFFFAAAAFFFFF", "FFAAEEEEAAFFFFFAAEEEEAAFFFFFAAEEEEAAFFFFFAAEEEEAAFFF", "FAEEDDDDECBFFFAEEDDDDECBFFFAEEFFFFECBFFFAEEFFFFECBFF", @@ -621,9 +621,9 @@ static Ttk_ElementOptionSpec ArrowElementOptions[] = { { "-arrowsize", TK_OPTION_PIXELS, Tk_Offset(ArrowElement,sizeObj), STRINGIFY(SCROLLBAR_WIDTH) }, - { "-background", TK_OPTION_BORDER, + { "-background", TK_OPTION_BORDER, Tk_Offset(ArrowElement,borderObj), DEFAULT_BACKGROUND }, - { "-bordercolor", TK_OPTION_COLOR, + { "-bordercolor", TK_OPTION_COLOR, Tk_Offset(ArrowElement,borderColorObj), "black" }, { "-relief", TK_OPTION_RELIEF, Tk_Offset(ArrowElement,reliefObj),"raised"}, diff --git a/generic/ttk/ttkState.c b/generic/ttk/ttkState.c index 8923fa6..29a526d 100644 --- a/generic/ttk/ttkState.c +++ b/generic/ttk/ttkState.c @@ -1,5 +1,5 @@ /* - * $Id: ttkState.c,v 1.1 2006/10/31 01:42:26 hobbs Exp $ + * $Id: ttkState.c,v 1.2 2008/11/02 09:54:02 nijtmans Exp $ * * Tk widget state utilities. * @@ -16,7 +16,7 @@ * Table of state names. Must be kept in sync with TTK_STATE_* * #defines in ttkTheme.h. */ -static const char *stateNames[] = +static const char *const stateNames[] = { "active", /* Mouse cursor is over widget or element */ "disabled", /* Widget is disabled */ @@ -219,7 +219,7 @@ Tcl_Obj *Ttk_StateMapLookup( /* Ttk_GetStateMapFromObj -- * Returns a Ttk_StateMap from a Tcl_Obj*. - * Since a Ttk_StateMap is just a specially-formatted Tcl_Obj, + * Since a Ttk_StateMap is just a specially-formatted Tcl_Obj, * this basically just checks for errors. */ Ttk_StateMap Ttk_GetStateMapFromObj( diff --git a/generic/ttk/ttkTheme.h b/generic/ttk/ttkTheme.h index c5de39b..f054181 100644 --- a/generic/ttk/ttkTheme.h +++ b/generic/ttk/ttkTheme.h @@ -1,4 +1,4 @@ -/* $Id: ttkTheme.h,v 1.14 2008/05/23 20:20:05 jenglish Exp $ +/* $Id: ttkTheme.h,v 1.15 2008/11/02 09:54:02 nijtmans Exp $ * Copyright (c) 2003 Joe English. Freely redistributable. * * Declarations for Tk theme engine. @@ -236,10 +236,10 @@ typedef void (Ttk_ElementDrawProc)(void *clientData, void *elementRecord, typedef struct Ttk_ElementOptionSpec { - char *optionName; /* Command-line name of the widget option */ + const char *optionName; /* Command-line name of the widget option */ Tk_OptionType type; /* Accepted option types */ int offset; /* Offset of Tcl_Obj* field in element record */ - char *defaultValue; /* Default value to used if resource missing */ + const char *defaultValue; /* Default value to used if resource missing */ } Ttk_ElementOptionSpec; #define TK_OPTION_ANY TK_OPTION_STRING |