From d54ab5595153b3dc57560077ff3551ffd4406b30 Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 15 Aug 2011 21:36:27 +0000 Subject: 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 --- kdm/backend/auth.c | 2 +- kdm/backend/client.c | 4 ++-- kdm/backend/dm.c | 2 +- kdm/backend/process.c | 2 +- kdm/backend/sessreg.c | 4 ++-- kdm/backend/util.c | 2 +- kdm/backend/xdmcp.c | 6 +++--- 7 files changed, 11 insertions(+), 11 deletions(-) (limited to 'kdm/backend') diff --git a/kdm/backend/auth.c b/kdm/backend/auth.c index 3fb18ac4c..bd183142c 100644 --- a/kdm/backend/auth.c +++ b/kdm/backend/auth.c @@ -944,7 +944,7 @@ setAuthNumber( Xauth *auth, const char *name ) colon = strrchr( name, ':' ); if (colon) { ++colon; - dot = (char*)strchr( colon, '.' ); + dot = strchr( colon, '.' ); if (dot) auth->number_length = dot - colon; else diff --git a/kdm/backend/client.c b/kdm/backend/client.c index 0807b2ce7..56d9fa09f 100644 --- a/kdm/backend/client.c +++ b/kdm/backend/client.c @@ -376,7 +376,7 @@ doPAMAuth( const char *psrv, struct pam_data *pdata ) V_RET_FAIL( 0 ); } if ((td->displayType & d_location) == dForeign) { - char *cp = (char*)strchr( td->name, ':' ); + char *cp = strchr( td->name, ':' ); *cp = 0; pretc = pam_set_item( pamh, PAM_RHOST, td->name ); *cp = ':'; @@ -566,7 +566,7 @@ Verify( GConvFunc gconv, int rootok ) char *tmpch; strncpy( hostname, td->name, sizeof(hostname) - 1 ); hostname[sizeof(hostname)-1] = '\0'; - if ((tmpch = (char*)strchr( hostname, ':' ))) + if ((tmpch = strchr( hostname, ':' ))) *tmpch = '\0'; } else hostname[0] = '\0'; diff --git a/kdm/backend/dm.c b/kdm/backend/dm.c index a372686df..d372dd472 100644 --- a/kdm/backend/dm.c +++ b/kdm/backend/dm.c @@ -133,7 +133,7 @@ main( int argc, char **argv ) memcpy( name, argv[0], len + 1 ); *--name = '/'; do { - if (!(pathe = (char*)strchr( path, ':' ))) + if (!(pathe = strchr( path, ':' ))) pathe = path + strlen( path ); len = pathe - path; if (!len || (len == 1 && *path == '.')) { diff --git a/kdm/backend/process.c b/kdm/backend/process.c index 8e21d789b..f9d34fe7f 100644 --- a/kdm/backend/process.c +++ b/kdm/backend/process.c @@ -276,7 +276,7 @@ locate( const char *exe ) memcpy( name, exe, len + 1 ); *--name = '/'; do { - if (!(pathe = (char*)strchr( path, ':' ))) + if (!(pathe = strchr( path, ':' ))) pathe = path + strlen( path ); len = pathe - path; if (len && !(len == 1 && *path == '.')) { diff --git a/kdm/backend/sessreg.c b/kdm/backend/sessreg.c index e603ff4c6..b507f8141 100644 --- a/kdm/backend/sessreg.c +++ b/kdm/backend/sessreg.c @@ -134,7 +134,7 @@ sessreg( struct display *d, int pid, const char *user, int uid ) } ut_ent.ut_time = time( 0 ); - colon = (char*)strchr( d->name, ':' ); + colon = strchr( d->name, ':' ); clen = strlen( colon ); if (clen > (int)(sizeof(ut_ent.ut_line) - UTL_OFF) - 2) return; /* uhm, well ... */ @@ -175,7 +175,7 @@ sessreg( struct display *d, int pid, const char *user, int uid ) colon = d->name; left = 0; } else { - dot = (char*)strchr( d->name, '.' ); + dot = strchr( d->name, '.' ); if (dot && dot - d->name < left) { memcpy( ut_ent.ut_line + UTL_OFF, d->name, left - 1 ); ut_ent.ut_line[UTL_OFF + left - 1] = '~'; diff --git a/kdm/backend/util.c b/kdm/backend/util.c index b980862f1..7dd58f031 100644 --- a/kdm/backend/util.c +++ b/kdm/backend/util.c @@ -413,7 +413,7 @@ putEnv( const char *string, char **env ) char *n; char *b; - if (!(b = (char*)strchr( string, '=' ))) + if (!(b = strchr( string, '=' ))) return NULL; if (!StrNDup( &n, string, b - string )) return NULL; diff --git a/kdm/backend/xdmcp.c b/kdm/backend/xdmcp.c index e82305f89..6abaf5fc8 100644 --- a/kdm/backend/xdmcp.c +++ b/kdm/backend/xdmcp.c @@ -395,8 +395,8 @@ NetworkAddressToName( CARD16 connectionType, ARRAY8Ptr connectionAddress, * this is as useful, and will confuse more * people */ - if ((localDot = (char*)strchr( localhost, '.' )) && - (remoteDot = (char*)strchr( hostname, '.' ))) + if ((localDot = strchr( localhost, '.' )) && + (remoteDot = strchr( hostname, '.' ))) { /* smash the name in place; it won't * be needed later. @@ -1099,7 +1099,7 @@ NetworkAddressToHostname( CARD16 connectionType, ARRAY8Ptr connectionAddress ) oki: if (StrDup( &name, he->h_name ) && !strchr( name, '.' ) && - (myDot = (char*)strchr( localHostname(), '.' ))) + (myDot = strchr( localHostname(), '.' ))) { if (ASPrintf( &lname, "%s%s", name, myDot )) { #if defined(IPv6) && defined(AF_INET6) -- cgit v1.2.1