From d09be7368f153e0d3d8059fbf85665e544eabf43 Mon Sep 17 00:00:00 2001 From: Nathan Neulinger Date: Sun, 3 Jun 2001 17:28:33 +0000 Subject: [PATCH] libadmin-warning-cleanup-20010602 add missing parens, remove unused decls --- src/libadmin/adminutil/afs_utilAdmin.c | 11 ++--------- src/libadmin/bos/afs_bosAdmin.c | 19 ++++++++++--------- src/libadmin/client/afs_clientAdmin.c | 18 +++++++++--------- 3 files changed, 21 insertions(+), 27 deletions(-) diff --git a/src/libadmin/adminutil/afs_utilAdmin.c b/src/libadmin/adminutil/afs_utilAdmin.c index e57ffed97..73635d995 100644 --- a/src/libadmin/adminutil/afs_utilAdmin.c +++ b/src/libadmin/adminutil/afs_utilAdmin.c @@ -95,7 +95,8 @@ int ADMINAPI util_AdminErrorCodeTranslate( * Translate the error */ - (error_init_done || pthread_once(&error_init_once, init_once)); + if ( !error_init_done ) + pthread_once(&error_init_once, init_once); code = (afs_int32) errorCode; *errorTextP = error_message(code); rc = 1; @@ -145,8 +146,6 @@ static int GetDatabaseServerRPC( } rc = 1; -fail_GetDatabaseServerRPC: - if (st != NULL) { *st = tst; } @@ -224,7 +223,6 @@ int ADMINAPI util_DatabaseServerGetBegin( afs_admin_iterator_p iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t)); database_server_get_p serv = (database_server_get_p) calloc(1, sizeof(database_server_get_t)); char copyCell[MAXCELLCHARS]; - int mutex_inited = 0; /* * Validate arguments @@ -324,7 +322,6 @@ int ADMINAPI util_DatabaseServerGetNext( int rc = 0; afs_status_t tst = 0; afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId; - int iter_locked = 0; if (iter == NULL) { tst = ADMITERATORNULL; @@ -1037,7 +1034,6 @@ int IteratorInit( int rc = 0; afs_status_t tst = 0; int mutex_inited = 0; - int attr_inited = 0; int add_item_cond_inited = 0; int remove_item_cond_inited = 0; @@ -1246,7 +1242,6 @@ static int GetRPCStatsRPC( int rc = 0; afs_status_t tst = 0; rpc_stat_get_p t = (rpc_stat_get_p) rpc_specific; - afs_uint32 index = t->index; t->stats[slot].clientVersion = t->clientVersion; t->stats[slot].serverVersion = t->serverVersion; @@ -2411,7 +2406,6 @@ int ADMINAPI util_RXDebugVersion( int rc = 0; afs_status_t tst = 0; int code; - int len; if (handle == NULL) { tst = ADMRXDEBUGHANDLENULL; @@ -2471,7 +2465,6 @@ int ADMINAPI util_RXDebugSupportedStats( int rc = 0; afs_status_t tst = 0; struct rx_debugStats tstats; - int code; if (handle == NULL) { tst = ADMRXDEBUGHANDLENULL; diff --git a/src/libadmin/bos/afs_bosAdmin.c b/src/libadmin/bos/afs_bosAdmin.c index ea6ead431..daac36edc 100644 --- a/src/libadmin/bos/afs_bosAdmin.c +++ b/src/libadmin/bos/afs_bosAdmin.c @@ -20,8 +20,11 @@ #include #include #include +#include #ifdef AFS_NT40_ENV #include +#else +#include #endif @@ -2087,7 +2090,6 @@ static int GetKeyRPC( int rc = 0; afs_status_t tst = 0; key_get_p key = (key_get_p) rpc_specific; - char *ptr = (char *) &key->key[slot]; struct bozo_keyInfo keyInfo; tst = BOZO_ListKeys(key->server, key->next++, @@ -3076,25 +3078,25 @@ int ADMINAPI bos_ExecutableRestartTimeSet( } if ((time.mask & BOS_RESTART_TIME_HOUR) && - (time.hour < 0) || (time.hour > 23)) { + ((time.hour < 0) || (time.hour > 23))) { tst = ADMBOSHOURINVALID; goto fail_bos_ExecutableRestartTimeSet; } if ((time.mask & BOS_RESTART_TIME_MINUTE) && - (time.min < 0) || (time.min > 60)) { + ((time.min < 0) || (time.min > 60))) { tst = ADMBOSMINUTEINVALID; goto fail_bos_ExecutableRestartTimeSet; } if ((time.mask & BOS_RESTART_TIME_SECOND) && - (time.sec < 0) || (time.sec > 60)) { + ((time.sec < 0) || (time.sec > 60))) { tst = ADMBOSSECONDINVALID; goto fail_bos_ExecutableRestartTimeSet; } if ((time.mask & BOS_RESTART_TIME_DAY) && - (time.day < 0) || (time.day > 6)) { + ((time.day < 0) || (time.day > 6))) { tst = ADMBOSDAYINVALID; goto fail_bos_ExecutableRestartTimeSet; } @@ -3223,7 +3225,7 @@ int ADMINAPI bos_LogGet( int rc = 0; afs_status_t tst = 0; bos_server_p b_handle = (bos_server_p) serverHandle; - struct rx_call *tcall; + struct rx_call *tcall = NULL; afs_int32 error; char buffer; int have_call = 0; @@ -3484,7 +3486,6 @@ int ADMINAPI bos_Salvage( int have_volume = 0; unsigned int part = 0; int try_to_stop_fileserver = 0; - int stopped_fileserver = 0; bos_ProcessType_t procType; bos_ProcessInfo_t procInfo; FILE *log = NULL; @@ -3628,8 +3629,8 @@ int ADMINAPI bos_Salvage( goto fail_bos_Salvage; } - while (poll_rc = bos_ProcessInfoGet(serverHandle, "salvage-tmp", &procType, - &procInfo, &tst)) { + while ((poll_rc = bos_ProcessInfoGet(serverHandle, "salvage-tmp", &procType, + &procInfo, &tst))) { sleep(5); } diff --git a/src/libadmin/client/afs_clientAdmin.c b/src/libadmin/client/afs_clientAdmin.c index c415298d8..fe19db40a 100644 --- a/src/libadmin/client/afs_clientAdmin.c +++ b/src/libadmin/client/afs_clientAdmin.c @@ -26,6 +26,7 @@ #include #include #include +#include #endif #include #include @@ -1180,7 +1181,7 @@ int ADMINAPI afsclient_LocalCellGet( goto fail_afsclient_LocalCellGet; } - if (tst = afsconf_GetLocalCell(tdir, cellName, MAXCELLCHARS)) { + if ((tst = afsconf_GetLocalCell(tdir, cellName, MAXCELLCHARS))) { goto fail_afsclient_LocalCellGet; } @@ -1395,7 +1396,7 @@ int ADMINAPI afsclient_MountPointCreate( goto fail_afsclient_MountPointCreate; } #else - if (tst = symlink(space, directory)) { + if ((tst = symlink(space, directory))) { goto fail_afsclient_MountPointCreate; } #endif @@ -1432,7 +1433,7 @@ int ADMINAPI afsclient_ACLEntryAdd( char *ptr; Acl_t cur_acl; char cur_user[64]; - int cur_user_acl; + int cur_user_acl = 0; int i; char tmp[64+35]; int is_dfs; @@ -1533,7 +1534,7 @@ int ADMINAPI afsclient_ACLEntryAdd( * file. */ - is_dfs = sscanf(old_acl_string, "%d dfs:%d %s", &cur_acl.nplus, &cur_acl.dfs, &cur_acl.cell); + is_dfs = sscanf(old_acl_string, "%d dfs:%d %s", &cur_acl.nplus, &cur_acl.dfs, cur_acl.cell); ptr = strchr(old_acl_string, '\n'); ptr++; sscanf(ptr, "%d", &cur_acl.nminus); @@ -1557,7 +1558,7 @@ int ADMINAPI afsclient_ACLEntryAdd( */ for(i=0;i<(cur_acl.nplus + cur_acl.nminus);i++) { - sscanf(ptr, "%s%d\n", &cur_user, &cur_user_acl); + sscanf(ptr, "%s%d\n", cur_user, &cur_user_acl); /* * Skip the entry for the user we are replacing/adding */ @@ -1618,7 +1619,8 @@ int ADMINAPI afsclient_Init( int rc = 0; afs_status_t tst = 0; - (client_init || pthread_once(&client_init_once, client_once)); + if ( !client_init ) + pthread_once(&client_init_once, client_once); #ifdef AFS_NT40_ENV if (afs_winsockInit() < 0) { @@ -1637,7 +1639,7 @@ int ADMINAPI afsclient_Init( goto fail_afsclient_Init; } - if (tst = ka_CellConfig((char *)AFSDIR_CLIENT_ETC_DIRPATH)) { + if ((tst = ka_CellConfig((char *)AFSDIR_CLIENT_ETC_DIRPATH))) { goto fail_afsclient_Init; } @@ -1773,8 +1775,6 @@ static int GetServerRPC( } rc = 1; -fail_GetServerRPC: - if (st != NULL) { *st = tst; } -- 2.39.5