summaryrefslogtreecommitdiffstats
path: root/kcontrol
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-15 21:36:27 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-15 21:36:27 +0000
commitd54ab5595153b3dc57560077ff3551ffd4406b30 (patch)
tree9c48320521bf9ec3cb310c4046289d5a28ec3213 /kcontrol
parent4b12a38f6e566f44f5549b4a85e3ae9e715e0d08 (diff)
downloadtdebase-d54ab5595153b3dc57560077ff3551ffd4406b30.tar.gz
tdebase-d54ab5595153b3dc57560077ff3551ffd4406b30.zip
Fix a number of issues in kdebase caused by C style casts
This includes Bug #492 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1247425 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcontrol')
-rw-r--r--kcontrol/fonts/kxftconfig.cpp4
-rw-r--r--kcontrol/kfontinst/kfontinst/Fontmap.cpp10
-rw-r--r--kcontrol/kfontinst/kfontinst/XConfig.cpp4
-rw-r--r--kcontrol/samba/ksmbstatus.cpp2
4 files changed, 10 insertions, 10 deletions
diff --git a/kcontrol/fonts/kxftconfig.cpp b/kcontrol/fonts/kxftconfig.cpp
index fa4dc788e..6b7d166db 100644
--- a/kcontrol/fonts/kxftconfig.cpp
+++ b/kcontrol/fonts/kxftconfig.cpp
@@ -1147,7 +1147,7 @@ void KXftConfig::readContents()
if(*ptr=='\"')
{
ptr++;
- if(NULL!=(eostr=(char*)strchr(ptr, '\"')) && eostr-ptr<constMaxDataLen)
+ if(NULL!=(eostr=strchr(ptr, '\"')) && eostr-ptr<constMaxDataLen)
{
memcpy(data, ptr, eostr-ptr);
data[eostr-ptr]='\0';
@@ -1183,7 +1183,7 @@ void KXftConfig::readContents()
if(*ptr=='\"')
{
ptr++;
- if(NULL!=(eostr=(char*)strchr(ptr, '\"')) && eostr-ptr<constMaxDataLen)
+ if(NULL!=(eostr=strchr(ptr, '\"')) && eostr-ptr<constMaxDataLen)
{
memcpy(data, ptr, eostr-ptr);
data[eostr-ptr]='\0';
diff --git a/kcontrol/kfontinst/kfontinst/Fontmap.cpp b/kcontrol/kfontinst/kfontinst/Fontmap.cpp
index 8b04ef7bd..2c8b80201 100644
--- a/kcontrol/kfontinst/kfontinst/Fontmap.cpp
+++ b/kcontrol/kfontinst/kfontinst/Fontmap.cpp
@@ -65,13 +65,13 @@ static bool parseLine(const char *line, TQString &ps, TQString &fname, bool &isA
char a[constMaxLen+1],
b[constFileMaxLen+1];
- char *slash1=(char*)strchr(line, '/'),
+ char *slash1=const_cast<char*>(strchr(line, '/')),
*space1=slash1 ? (char*)findSpace(slash1) : NULL, //strchr(slash1, ' ') : NULL,
- *ob=slash1 ? (char*)strchr(slash1, '(') : NULL,
- *cb=ob ? (char*)strchr(ob, ')') : NULL,
- *slash2=space1 && !ob && !cb ? (char*)strchr(space1, '/') : NULL,
+ *ob=slash1 ? strchr(slash1, '(') : NULL,
+ *cb=ob ? strchr(ob, ')') : NULL,
+ *slash2=space1 && !ob && !cb ? strchr(space1, '/') : NULL,
*space2=slash2 ? (char*)findSpace(slash2) : NULL, // strchr(slash2, ' ') : NULL,
- *semic=cb || space2 ? (char*)strchr(cb ? cb : space2, ';') : NULL;
+ *semic=cb || space2 ? strchr(cb ? cb : space2, ';') : NULL;
if(semic && space1-slash1<constMaxLen)
{
diff --git a/kcontrol/kfontinst/kfontinst/XConfig.cpp b/kcontrol/kfontinst/kfontinst/XConfig.cpp
index 112ab3d3c..7572e3894 100644
--- a/kcontrol/kfontinst/kfontinst/XConfig.cpp
+++ b/kcontrol/kfontinst/kfontinst/XConfig.cpp
@@ -356,8 +356,8 @@ static char * getItem(char **start, char **end, const char *key, unsigned int &s
if(s && *s=='\"' && s<*end)
{
- char *e=(char*)strchr(s+1, '\"'),
- *nl=(char*)strchr(s+1, '\n');
+ char *e=strchr(s+1, '\"'),
+ *nl=strchr(s+1, '\n');
if(e && e<*end && (!nl || nl>e) && e-s<=constMaxItemLen)
{
diff --git a/kcontrol/samba/ksmbstatus.cpp b/kcontrol/samba/ksmbstatus.cpp
index c94bc5129..bf775deab 100644
--- a/kcontrol/samba/ksmbstatus.cpp
+++ b/kcontrol/samba/ksmbstatus.cpp
@@ -136,7 +136,7 @@ void NetMon::slotReceivedData(KProcess *, char *buffer, int )
char s[250],*start,*end;
size_t len;
start = buffer;
- while ((end = (char*)strchr(start,'\n'))) // look for '\n'
+ while ((end = strchr(start,'\n'))) // look for '\n'
{
len = end-start;
if (len>=sizeof(s))