summaryrefslogtreecommitdiffstats
path: root/generic/tkFileFilter.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2011-03-12 17:45:37 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2011-03-12 17:45:37 (GMT)
commite0b895874d5fa39f6d4134b407e930b80ee3ecd7 (patch)
tree08a6b50f74f697e9ebc1f689f06d7318c0aa83a2 /generic/tkFileFilter.c
parent77d7867fd5b20233f0fa9163bd8a44d2ac274b0e (diff)
downloadtk-e0b895874d5fa39f6d4134b407e930b80ee3ecd7.zip
tk-e0b895874d5fa39f6d4134b407e930b80ee3ecd7.tar.gz
tk-e0b895874d5fa39f6d4134b407e930b80ee3ecd7.tar.bz2
Remove casts from uses of ckalloc/ckfree/... now that Tcl declares them to be
using useful casts internally.
Diffstat (limited to 'generic/tkFileFilter.c')
-rw-r--r--generic/tkFileFilter.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/generic/tkFileFilter.c b/generic/tkFileFilter.c
index b8e8101..170b0b7 100644
--- a/generic/tkFileFilter.c
+++ b/generic/tkFileFilter.c
@@ -303,7 +303,7 @@ AddClause(
* Add the clause into the list of clauses
*/
- clausePtr = (FileFilterClause *) ckalloc(sizeof(FileFilterClause));
+ clausePtr = ckalloc(sizeof(FileFilterClause));
clausePtr->patterns = NULL;
clausePtr->patternsTail = NULL;
clausePtr->macTypes = NULL;
@@ -319,8 +319,7 @@ AddClause(
if (globCount > 0 && globList != NULL) {
for (i=0; i<globCount; i++) {
- GlobPattern *globPtr = (GlobPattern *)
- ckalloc(sizeof(GlobPattern));
+ GlobPattern *globPtr = ckalloc(sizeof(GlobPattern));
int len;
const char *str = Tcl_GetStringFromObj(globList[i], &len);
@@ -330,12 +329,12 @@ AddClause(
* Prepend a "*" to patterns that do not have a leading "*"
*/
- globPtr->pattern = ckalloc((unsigned) len+1);
+ globPtr->pattern = ckalloc(len + 1);
globPtr->pattern[0] = '*';
strcpy(globPtr->pattern+1, str);
} else if (isWindows) {
if (strcmp(str, "*") == 0) {
- globPtr->pattern = ckalloc(4 * sizeof(char));
+ globPtr->pattern = ckalloc(4);
strcpy(globPtr->pattern, "*.*");
} else if (strcmp(str, "") == 0) {
/*
@@ -344,14 +343,14 @@ AddClause(
* TODO: "*." actually matches with all files on Win95
*/
- globPtr->pattern = ckalloc(3 * sizeof(char));
+ globPtr->pattern = ckalloc(3);
strcpy(globPtr->pattern, "*.");
} else {
- globPtr->pattern = ckalloc((unsigned) len);
+ globPtr->pattern = ckalloc(len);
strcpy(globPtr->pattern, str);
}
} else {
- globPtr->pattern = ckalloc((unsigned) len);
+ globPtr->pattern = ckalloc(len);
strcpy(globPtr->pattern, str);
}
@@ -375,7 +374,7 @@ AddClause(
for (i=0; i<ostypeCount; i++) {
Tcl_DString osTypeDS;
int len;
- MacFileType *mfPtr = (MacFileType *) ckalloc(sizeof(MacFileType));
+ MacFileType *mfPtr = ckalloc(sizeof(MacFileType));
const char *strType = Tcl_GetStringFromObj(ostypeList[i], &len);
char *string;
@@ -444,11 +443,11 @@ GetFilter(
}
}
- filterPtr = (FileFilter *) ckalloc(sizeof(FileFilter));
+ filterPtr = ckalloc(sizeof(FileFilter));
filterPtr->clauses = NULL;
filterPtr->clausesTail = NULL;
len = strlen(name) + 1;
- filterPtr->name = ckalloc((unsigned) len);
+ filterPtr->name = ckalloc(len);
memcpy(filterPtr->name, name, len);
if (flistPtr->filters == NULL) {