diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-06-21 12:40:03 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-06-21 12:40:03 (GMT) |
commit | f8f745fe34d10d25ff1fe4e0935e042b5347004c (patch) | |
tree | 9c355cadff877ea414117cc5bd58d9488cab17bb /generic | |
parent | 8fb0a9c7c1a87f04f3a5ef5da5d68630709a23b4 (diff) | |
download | tk-f8f745fe34d10d25ff1fe4e0935e042b5347004c.zip tk-f8f745fe34d10d25ff1fe4e0935e042b5347004c.tar.gz tk-f8f745fe34d10d25ff1fe4e0935e042b5347004c.tar.bz2 |
Eliminate some redundant type-casts
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkCanvText.c | 8 | ||||
-rw-r--r-- | generic/tkFrame.c | 12 | ||||
-rw-r--r-- | generic/tkSelect.c | 2 | ||||
-rw-r--r-- | generic/tkText.c | 2 | ||||
-rw-r--r-- | generic/tkTextMark.c | 4 |
5 files changed, 14 insertions, 14 deletions
diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c index b9607a5..d358fb3 100644 --- a/generic/tkCanvText.c +++ b/generic/tkCanvText.c @@ -1388,13 +1388,13 @@ GetTextIndex( c = string[0]; - if ((c == 'e') && (strncmp(string, "end", (unsigned) length) == 0)) { + if ((c == 'e') && (strncmp(string, "end", length) == 0)) { *indexPtr = textPtr->numChars; } else if ((c == 'i') - && (strncmp(string, "insert", (unsigned) length) == 0)) { + && (strncmp(string, "insert", length) == 0)) { *indexPtr = textPtr->insertPos; } else if ((c == 's') && (length >= 5) - && (strncmp(string, "sel.first", (unsigned) length) == 0)) { + && (strncmp(string, "sel.first", length) == 0)) { if (textInfoPtr->selItemPtr != itemPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "selection isn't in item", -1)); @@ -1403,7 +1403,7 @@ GetTextIndex( } *indexPtr = textInfoPtr->selectFirst; } else if ((c == 's') && (length >= 5) - && (strncmp(string, "sel.last", (unsigned) length) == 0)) { + && (strncmp(string, "sel.last", length) == 0)) { if (textInfoPtr->selItemPtr != itemPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "selection isn't in item", -1)); diff --git a/generic/tkFrame.c b/generic/tkFrame.c index 0edd4c2..746f3eb 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.c @@ -826,17 +826,17 @@ FrameWidgetObjCmd( } c = arg[1]; if (((c == 'c') && (length >= 2) - && (strncmp(arg, "-class", (unsigned)length) == 0)) + && (strncmp(arg, "-class", length) == 0)) || ((c == 'c') && (length >= 3) - && (strncmp(arg, "-colormap", (unsigned)length) == 0)) + && (strncmp(arg, "-colormap", length) == 0)) || ((c == 'c') && (length >= 3) - && (strncmp(arg, "-container", (unsigned)length) == 0)) + && (strncmp(arg, "-container", length) == 0)) || ((c == 's') && (framePtr->type == TYPE_TOPLEVEL) - && (strncmp(arg, "-screen", (unsigned)length) == 0)) + && (strncmp(arg, "-screen", length) == 0)) || ((c == 'u') && (framePtr->type == TYPE_TOPLEVEL) - && (strncmp(arg, "-use", (unsigned)length) == 0)) + && (strncmp(arg, "-use", length) == 0)) || ((c == 'v') - && (strncmp(arg, "-visual", (unsigned)length) == 0))) { + && (strncmp(arg, "-visual", length) == 0))) { #ifdef SUPPORT_CONFIG_EMBEDDED if (c == 'u') { diff --git a/generic/tkSelect.c b/generic/tkSelect.c index 85865de..b2dd0d9 100644 --- a/generic/tkSelect.c +++ b/generic/tkSelect.c @@ -1508,7 +1508,7 @@ TkSelDefaultSelection( Tcl_DStringFree(&ds); return -1; } - memcpy(buffer, Tcl_DStringValue(&ds), (unsigned) (1+length)); + memcpy(buffer, Tcl_DStringValue(&ds), length + 1); Tcl_DStringFree(&ds); *typePtr = XA_ATOM; return length; diff --git a/generic/tkText.c b/generic/tkText.c index 7e09bfd..a738c57 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -6031,7 +6031,7 @@ SearchCore( */ p = startOfLine + lastOffset - firstNewLine - 1; - if (strncmp(p, pattern, (unsigned) firstNewLine + 1)) { + if (strncmp(p, pattern, firstNewLine + 1)) { /* * No match. */ diff --git a/generic/tkTextMark.c b/generic/tkTextMark.c index aca08fb..c516697 100644 --- a/generic/tkTextMark.c +++ b/generic/tkTextMark.c @@ -162,10 +162,10 @@ TkTextMarkCmd( } str = TkGetStringFromObj(objv[4],&length); c = str[0]; - if ((c == 'l') && (strncmp(str, "left", (unsigned) length) == 0)) { + if ((c == 'l') && (strncmp(str, "left", length) == 0)) { newTypePtr = &tkTextLeftMarkType; } else if ((c == 'r') && - (strncmp(str, "right", (unsigned) length) == 0)) { + (strncmp(str, "right", length) == 0)) { newTypePtr = &tkTextRightMarkType; } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( |