diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2019-07-07 13:00:34 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2019-07-07 13:48:44 -0400 |
commit | 6038bd4fd95050f77c18c7cbf9ec2ca9152590af (patch) | |
tree | e410553db8cfb1ef879eae8b2c90cee46dc1b1b3 /src | |
parent | 61df064c511bb93b49a67a2d2b3c4886d650eeda (diff) |
constify table passed to _XtTableAddConverter to reduce strict compiler warnings
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/Alloc.c | 2 | ||||
-rw-r--r-- | src/Convert.c | 2 | ||||
-rw-r--r-- | src/Converters.c | 8 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/Alloc.c b/src/Alloc.c index dd2f616..625120d 100644 --- a/src/Alloc.c +++ b/src/Alloc.c @@ -144,7 +144,7 @@ Cardinal XtAsprintf( _XtAllocError("vsnprintf"); *new_string = XtMalloc((Cardinal) len + 1); /* snprintf doesn't count trailing '\0' */ - if (len < sizeof(buf)) + if ((size_t)len < sizeof(buf)) { strncpy(*new_string, buf, (size_t) len); (*new_string)[len] = '\0'; diff --git a/src/Convert.c b/src/Convert.c index 937a51d..7c00e30 100644 --- a/src/Convert.c +++ b/src/Convert.c @@ -188,7 +188,7 @@ void _XtTableAddConverter( XrmRepresentation from_type, XrmRepresentation to_type, XtTypeConverter converter, - XtConvertArgList convert_args, + XtConvertArgRec const *convert_args, Cardinal num_args, _XtBoolean new_style, XtCacheType cache_type, diff --git a/src/Converters.c b/src/Converters.c index 2f7211e..35bc346 100644 --- a/src/Converters.c +++ b/src/Converters.c @@ -492,7 +492,7 @@ Boolean XtCvtStringToPixel( } status = XAllocNamedColor(DisplayOfScreen(screen), colormap, - (char*)str, &screenColor, &exactColor); + (_Xconst char*)str, &screenColor, &exactColor); if (status == 0) { _Xconst _XtString msg; _Xconst _XtString type; @@ -500,7 +500,7 @@ Boolean XtCvtStringToPixel( params[0] = str; /* Server returns a specific error code but Xlib discards it. Ugh */ - if (XLookupColor(DisplayOfScreen(screen), colormap, (char*)str, + if (XLookupColor(DisplayOfScreen(screen), colormap, (_Xconst char*)str, &exactColor, &screenColor)) { type = "noColormap"; msg = "Cannot allocate colormap entry for \"%s\""; @@ -1784,12 +1784,12 @@ void _XtAddDefaultConverters( { #define Add(from, to, proc, convert_args, num_args, cache) \ _XtTableAddConverter(table, from, to, proc, \ - (XtConvertArgList) convert_args, (Cardinal)num_args, \ + (XtConvertArgRec const*) convert_args, (Cardinal)num_args, \ True, cache, (XtDestructor)NULL, True) #define Add2(from, to, proc, convert_args, num_args, cache, destructor) \ _XtTableAddConverter(table, from, to, proc, \ - (XtConvertArgList) convert_args, (Cardinal)num_args, \ + (XtConvertArgRec const *) convert_args, (Cardinal)num_args, \ True, cache, destructor, True) Add(XtQColor, XtQPixel, XtCvtColorToPixel, NULL, 0, XtCacheNone); |