summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNoriko Hosoi <nhosoi@redhat.com>2007-10-18 00:08:38 +0000
committerNoriko Hosoi <nhosoi@redhat.com>2007-10-18 00:08:38 +0000
commit19cd513a509aa6e45361df774e74f2d39451e08a (patch)
tree13ad0e58a486afd842559e1d74d019190c3f1d79 /lib
parent878c163528ed089dae1edb8295a6dd4ae842b9b4 (diff)
downloadds-19cd513a509aa6e45361df774e74f2d39451e08a.tar.gz
ds-19cd513a509aa6e45361df774e74f2d39451e08a.tar.xz
ds-19cd513a509aa6e45361df774e74f2d39451e08a.zip
Resolves: #188320
Summary: HP-UX: warnings reported by the HP-UX compiler
Diffstat (limited to 'lib')
-rw-r--r--lib/base/crit.cpp14
-rw-r--r--lib/base/file.cpp8
-rw-r--r--lib/ldaputil/cert.c4
-rw-r--r--lib/ldaputil/certmap.c11
-rw-r--r--lib/ldaputil/vtable.c3
-rw-r--r--lib/libaccess/acltools.cpp3
-rw-r--r--lib/libaccess/oneeval.cpp2
-rw-r--r--lib/libaccess/symbols.cpp3
-rw-r--r--lib/libadmin/authdb.c78
9 files changed, 15 insertions, 111 deletions
diff --git a/lib/base/crit.cpp b/lib/base/crit.cpp
index 3e057494..1a1286c2 100644
--- a/lib/base/crit.cpp
+++ b/lib/base/crit.cpp
@@ -150,7 +150,6 @@ NSAPI_PUBLIC void crit_exit(CRITICAL id)
crit->owner = 0;
PR_Unlock(crit->lock);
}
- PR_ASSERT(crit->count >= 0);
#endif
}
@@ -346,9 +345,9 @@ NSAPI_PUBLIC int
cs_wait(COUNTING_SEMAPHORE csp)
{
counting_sem_t *cs = (counting_sem_t *)csp;
+#if defined(SOLARIS) && defined(HW_THREADS)
int ret;
-#if defined(SOLARIS) && defined(HW_THREADS)
if ( (ret = sema_wait(cs)) < 0 ) {
ereport(LOG_FAILURE, XP_GetAdminStr(DBT_csWaitFailureS_), system_errmsg());
return -1;
@@ -366,7 +365,7 @@ cs_wait(COUNTING_SEMAPHORE csp)
crit_exit(cs->cv_lock);
crit_enter(cs->lock);
}
- ret = --(cs->count);
+ --(cs->count);
crit_exit(cs->lock);
return 0;
@@ -377,18 +376,19 @@ NSAPI_PUBLIC int
cs_trywait(COUNTING_SEMAPHORE csp)
{
counting_sem_t *cs = (counting_sem_t *)csp;
- int ret;
#if defined(SOLARIS) && defined(HW_THREADS)
+ int ret;
ret = sema_trywait(cs)?-1:0;
return ret;
#elif defined(IRIX) && defined(HW_THREADS)
+ int ret;
ret = uscpsema(cs);
return (ret == 1)?0:-1;
#else
crit_enter(cs->lock);
if (cs->count > 0) {
- ret = --(cs->count);
+ --(cs->count);
crit_exit(cs->lock);
return 0;
}
@@ -402,9 +402,9 @@ NSAPI_PUBLIC int
cs_release(COUNTING_SEMAPHORE csp)
{
counting_sem_t *cs = (counting_sem_t *)csp;
- int ret;
#if defined(SOLARIS) && defined(HW_THREADS)
+ int ret;
if ( (ret = sema_post(cs)) < 0 ) {
ereport(LOG_FAILURE, XP_GetAdminStr(DBT_csPostFailureS_), system_errmsg());
return -1;
@@ -415,7 +415,7 @@ cs_release(COUNTING_SEMAPHORE csp)
return 0;
#else
crit_enter(cs->lock);
- ret = ++(cs->count);
+ ++(cs->count);
if (cs->count == 1) {
crit_enter(cs->cv_lock);
condvar_notify(cs->cv);
diff --git a/lib/base/file.cpp b/lib/base/file.cpp
index 0e9e87ec..c7a1a9e2 100644
--- a/lib/base/file.cpp
+++ b/lib/base/file.cpp
@@ -565,19 +565,11 @@ NSAPI_PUBLIC int system_errmsg_fn(char **buff, size_t maxlen)
char static_error[128];
char *lmsg = 0; /* Local message pointer */
size_t msglen = 0;
- int sys_error = 0;
PRErrorCode nscp_error;
#ifdef XP_WIN32
LPTSTR sysmsg = 0;
#endif
-
- /* Grab the OS error message */
-#ifdef XP_WIN32
- sys_error = GetLastError();
-#else
- sys_error = errno;
-#endif
nscp_error = PR_GetError();
/* If there is a NSPR error, but it is "unknown", try to get the OSError
diff --git a/lib/ldaputil/cert.c b/lib/ldaputil/cert.c
index 20a2c2bd..ceb57118 100644
--- a/lib/ldaputil/cert.c
+++ b/lib/ldaputil/cert.c
@@ -259,9 +259,9 @@ _rdns_count (char*** rdns)
{
auto size_t count = 0;
auto char*** rdn;
- for (rdn = rdns; *rdns; ++rdns) {
+ for (rdn = rdns; *rdn; ++rdn) {
auto char** ava;
- for (ava = *rdns; *ava; ++ava) {
+ for (ava = *rdn; *ava; ++ava) {
++count;
}
}
diff --git a/lib/ldaputil/certmap.c b/lib/ldaputil/certmap.c
index b0adf662..57d1f910 100644
--- a/lib/ldaputil/certmap.c
+++ b/lib/ldaputil/certmap.c
@@ -1051,12 +1051,10 @@ NSAPI_PUBLIC int ldapu_issuer_certinfo (const char *issuerDN, void **certmap_inf
else if (certmap_listinfo) {
char *n_issuerDN = ldapu_dn_normalize (ldapu_strdup(issuerDN));
LDAPUListNode_t *cur = certmap_listinfo->head;
- int rv = LDAPU_FAILED;
while(cur) {
if (!ldapu_strcasecmp(n_issuerDN, ((LDAPUCertMapInfo_t *)cur->info)->issuerDN))
{
*certmap_info = cur->info;
- rv = LDAPU_SUCCESS;
break;
}
cur = cur->next;
@@ -1302,10 +1300,9 @@ static CertMapFn_t ldapu_get_cert_mapfn_sub (LDAPUCertMapInfo_t *certmap_info)
NSAPI_PUBLIC CertMapFn_t ldapu_get_cert_mapfn (const char *issuerDN)
{
LDAPUCertMapInfo_t *certmap_info = 0;
- int rv;
/* don't free the certmap_info -- its a pointer to an internal structure */
- rv = ldapu_issuer_certinfo(issuerDN, (void **)&certmap_info);
+ ldapu_issuer_certinfo(issuerDN, (void **)&certmap_info);
/* certmap_info may be NULL -- use the default */
return ldapu_get_cert_mapfn_sub(certmap_info);
@@ -1344,10 +1341,9 @@ static CertSearchFn_t ldapu_get_cert_searchfn_sub (LDAPUCertMapInfo_t *certmap_i
NSAPI_PUBLIC CertSearchFn_t ldapu_get_cert_searchfn (const char *issuerDN)
{
LDAPUCertMapInfo_t *certmap_info = 0;
- int rv;
/* don't free the certmap_info -- its a pointer to an internal structure */
- rv = ldapu_issuer_certinfo(issuerDN, (void **)&certmap_info);
+ ldapu_issuer_certinfo(issuerDN, (void **)&certmap_info);
/* certmap_info may be NULL -- use the default */
return ldapu_get_cert_searchfn_sub(certmap_info);
@@ -1386,10 +1382,9 @@ static CertVerifyFn_t ldapu_get_cert_verifyfn_sub (LDAPUCertMapInfo_t *certmap_i
NSAPI_PUBLIC CertVerifyFn_t ldapu_get_cert_verifyfn (const char *issuerDN)
{
LDAPUCertMapInfo_t *certmap_info = 0;
- int rv;
/* don't free the certmap_info -- its a pointer to an internal structure */
- rv = ldapu_issuer_certinfo(issuerDN, (void **)&certmap_info);
+ ldapu_issuer_certinfo(issuerDN, (void **)&certmap_info);
/* certmap_info may be NULL -- use the default */
return ldapu_get_cert_verifyfn_sub(certmap_info);
diff --git a/lib/ldaputil/vtable.c b/lib/ldaputil/vtable.c
index 7ef13553..0ead6c11 100644
--- a/lib/ldaputil/vtable.c
+++ b/lib/ldaputil/vtable.c
@@ -68,7 +68,7 @@ ldapuVd_init ( const char *host, int port )
#endif
static LDAP_CALL LDAP_CALLBACK int
-ldapuVd_set_option( LDAP *ld, int opt, void *val )
+ldapuVd_set_option( LDAP *ld, int opt, const void *val )
{
return ldap_set_option (ld, opt, val);
}
@@ -150,7 +150,6 @@ ldapuVd_get_values_len( LDAP *ld, LDAPMessage *entry, const char *desc )
#define ldapuVd_set_option ldap_set_option
#define ldapuVd_simple_bind_s ldap_simple_bind_s
#define ldapuVd_unbind ldap_unbind
-#define ldapuVd_set_option ldap_set_option
#define ldapuVd_simple_bind_s ldap_simple_bind_s
#define ldapuVd_unbind ldap_unbind
#define ldapuVd_search_s ldap_search_s
diff --git a/lib/libaccess/acltools.cpp b/lib/libaccess/acltools.cpp
index 7ce82659..9eb3292d 100644
--- a/lib/libaccess/acltools.cpp
+++ b/lib/libaccess/acltools.cpp
@@ -2505,7 +2505,6 @@ append_cleanup:
int
rename_acl_in_file(char * filename, char * aclname, char * newname)
{
- ACLListHandle_t * racllist=NULL;
char * pattern=NULL;
char header[] = "version 3.0;\n";
int headerlen = strlen(header);
@@ -2565,7 +2564,7 @@ rename_acl_in_file(char * filename, char * aclname, char * newname)
memcpy(&text[headerlen], aclhead, len);
text[headerlen + len] = 0;
- if ((racllist=ACL_ParseString(NULL, text))==NULL) {
+ if (ACL_ParseString(NULL, text)==NULL) {
rv = ACLERRPARSE;
goto rename_cleanup;
}
diff --git a/lib/libaccess/oneeval.cpp b/lib/libaccess/oneeval.cpp
index d18fdcfa..a8f2b248 100644
--- a/lib/libaccess/oneeval.cpp
+++ b/lib/libaccess/oneeval.cpp
@@ -292,7 +292,6 @@ ACL_EvalDestroyContext(ACLListCache_t *cache)
{
ACLAceEntry_t *cur_ace, *next_ace;
ACLAceNumEntry_t *cur_num_p, *next_num_p;
- ACLExprHandle_t *acep;
if (!cache)
return 0;
@@ -309,7 +308,6 @@ ACL_EvalDestroyContext(ACLListCache_t *cache)
(cur_ace->acep->expr_type == ACL_EXPR_TYPE_AUTH))
PListDestroy(cur_ace->global_auth);
next_ace = cur_ace->next;
- acep = cur_ace->acep; /* The ACE structure itself */
PERM_FREE(cur_ace);
cur_ace = next_ace;
}
diff --git a/lib/libaccess/symbols.cpp b/lib/libaccess/symbols.cpp
index b5d90020..209c05ba 100644
--- a/lib/libaccess/symbols.cpp
+++ b/lib/libaccess/symbols.cpp
@@ -181,7 +181,6 @@ NSPR_BEGIN_EXTERN_C
int symTableAddSym(void * table, Symbol_t * newsym, void * symref)
{
SymTable_t * st = (SymTable_t *)table;
- PLHashEntry * he;
PLHashEntry **hep;
PLHashNumber keyhash;
int rv = 0;
@@ -196,7 +195,7 @@ int symTableAddSym(void * table, Symbol_t * newsym, void * symref)
if (*hep == 0) {
/* Expand the hash table if necessary and allocate an entry */
- he = PL_HashTableRawAdd(st->stb_ht,
+ PL_HashTableRawAdd(st->stb_ht,
hep, keyhash, (void *)newsym, symref);
}
else {
diff --git a/lib/libadmin/authdb.c b/lib/libadmin/authdb.c
deleted file mode 100644
index 6ab86cdd..00000000
--- a/lib/libadmin/authdb.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/** BEGIN COPYRIGHT BLOCK
- * This Program is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the Free Software
- * Foundation; version 2 of the License.
- *
- * This Program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA.
- *
- * In addition, as a special exception, Red Hat, Inc. gives You the additional
- * right to link the code of this Program with code not covered under the GNU
- * General Public License ("Non-GPL Code") and to distribute linked combinations
- * including the two, subject to the limitations in this paragraph. Non-GPL Code
- * permitted under this exception must only link to the code of this Program
- * through those well defined interfaces identified in the file named EXCEPTION
- * found in the source code files (the "Approved Interfaces"). The files of
- * Non-GPL Code may instantiate templates or use macros or inline functions from
- * the Approved Interfaces without causing the resulting work to be covered by
- * the GNU General Public License. Only Red Hat, Inc. may make changes or
- * additions to the list of Approved Interfaces. You must obey the GNU General
- * Public License in all respects for all of the Program code and other code used
- * in conjunction with the Program except the Non-GPL Code covered by this
- * exception. If you modify this file, you may extend this exception to your
- * version of the file, but you are not obligated to do so. If you do not wish to
- * provide this exception without modification, you must delete this exception
- * statement from your version and license this file solely under the GPL without
- * exception.
- *
- *
- * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- * END COPYRIGHT BLOCK **/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/*
- * authdb.c: Functions to aid in user/group database admin
- *
- * These things leak memory like a sieve.
- *
- * Ben Polk
- * (blame Mike McCool for functions with an MLM)
- */
-
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <stdio.h>
-#include "netsite.h"
-
-/* Get the userdb directory. (V1.x) */
-NSAPI_PUBLIC char *get_userdb_dir(void)
-{
- char *userdb;
- char line[BIG_LINE];
-
-#ifdef USE_ADMSERV
- char *tmp = getenv("NETSITE_ROOT");
-
- snprintf(line, sizeof(line), "%s%cuserdb", tmp, FILE_PATHSEP);
- line[sizeof(line)-1] = 0;
-#else
- char *tmp = get_mag_var("#ServerRoot");
-
- snprintf(line, sizeof(line), "%s%cadmin%cuserdb", tmp, FILE_PATHSEP, FILE_PATHSEP);
- line[sizeof(line)-1] = 0;
-#endif
- userdb = STRDUP(line);
- return userdb;
-}