From a5aeda9eaca21530dcd8f3c05d5efc77bf0bac01 Mon Sep 17 00:00:00 2001
From: Noriko Hosoi <nhosoi@redhat.com>
Date: Fri, 27 Feb 2015 16:25:25 -0800
Subject: [PATCH 41/41] Ticket #48048 - Fix coverity issues - 2015/2/24

Description: Due to the changes made on NSPRIu64 and NSPRI64 along with
this fix:
> Coverity defect 13075 - Explicit null dereferenced (FORWARD_NULL)
> NSPRIu64 and NSPRI64 is defined based upon the architecture and compiler.
casting PRUint64 to (long long unsigned int) in the log print is no longer
needed.  Got rid of them.
---
 ldap/servers/plugins/dna/dna.c                     | 40 +++++++++++-----------
 .../plugins/replication/repl5_inc_protocol.c       |  4 +--
 ldap/servers/plugins/replication/repl5_init.c      |  2 +-
 ldap/servers/plugins/replication/repl5_replica.c   | 22 ++++++------
 ldap/servers/plugins/replication/repl5_total.c     |  4 +--
 ldap/servers/plugins/replication/repl_connext.c    | 20 +++++------
 ldap/servers/plugins/replication/repl_extop.c      | 26 +++++++-------
 ldap/servers/plugins/sync/sync_persist.c           |  6 ++--
 ldap/servers/plugins/syntaxes/validate_task.c      |  6 ++--
 ldap/servers/plugins/usn/usn.c                     | 14 ++++----
 ldap/servers/slapd/abandon.c                       |  8 ++---
 ldap/servers/slapd/add.c                           |  4 +--
 ldap/servers/slapd/auth.c                          | 18 +++++-----
 ldap/servers/slapd/back-ldbm/import-threads.c      |  2 +-
 ldap/servers/slapd/back-ldbm/ldbm_delete.c         |  4 +--
 ldap/servers/slapd/back-ldbm/ldbm_modrdn.c         |  4 +--
 ldap/servers/slapd/back-ldbm/misc.c                |  6 ++--
 ldap/servers/slapd/back-ldbm/monitor.c             | 10 +++---
 ldap/servers/slapd/bind.c                          |  8 ++---
 ldap/servers/slapd/compare.c                       |  2 +-
 ldap/servers/slapd/connection.c                    | 24 ++++++-------
 ldap/servers/slapd/conntable.c                     | 10 +++---
 ldap/servers/slapd/control.c                       |  2 +-
 ldap/servers/slapd/delete.c                        |  2 +-
 ldap/servers/slapd/extendop.c                      |  4 +--
 ldap/servers/slapd/modify.c                        | 12 +++----
 ldap/servers/slapd/modrdn.c                        |  6 ++--
 ldap/servers/slapd/monitor.c                       |  8 ++---
 ldap/servers/slapd/operation.c                     |  4 +--
 ldap/servers/slapd/opshared.c                      |  2 +-
 ldap/servers/slapd/psearch.c                       | 10 +++---
 ldap/servers/slapd/result.c                        | 10 +++---
 ldap/servers/slapd/sasl_io.c                       | 12 +++----
 ldap/servers/slapd/saslbind.c                      |  2 +-
 ldap/servers/slapd/search.c                        |  2 +-
 ldap/servers/slapd/snmp_collator.c                 |  2 +-
 ldap/servers/slapd/unbind.c                        |  6 ++--
 37 files changed, 165 insertions(+), 163 deletions(-)

diff --git a/ldap/servers/plugins/dna/dna.c b/ldap/servers/plugins/dna/dna.c
index 25123cb..7da853b 100644
--- a/ldap/servers/plugins/dna/dna.c
+++ b/ldap/servers/plugins/dna/dna.c
@@ -979,7 +979,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply)
 
     slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM,
                     "----------> %s [%" NSPRIu64 "]\n", DNA_NEXTVAL,
-                    (long long unsigned int)entry->nextval);
+                    entry->nextval);
 
     value = slapi_entry_attr_get_charptr(e, DNA_PREFIX);
     if (value && value[0]) {
@@ -1108,7 +1108,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply)
 
     slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM,
                     "----------> %s [%" NSPRIu64 "]\n", DNA_MAXVAL,
-                    (long long unsigned int)entry->maxval);
+                    entry->maxval);
 
     /* get the global bind dn and password(if any) */
     value = slapi_entry_attr_get_charptr(e, DNA_REMOTE_BIND_DN);
@@ -1232,7 +1232,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply)
 
     slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM,
                     "----------> %s [%" NSPRIu64 "]\n", DNA_THRESHOLD,
-                    (long long unsigned int)entry->threshold);
+                    entry->threshold);
 
     value = slapi_entry_attr_get_charptr(e, DNA_RANGE_REQUEST_TIMEOUT);
     if (value) {
@@ -1244,7 +1244,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply)
 
     slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM,
                     "----------> %s [%" NSPRIu64 "]\n", DNA_RANGE_REQUEST_TIMEOUT,
-                    (long long unsigned int)entry->timeout);
+                    entry->timeout);
 
     value = slapi_entry_attr_get_charptr(e, DNA_NEXT_RANGE);
     if (value) {
@@ -2276,8 +2276,8 @@ dna_first_free_value(struct configEntry *config_entry,
 
         filter = slapi_ch_smprintf("(&%s(&(%s>=%" NSPRIu64 ")(%s<=%" NSPRIu64 ")))",
                                    config_entry->filter,
-                                   config_entry->types[0], (long long unsigned int)tmpval,
-                                   config_entry->types[0], (long long unsigned int)config_entry->maxval);
+                                   config_entry->types[0], tmpval,
+                                   config_entry->types[0], config_entry->maxval);
     }
 
     if (NULL == filter) {
@@ -2464,7 +2464,7 @@ static int dna_get_next_value(struct configEntry *config_entry,
     if ((config_entry->maxval == -1) ||
         (nextval <= (config_entry->maxval + config_entry->interval))) {
         /* try to set the new next value in the config entry */
-        PR_snprintf(next_value, sizeof(next_value),"%" NSPRIu64, (long long unsigned int)nextval);
+        PR_snprintf(next_value, sizeof(next_value),"%" NSPRIu64, nextval);
 
         /* set up our replace modify operation */
         replace_val[0] = next_value;
@@ -2491,7 +2491,7 @@ static int dna_get_next_value(struct configEntry *config_entry,
 
     if (LDAP_SUCCESS == ret) {
         slapi_ch_free_string(next_value_ret);
-        *next_value_ret = slapi_ch_smprintf("%" NSPRIu64, (long long unsigned int)setval);
+        *next_value_ret = slapi_ch_smprintf("%" NSPRIu64, setval);
         if (NULL == *next_value_ret) {
             ret = LDAP_OPERATIONS_ERROR;
             goto done;
@@ -2577,7 +2577,7 @@ dna_update_shared_config(struct configEntry *config_entry)
         /* We store the number of remaining assigned values
          * in the shared config entry. */
         PR_snprintf(remaining_vals, sizeof(remaining_vals),"%" NSPRIu64,
-                (long long unsigned int)config_entry->remaining);
+                config_entry->remaining);
 
         /* set up our replace modify operation */
         replace_val[0] = remaining_vals;
@@ -2677,7 +2677,7 @@ dna_update_next_range(struct configEntry *config_entry,
 
     /* Try to set the new next range in the config entry. */
     PR_snprintf(nextrange_value, sizeof(nextrange_value), "%" NSPRIu64 "-%" NSPRIu64,
-    		(long long unsigned int)lower, (long long unsigned int)upper);
+    		lower, upper);
 
     /* set up our replace modify operation */
     replace_val[0] = nextrange_value;
@@ -2745,8 +2745,8 @@ dna_activate_next_range(struct configEntry *config_entry)
     int ret = 0;
 
     /* Setup the modify operation for the config entry */
-    PR_snprintf(maxval_val, sizeof(maxval_val),"%" NSPRIu64, (long long unsigned int)config_entry->next_range_upper);
-    PR_snprintf(nextval_val, sizeof(nextval_val),"%" NSPRIu64, (long long unsigned int)config_entry->next_range_lower);
+    PR_snprintf(maxval_val, sizeof(maxval_val),"%" NSPRIu64, config_entry->next_range_upper);
+    PR_snprintf(nextval_val, sizeof(nextval_val),"%" NSPRIu64, config_entry->next_range_lower);
 
     maxval_vals[0] = maxval_val;
     maxval_vals[1] = 0;
@@ -3489,8 +3489,8 @@ _dna_pre_op_add(Slapi_PBlock *pb, Slapi_Entry *e, char **errstr)
                                     "dna_pre_op: Passed threshold of %" 
                                     NSPRIu64 " remaining values "
                                     "for range %s. (%" NSPRIu64 " values remain)\n",
-                                    (long long unsigned int)config_entry->threshold, config_entry->dn,
-                                    (long long unsigned int)config_entry->remaining);
+                                    config_entry->threshold, config_entry->dn,
+                                    config_entry->remaining);
                     dna_fix_maxval(config_entry, 0);
                 }
 
@@ -3761,8 +3761,8 @@ _dna_pre_op_modify(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Mods *smods, char **e
                                     "dna_pre_op: Passed threshold of %" 
                                     NSPRIu64 " remaining values "
                                     "for range %s. (%" NSPRIu64 " values remain)\n",
-                                    (long long unsigned int)config_entry->threshold, config_entry->dn,
-                                    (long long unsigned int)config_entry->remaining);
+                                    config_entry->threshold, config_entry->dn,
+                                    config_entry->remaining);
                     dna_fix_maxval(config_entry, 0);
                 }
 
@@ -4335,8 +4335,8 @@ static int dna_extend_exop(Slapi_PBlock *pb)
         char highstr[16];
 
         /* Create the exop response */
-        PR_snprintf(lowstr, sizeof(lowstr), "%" NSPRIu64, (long long unsigned int)lower);
-        PR_snprintf(highstr, sizeof(highstr), "%" NSPRIu64, (long long unsigned int)upper);
+        PR_snprintf(lowstr, sizeof(lowstr), "%" NSPRIu64, lower);
+        PR_snprintf(highstr, sizeof(highstr), "%" NSPRIu64, upper);
         range_low.bv_val = lowstr;
         range_low.bv_len = strlen(range_low.bv_val);
         range_high.bv_val = highstr;
@@ -4370,7 +4370,7 @@ static int dna_extend_exop(Slapi_PBlock *pb)
 
         slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM,
                         "dna_extend_exop: Released range %" NSPRIu64 "-%" NSPRIu64 ".\n",
-                        (long long unsigned int)lower, (long long unsigned int)upper);
+                        lower, upper);
     }
 
   free_and_return:
@@ -4511,7 +4511,7 @@ dna_release_range(char *range_dn, PRUint64 *lower, PRUint64 *upper)
                 *lower = *upper - release + 1;
 
                 /* try to set the new maxval in the config entry */
-                PR_snprintf(max_value, sizeof(max_value),"%" NSPRIu64, (long long unsigned int)(*lower - 1));
+                PR_snprintf(max_value, sizeof(max_value),"%" NSPRIu64, (*lower - 1));
 
                 /* set up our replace modify operation */
                 replace_val[0] = max_value;
diff --git a/ldap/servers/plugins/replication/repl5_inc_protocol.c b/ldap/servers/plugins/replication/repl5_inc_protocol.c
index 5cf170c..f18fde5 100644
--- a/ldap/servers/plugins/replication/repl5_inc_protocol.c
+++ b/ldap/servers/plugins/replication/repl5_inc_protocol.c
@@ -1982,8 +1982,8 @@ repl5_inc_stop(Private_Repl_Protocol *prp)
 		/* Isn't listening. Do something drastic. */
 		return_value = -1;
 		slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
-				"%s: repl5_inc_stop: protocol does not stop after %llu seconds\n",
-				agmt_get_long_name(prp->agmt), (long long unsigned int)timeout);
+				"%s: repl5_inc_stop: protocol does not stop after %" NSPRIu64 " seconds\n",
+				agmt_get_long_name(prp->agmt), timeout);
 	}
 	else
 	{
diff --git a/ldap/servers/plugins/replication/repl5_init.c b/ldap/servers/plugins/replication/repl5_init.c
index 56f01a1..8e2f114 100644
--- a/ldap/servers/plugins/replication/repl5_init.c
+++ b/ldap/servers/plugins/replication/repl5_init.c
@@ -227,7 +227,7 @@ get_repl_session_id (Slapi_PBlock *pb, char *idstr, CSN **csn)
 		if (opid) {
 			slapi_pblock_get (pb, SLAPI_CONN_ID, &connid);
 			PR_snprintf (idstr, REPL_SESSION_ID_SIZE, "conn=%" NSPRIu64 " op=%d",
-					(long long unsigned int)connid, opid);
+					connid, opid);
 		}
 
 		slapi_pblock_get ( pb, SLAPI_OPERATION, &op );
diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c
index 61ae7ec..c184178 100644
--- a/ldap/servers/plugins/replication/repl5_replica.c
+++ b/ldap/servers/plugins/replication/repl5_replica.c
@@ -474,7 +474,7 @@ replica_get_exclusive_access(Replica *r, PRBool *isInc, PRUint64 connid, int opi
 		slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
 				"conn=%" NSPRIu64 " op=%d repl=\"%s\": "
 				"Replica in use locking_purl=%s\n",
-				(long long unsigned int)connid, opid,
+				connid, opid,
 				slapi_sdn_get_dn(r->repl_root),
 				r->locking_purl ? r->locking_purl : "unknown");
 		rval = PR_FALSE;
@@ -487,7 +487,7 @@ replica_get_exclusive_access(Replica *r, PRBool *isInc, PRUint64 connid, int opi
 	{
         slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, 
 						"conn=%" NSPRIu64 " op=%d repl=\"%s\": Acquired replica\n",
-						(long long unsigned int)connid, opid,
+						connid, opid,
 						slapi_sdn_get_dn(r->repl_root));
 		r->repl_state_flags |= REPLICA_IN_USE;
 		if (isInc && *isInc) 
@@ -528,13 +528,13 @@ replica_relinquish_exclusive_access(Replica *r, PRUint64 connid, int opid)
         slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, 
 					"conn=%" NSPRIu64 " op=%d repl=\"%s\": "
 					"Replica not in use\n",
-					(long long unsigned int)connid, opid,
+					connid, opid,
 					slapi_sdn_get_dn(r->repl_root));
 	} else {
 		slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, 
 					"conn=%" NSPRIu64 " op=%d repl=\"%s\": "
 					"Released replica held by locking_purl=%s\n",
-					(long long unsigned int)connid, opid,
+					connid, opid,
 					slapi_sdn_get_dn(r->repl_root),
 					r->locking_purl);
 
@@ -3411,7 +3411,6 @@ abort_csn_callback(const CSN *csn, void *data)
 	Replica *r = (Replica *)data;
 	Object *ruv_obj;
     RUV *ruv;
-    int rc;
 
 	PR_ASSERT(NULL != csn);
 	PR_ASSERT(NULL != data);
@@ -3423,11 +3422,14 @@ abort_csn_callback(const CSN *csn, void *data)
 
     replica_lock(r->repl_lock);
 
-	if (NULL != r->min_csn_pl)
-	{
-		rc = csnplRemove(r->min_csn_pl, csn);
-		PR_ASSERT(rc == 0);
-	}
+    if (NULL != r->min_csn_pl)
+    {
+        int rc = csnplRemove(r->min_csn_pl, csn);
+        if (rc) {
+            slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "csnplRemove failed");
+            return;
+        }
+    }
 
     ruv_cancel_csn_inprogress (ruv, csn);
     replica_unlock(r->repl_lock);
diff --git a/ldap/servers/plugins/replication/repl5_total.c b/ldap/servers/plugins/replication/repl5_total.c
index 45cdbae..f22246d 100644
--- a/ldap/servers/plugins/replication/repl5_total.c
+++ b/ldap/servers/plugins/replication/repl5_total.c
@@ -882,7 +882,7 @@ multimaster_extop_NSDS50ReplicationEntry(Slapi_PBlock  *pb)
 		   slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
 						   "Error %d: could not import entry dn %s "
 						   "for total update operation conn=%" NSPRIu64 " op=%d\n",
-						   rc, dn, (long long unsigned int)connid, opid);
+						   rc, dn, connid, opid);
 		   rc = -1;
 	   }
         
@@ -892,7 +892,7 @@ multimaster_extop_NSDS50ReplicationEntry(Slapi_PBlock  *pb)
 		slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
 						"Error %d: could not decode the total update extop "
 						"for total update operation conn=%" NSPRIu64 " op=%d\n",
-						rc, (long long unsigned int)connid, opid);
+						rc, connid, opid);
 	}
    
     if (rc != 0)
diff --git a/ldap/servers/plugins/replication/repl_connext.c b/ldap/servers/plugins/replication/repl_connext.c
index a591898..9da2cbb 100644
--- a/ldap/servers/plugins/replication/repl_connext.c
+++ b/ldap/servers/plugins/replication/repl_connext.c
@@ -111,7 +111,7 @@ void consumer_connection_extension_destructor (void *ext, void *object, void *pa
 					slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
 									"Aborting total update in progress for replicated "
 									"area %s connid=%" NSPRIu64 "\n", slapi_sdn_get_dn(repl_root_sdn),
-									(long long unsigned int)connid);
+									connid);
 					slapi_stop_bulk_import(pb);
 				}
 				else
@@ -183,20 +183,20 @@ consumer_connection_extension_acquire_exclusive_access(void* conn, PRUint64 conn
             ret = connext;
             slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, 
                     "conn=%" NSPRIu64 " op=%d Acquired consumer connection extension\n",
-                    (long long unsigned int)connid, opid);
+                    connid, opid);
         }
         else if (opid == connext->in_use_opid)
         {
             ret = connext;
             slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, 
                     "conn=%" NSPRIu64 " op=%d Reacquired consumer connection extension\n",
-                    (long long unsigned int)connid, opid);
+                    connid, opid);
         }
         else
         {
             slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, 
                     "conn=%" NSPRIu64 " op=%d Could not acquire consumer connection extension; it is in use by op=%d\n",
-                    (long long unsigned int)connid, opid, connext->in_use_opid);
+                    connid, opid, connext->in_use_opid);
         }
 
         /* step 5, drop the lock */
@@ -206,7 +206,7 @@ consumer_connection_extension_acquire_exclusive_access(void* conn, PRUint64 conn
     {
         slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, 
                 "conn=%" NSPRIu64 " op=%d Could not acquire consumer extension, it is NULL!\n",
-                (long long unsigned int)connid, opid);
+                connid, opid);
     }
     
     return ret;
@@ -244,7 +244,7 @@ consumer_connection_extension_relinquish_exclusive_access(void* conn, PRUint64 c
         {
             slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, 
                     "conn=%" NSPRIu64 " op=%d Consumer connection extension is not in use\n",
-                    (long long unsigned int)connid, opid);
+                    connid, opid);
             ret = 2;
         }
         else if (opid == connext->in_use_opid)
@@ -252,7 +252,7 @@ consumer_connection_extension_relinquish_exclusive_access(void* conn, PRUint64 c
             /* step 4, relinquish it (normal) */
             slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, 
                     "conn=%" NSPRIu64 " op=%d Relinquishing consumer connection extension\n",
-                    (long long unsigned int)connid, opid);
+                    connid, opid);
             connext->in_use_opid = -1;
             ret = 1;
         }
@@ -261,7 +261,7 @@ consumer_connection_extension_relinquish_exclusive_access(void* conn, PRUint64 c
             /* step 4, relinquish it (forced) */
             slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, 
                     "conn=%" NSPRIu64 " op=%d Forced to relinquish consumer connection extension held by op=%d\n",
-                    (long long unsigned int)connid, opid, connext->in_use_opid);
+                    connid, opid, connext->in_use_opid);
             connext->in_use_opid = -1;
             ret = 1;
         }
@@ -269,7 +269,7 @@ consumer_connection_extension_relinquish_exclusive_access(void* conn, PRUint64 c
         {
             slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, 
                     "conn=%" NSPRIu64 " op=%d Not relinquishing consumer connection extension, it is held by op=%d!\n",
-                    (long long unsigned int)connid, opid, connext->in_use_opid);
+                    connid, opid, connext->in_use_opid);
         }
         
         /* step 5, drop the lock */
@@ -279,7 +279,7 @@ consumer_connection_extension_relinquish_exclusive_access(void* conn, PRUint64 c
     {
         slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, 
                 "conn=%" NSPRIu64 " op=%d Could not relinquish consumer extension, it is NULL!\n",
-                (long long unsigned int)connid, opid);
+                connid, opid);
     }
     
     return ret;
diff --git a/ldap/servers/plugins/replication/repl_extop.c b/ldap/servers/plugins/replication/repl_extop.c
index 4fefe9f..583d2cc 100644
--- a/ldap/servers/plugins/replication/repl_extop.c
+++ b/ldap/servers/plugins/replication/repl_extop.c
@@ -697,7 +697,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb)
 		connext->repl_protocol_version = REPL_PROTOCOL_50_INCREMENTAL;
 		slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
 			"conn=%" NSPRIu64 " op=%d repl=\"%s\": Begin incremental protocol\n",
-			(long long unsigned int)connid, opid, repl_root);
+			connid, opid, repl_root);
 		isInc = PR_TRUE;
 	}
 	else if (strcmp(protocol_oid, REPL_NSDS50_TOTAL_PROTOCOL_OID) == 0)
@@ -723,7 +723,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb)
 		}
 		slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
 				"conn=%" NSPRIu64 " op=%d repl=\"%s\": Begin total protocol\n",
-				(long long unsigned int)connid, opid, repl_root);
+				connid, opid, repl_root);
 		isInc = PR_FALSE;
 	}
 	else if (strcmp(protocol_oid, REPL_NSDS71_INCREMENTAL_PROTOCOL_OID) == 0)
@@ -732,7 +732,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb)
 		connext->repl_protocol_version = REPL_PROTOCOL_50_INCREMENTAL;
 		slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
 			"conn=%" NSPRIu64 " op=%d repl=\"%s\": Begin 7.1 incremental protocol\n",
-			(long long unsigned int)connid, opid, repl_root);
+			connid, opid, repl_root);
 		isInc = PR_TRUE;
 	}
 	else if (strcmp(protocol_oid, REPL_NSDS71_TOTAL_PROTOCOL_OID) == 0)
@@ -744,7 +744,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb)
 		}
 		slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
 				"conn=%" NSPRIu64 " op=%d repl=\"%s\": Begin 7.1 total protocol\n",
-				(long long unsigned int)connid, opid, repl_root);
+				connid, opid, repl_root);
 		isInc = PR_FALSE;
 	}
 	else
@@ -767,7 +767,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb)
         slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
 				"conn=%" NSPRIu64 " op=%d replica=\"%s\": "
 				"Replica is being configured: try again later\n",
-				(long long unsigned int)connid, opid, repl_root);
+				connid, opid, repl_root);
 		response = NSDS50_REPL_REPLICA_BUSY;
 		goto send_response;
 	}
@@ -838,7 +838,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb)
 					slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
 									"conn=%" NSPRIu64 " op=%d repl=\"%s\": "
 									"Excessive clock skew from supplier RUV\n",
-									(long long unsigned int)connid, opid, repl_root);
+									connid, opid, repl_root);
 					response = NSDS50_REPL_EXCESSIVE_CLOCK_SKEW;
 					goto send_response;
 				}
@@ -875,7 +875,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb)
         slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
 				"conn=%" NSPRIu64 " op=%d repl=\"%s\": "
 				"Replica has same replicaID %d as supplier\n",
-				(long long unsigned int)connid, opid, repl_root, replica_get_rid(replica));
+				connid, opid, repl_root, replica_get_rid(replica));
 		response = NSDS50_REPL_REPLICAID_ERROR;
 		goto send_response;
 	}
@@ -887,7 +887,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb)
 	 */
 	/* junkrc = ruv_get_first_id_and_purl(supplier_ruv, &junkrid, &locking_purl); */
 	PR_snprintf(locking_session, sizeof(locking_session), "conn=%" NSPRIu64 " id=%d",
-			(long long unsigned int)connid, opid);
+			connid, opid);
 	locking_purl = &locking_session[0];
 	if (replica_get_exclusive_access(replica, &isInc, connid, opid,
 									 locking_purl,
@@ -914,7 +914,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb)
 		slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
 						"conn=%" NSPRIu64 " op=%d repl=\"%s\": "
 						"374 - Starting sleep: connext->repl_protocol_version == %d\n",
-						(long long unsigned int)connid, opid, repl_root, connext->repl_protocol_version);
+						connid, opid, repl_root, connext->repl_protocol_version);
         
 		while (REPL_PROTOCOL_50_INCREMENTAL == connext->repl_protocol_version && i++ < max) {
 			usleep(200000);
@@ -923,7 +923,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb)
 		slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
 						"conn=%" NSPRIu64 " op=%d repl=\"%s\": "
 						"374 - Finished sleep: connext->repl_protocol_version == %d\n",
-						(long long unsigned int)connid, opid, repl_root, connext->repl_protocol_version);
+						connid, opid, repl_root, connext->repl_protocol_version);
 	}
 #endif
 
@@ -1018,7 +1018,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb)
 				"conn=%" NSPRIu64 " op=%d repl=\"%s\": "
 				"Unexpected update protocol received: %d.  "
 				"Expected incremental or total.\n",
-				(long long unsigned int)connid, opid, repl_root, connext->repl_protocol_version);
+				connid, opid, repl_root, connext->repl_protocol_version);
 		goto send_response;
     }
 
@@ -1057,7 +1057,7 @@ send_response:
 		slapi_log_error (resp_log_level, repl_plugin_name,
 			"conn=%" NSPRIu64 " op=%d replica=\"%s\": "
 			"Unable to acquire replica: error: %s%s\n",
-			(long long unsigned int)connid, opid,
+			connid, opid,
 			(replica ? slapi_sdn_get_dn(replica_get_root(replica)) : "unknown"),
 			protocol_response2string (response), purlstr);
 
@@ -1109,7 +1109,7 @@ send_response:
 	slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
 					"conn=%" NSPRIu64 " op=%d repl=\"%s\": "
 					"%s: response=%d rc=%d\n",
-					(long long unsigned int)connid, opid, repl_root,
+					connid, opid, repl_root,
 					is90 ? "StartNSDS90ReplicationRequest" :
 					"StartNSDS50ReplicationRequest", response, rc);
 	slapi_send_ldap_result(pb, LDAP_SUCCESS, NULL, NULL, 0, NULL);
diff --git a/ldap/servers/plugins/sync/sync_persist.c b/ldap/servers/plugins/sync/sync_persist.c
index 4bd7da8..53b2d13 100644
--- a/ldap/servers/plugins/sync/sync_persist.c
+++ b/ldap/servers/plugins/sync/sync_persist.c
@@ -578,14 +578,14 @@ sync_send_results( void *arg )
 	if (NULL == conn) {
 		slapi_log_error(SLAPI_LOG_FATAL, "Content Synchronization Search",
 						"conn=%" NSPRIu64 " op=%d Null connection - aborted\n",
-						(long long unsigned int)connid, opid);
+						connid, opid);
 		return;
 	}
 	conn_acq_flag = sync_acquire_connection (conn);
 	if (conn_acq_flag) {
 		slapi_log_error(SLAPI_LOG_FATAL, "Content Synchronization Search",
 						"conn=%" NSPRIu64 " op=%d Could not acquire the connection - aborted\n",
-						(long long unsigned int)connid, opid);
+						connid, opid);
 		return;
 	}
 
@@ -596,7 +596,7 @@ sync_send_results( void *arg )
 		if ( op == NULL || slapi_is_operation_abandoned( op ) ) {
 			slapi_log_error(SLAPI_LOG_PLUGIN, "Content Synchronization Search",
 						"conn=%" NSPRIu64 " op=%d Operation no longer active - terminating\n",
-						(long long unsigned int)connid, opid);
+						connid, opid);
 			break;
 		}
 		if ( NULL == req->ps_eq_head || !req->req_active) {
diff --git a/ldap/servers/plugins/syntaxes/validate_task.c b/ldap/servers/plugins/syntaxes/validate_task.c
index 9f9a143..d730dc7 100644
--- a/ldap/servers/plugins/syntaxes/validate_task.c
+++ b/ldap/servers/plugins/syntaxes/validate_task.c
@@ -231,12 +231,12 @@ syntax_validate_task_thread(void *arg)
 
 	/* Log finished message. */
 	slapi_task_log_notice(task, "Syntax validate task complete.  Found %" NSPRIu64
-	                " invalid entries.\n", (long long unsigned int)slapi_counter_get_value(td->invalid_entries));
+	                " invalid entries.\n", slapi_counter_get_value(td->invalid_entries));
 	slapi_task_log_status(task, "Syntax validate task complete.  Found %" NSPRIu64
-	                " invalid entries.\n", (long long unsigned int)slapi_counter_get_value(td->invalid_entries));
+	                " invalid entries.\n", slapi_counter_get_value(td->invalid_entries));
 	slapi_log_error(SLAPI_LOG_FATAL, SYNTAX_PLUGIN_SUBSYSTEM, "Syntax validate task complete."
 	                "  Found %" NSPRIu64 " invalid entries.\n",
-	                (long long unsigned int)slapi_counter_get_value(td->invalid_entries));
+	                slapi_counter_get_value(td->invalid_entries));
 	slapi_task_inc_progress(task);
 
 	/* this will queue the destruction of the task */
diff --git a/ldap/servers/plugins/usn/usn.c b/ldap/servers/plugins/usn/usn.c
index 55ab5f7..7a12abe 100644
--- a/ldap/servers/plugins/usn/usn.c
+++ b/ldap/servers/plugins/usn/usn.c
@@ -350,7 +350,7 @@ _usn_add_next_usn(Slapi_Entry *e, Slapi_Backend *be)
 
     /* add next USN to the entry; "be" contains the usn counter */
     usn_berval.bv_val = slapi_ch_smprintf("%" NSPRIu64, 
-    		(long long unsigned int)slapi_counter_get_value(be->be_usn_counter));
+                                          slapi_counter_get_value(be->be_usn_counter));
     usn_berval.bv_len = strlen(usn_berval.bv_val);
     slapi_entry_attr_find(e, SLAPI_ATTR_ENTRYUSN, &attr);
     if (NULL == attr) { /* ENTRYUSN does not exist; add it */
@@ -390,7 +390,7 @@ _usn_mod_next_usn(LDAPMod ***mods, Slapi_Backend *be)
     /* add next USN to the mods; "be" contains the usn counter */
     usn_berval.bv_val = counter_buf;
     PR_snprintf(usn_berval.bv_val, USN_COUNTER_BUF_LEN, "%" NSPRIu64, 
-    		(long long unsigned int)slapi_counter_get_value(be->be_usn_counter));
+                slapi_counter_get_value(be->be_usn_counter));
     usn_berval.bv_len = strlen(usn_berval.bv_val);
     bvals[0] = &usn_berval;
     bvals[1] = NULL;
@@ -528,7 +528,7 @@ usn_bepostop (Slapi_PBlock *pb)
     /* if op is not successful, don't increment the counter */
     slapi_pblock_get(pb, SLAPI_RESULT_CODE, &rc);
     if (LDAP_SUCCESS != rc) {
-	/* no plugin failure */
+        /* no plugin failure */
         rc = SLAPI_PLUGIN_SUCCESS;
         goto bail;
     }
@@ -566,7 +566,7 @@ usn_bepostop_modify (Slapi_PBlock *pb)
     /* if op is not successful, don't increment the counter */
     slapi_pblock_get(pb, SLAPI_RESULT_CODE, &rc);
     if (LDAP_SUCCESS != rc) {
-	/* no plugin failure */
+        /* no plugin failure */
         rc = SLAPI_PLUGIN_SUCCESS;
         goto bail;
     }
@@ -617,7 +617,7 @@ usn_bepostop_delete (Slapi_PBlock *pb)
     /* if op is not successful, don't increment the counter */
     slapi_pblock_get(pb, SLAPI_RESULT_CODE, &rc);
     if (LDAP_SUCCESS != rc) {
-	/* no plugin failure */
+        /* no plugin failure */
         rc = SLAPI_PLUGIN_SUCCESS;
         goto bail;
     }
@@ -711,7 +711,7 @@ usn_rootdse_search(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter,
              * then minus 1 from it (except if be_usn_counter has value 0) */
             if (slapi_counter_get_value(be->be_usn_counter)) {
                 PR_snprintf(usn_berval.bv_val, USN_COUNTER_BUF_LEN, "%" NSPRIu64,
-                		(long long unsigned int)slapi_counter_get_value(be->be_usn_counter)-1);
+                            slapi_counter_get_value(be->be_usn_counter)-1);
             } else {
                 PR_snprintf(usn_berval.bv_val, USN_COUNTER_BUF_LEN, "-1");
             }
@@ -734,7 +734,7 @@ usn_rootdse_search(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter,
              * then minus 1 from it (except if be_usn_counter has value 0) */
             if (slapi_counter_get_value(be->be_usn_counter)) {
                 PR_snprintf(usn_berval.bv_val, USN_COUNTER_BUF_LEN, "%" NSPRIu64,
-                		(long long unsigned int)slapi_counter_get_value(be->be_usn_counter)-1);
+                            slapi_counter_get_value(be->be_usn_counter)-1);
             } else {
                 PR_snprintf(usn_berval.bv_val, USN_COUNTER_BUF_LEN, "-1");
             }
diff --git a/ldap/servers/slapd/abandon.c b/ldap/servers/slapd/abandon.c
index 6b4bbf2..43158a8 100644
--- a/ldap/servers/slapd/abandon.c
+++ b/ldap/servers/slapd/abandon.c
@@ -155,19 +155,19 @@ do_abandon( Slapi_PBlock *pb )
 	if ( 0 == pagedresults_free_one_msgid_nolock(pb->pb_conn, id) ) {
 		slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 
 		    " op=%d ABANDON targetop=Simple Paged Results\n",
-		    (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid );
+		    pb->pb_conn->c_connid, pb->pb_op->o_opid );
 	} else if ( NULL == o ) {
 		slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d ABANDON"
 			" targetop=NOTFOUND msgid=%d\n",
-			(long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, id );
+			pb->pb_conn->c_connid, pb->pb_op->o_opid, id );
 	} else if ( suppressed_by_plugin ) {
 		slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d ABANDON"
 			" targetop=SUPPRESSED-BY-PLUGIN msgid=%d\n",
-			(long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, id );
+			pb->pb_conn->c_connid, pb->pb_op->o_opid, id );
 	} else {
 		slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d ABANDON"
 			" targetop=%d msgid=%d nentries=%d etime=%ld\n",
-			(long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, o->o_opid, id,
+			pb->pb_conn->c_connid, pb->pb_op->o_opid, o->o_opid, id,
 			o->o_results.r.r_search.nentries, current_time() - o->o_time );
 	}
 
diff --git a/ldap/servers/slapd/add.c b/ldap/servers/slapd/add.c
index 243ef63..12b97e8 100644
--- a/ldap/servers/slapd/add.c
+++ b/ldap/servers/slapd/add.c
@@ -201,7 +201,7 @@ do_add( Slapi_PBlock *pb )
 				!= LDAP_SUCCESS ) {
 				slapi_log_access( LDAP_DEBUG_STATS, 
 					"conn=%" NSPRIu64 " op=%d ADD dn=\"%s\", add values for type %s failed\n",
-					(long long unsigned int)pb->pb_conn->c_connid, operation->o_opid,
+					pb->pb_conn->c_connid, operation->o_opid,
 					slapi_entry_get_dn_const(e), normtype );
 				send_ldap_result( pb, rc, NULL, NULL, 0, NULL );
 
@@ -487,7 +487,7 @@ static void op_shared_add (Slapi_PBlock *pb)
 		if ( !internal_op )
 		{
 			slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d ADD dn=\"%s\"%s\n",
-							 (long long unsigned int)pb->pb_conn->c_connid,
+							 pb->pb_conn->c_connid,
 							 operation->o_opid,
 							 slapi_entry_get_dn_const(e),
 							 proxystr ? proxystr : "");
diff --git a/ldap/servers/slapd/auth.c b/ldap/servers/slapd/auth.c
index 0219576..ae4af50 100644
--- a/ldap/servers/slapd/auth.c
+++ b/ldap/servers/slapd/auth.c
@@ -403,7 +403,7 @@ handle_bad_certificate (void* clientData, PRFileDesc *prfd)
     char* issuer  = issuer_of  (clientCert);
     slapi_log_access( LDAP_DEBUG_STATS,
 	       "conn=%" NSPRIu64 " " SLAPI_COMPONENT_NAME_NSPR " error %i (%s); unauthenticated client %s; issuer %s\n",
-	       (long long unsigned int)conn->c_connid, errorCode, slapd_pr_strerror(errorCode),
+	       conn->c_connid, errorCode, slapd_pr_strerror(errorCode),
 	       subject ? escape_string( subject, sbuf ) : "NULL",
 	       issuer  ? escape_string( issuer,  ibuf ) : "NULL" );
     if (issuer)  free (issuer);
@@ -440,7 +440,7 @@ handle_handshake_done (PRFileDesc *prfd, void* clientData)
 		slapi_log_access (LDAP_DEBUG_STATS,
 			"conn=%" NSPRIu64 " SSL failed to obtain channel info; "
 			SLAPI_COMPONENT_NAME_NSPR " error %i (%s)\n",
-			(long long unsigned int)conn->c_connid, errorCode, slapd_pr_strerror(errorCode));
+			conn->c_connid, errorCode, slapd_pr_strerror(errorCode));
 		goto done;
 	}
 	if ( (slapd_ssl_getCipherSuiteInfo (channelInfo.cipherSuite, &cipherInfo, sizeof(cipherInfo)) )
@@ -449,7 +449,7 @@ handle_handshake_done (PRFileDesc *prfd, void* clientData)
 		slapi_log_access (LDAP_DEBUG_STATS,
 			"conn=%" NSPRIu64 " SSL failed to obtain cipher info; "
 			SLAPI_COMPONENT_NAME_NSPR " error %i (%s)\n",
-			(long long unsigned int)conn->c_connid, errorCode, slapd_pr_strerror(errorCode));
+			conn->c_connid, errorCode, slapd_pr_strerror(errorCode));
 		goto done;
 	}
 
@@ -469,14 +469,14 @@ handle_handshake_done (PRFileDesc *prfd, void* clientData)
     if (config_get_SSLclientAuth() == SLAPD_SSLCLIENTAUTH_OFF ) {
         (void) slapi_getSSLVersion_str(channelInfo.protocolVersion, sslversion, sizeof(sslversion));
         slapi_log_access (LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " %s %i-bit %s\n",
-                (long long unsigned int)conn->c_connid, 
+                conn->c_connid, 
                 sslversion, keySize, cipher ? cipher : "NULL" );
         goto done;
     }
     if (clientCert == NULL) {
         (void) slapi_getSSLVersion_str(channelInfo.protocolVersion, sslversion, sizeof(sslversion));
         slapi_log_access (LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " %s %i-bit %s\n",
-                (long long unsigned int)conn->c_connid, 
+                conn->c_connid, 
                 sslversion, keySize, cipher ? cipher : "NULL" );
     } else {
         subject = subject_of (clientCert);
@@ -485,7 +485,7 @@ handle_handshake_done (PRFileDesc *prfd, void* clientData)
                                                  sslversion, sizeof(sslversion));
             slapi_log_access( LDAP_DEBUG_STATS,
                        "conn=%" NSPRIu64 " %s %i-bit %s; missing subject\n",
-                       (long long unsigned int)conn->c_connid, 
+                       conn->c_connid, 
                        sslversion, keySize, cipher ? cipher : "NULL");
             goto done;
         }
@@ -496,7 +496,7 @@ handle_handshake_done (PRFileDesc *prfd, void* clientData)
                                                  sslversion, sizeof(sslversion));
             slapi_log_access( LDAP_DEBUG_STATS,
                         "conn=%" NSPRIu64 " %s %i-bit %s; client %s; issuer %s\n",
-                        (long long unsigned int)conn->c_connid,
+                        conn->c_connid,
                         sslversion, keySize, cipher ? cipher : "NULL",
                         subject ? escape_string( subject, sbuf ) : "NULL",
                         issuer  ? escape_string( issuer,  ibuf ) : "NULL");
@@ -540,7 +540,7 @@ handle_handshake_done (PRFileDesc *prfd, void* clientData)
                                              sslversion, sizeof(sslversion));
         slapi_log_access (LDAP_DEBUG_STATS, 
                           "conn=%" NSPRIu64 " %s client bound as %s\n",
-                          (long long unsigned int)conn->c_connid,
+                          conn->c_connid,
                           sslversion, clientDN);
     } else if (clientCert != NULL) {
         (void) slapi_getSSLVersion_str(channelInfo.protocolVersion,
@@ -548,7 +548,7 @@ handle_handshake_done (PRFileDesc *prfd, void* clientData)
         slapi_log_access (LDAP_DEBUG_STATS,
                           "conn=%" NSPRIu64 " %s failed to map client "
                           "certificate to LDAP DN (%s)\n",
-                          (long long unsigned int)conn->c_connid,
+                          conn->c_connid,
                           sslversion, extraErrorMsg);
     }
 
diff --git a/ldap/servers/slapd/back-ldbm/import-threads.c b/ldap/servers/slapd/back-ldbm/import-threads.c
index fdc87c0..6ad1c48 100644
--- a/ldap/servers/slapd/back-ldbm/import-threads.c
+++ b/ldap/servers/slapd/back-ldbm/import-threads.c
@@ -4031,7 +4031,7 @@ _get_import_entryusn(ImportJob *job, Slapi_Value **usn_value)
              * next entryusn. */
             PR_snprintf(counter_buf, USN_COUNTER_BUF_LEN,
                     "%" NSPRIu64,
-                    (long long unsigned int)slapi_counter_get_value(be->be_usn_counter));
+                    slapi_counter_get_value(be->be_usn_counter));
         } else {
             /* import_init value is digit.
              * Initialize the entryusn values with the digit */
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_delete.c b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
index 3de8efa..498c3c1 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_delete.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
@@ -136,7 +136,7 @@ ldbm_back_delete( Slapi_PBlock *pb )
 	if (pb->pb_conn)
 	{
 		slapi_log_error (SLAPI_LOG_TRACE, "ldbm_back_delete", "enter conn=%" NSPRIu64 " op=%d\n",
-				(long long unsigned int)pb->pb_conn->c_connid, operation->o_opid);
+				pb->pb_conn->c_connid, operation->o_opid);
 	}
 
 	if ((NULL == addr) || (NULL == sdnp))
@@ -1500,7 +1500,7 @@ diskfull_return:
 	if (pb->pb_conn)
 	{
 		slapi_log_error (SLAPI_LOG_TRACE, "ldbm_back_delete", "leave conn=%" NSPRIu64 " op=%d\n",
-				(long long unsigned int)pb->pb_conn->c_connid, operation->o_opid);
+				pb->pb_conn->c_connid, operation->o_opid);
 	}
 
 	return rc;
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
index 6a4982c..f5a404b 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c
@@ -171,7 +171,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb )
     if (pb->pb_conn)
     {
         slapi_log_error (SLAPI_LOG_TRACE, "ldbm_back_modrdn", "enter conn=%" NSPRIu64 " op=%d\n",
-                (long long unsigned int)pb->pb_conn->c_connid, operation->o_opid);
+                pb->pb_conn->c_connid, operation->o_opid);
     }
 
     inst = (ldbm_instance *) be->be_instance_info;
@@ -1563,7 +1563,7 @@ common_return:
     if (pb->pb_conn)
     {
         slapi_log_error (SLAPI_LOG_TRACE, "ldbm_back_modrdn", "leave conn=%" NSPRIu64 " op=%d\n",
-                (long long unsigned int)pb->pb_conn->c_connid, operation->o_opid);
+                pb->pb_conn->c_connid, operation->o_opid);
     }
     return retval;
 }
diff --git a/ldap/servers/slapd/back-ldbm/misc.c b/ldap/servers/slapd/back-ldbm/misc.c
index d344e3c..19c7593 100644
--- a/ldap/servers/slapd/back-ldbm/misc.c
+++ b/ldap/servers/slapd/back-ldbm/misc.c
@@ -83,8 +83,8 @@ void ldbm_log_access_message(Slapi_PBlock *pblock,char *string)
         return;
     }
     operation_id = operation->o_opid;
-    slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d %s\n",
-            (long long unsigned int)connection_id, operation_id, string);
+    slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d %s\n",
+                     connection_id, operation_id, string);
 }
 
 int return_on_disk_full(struct ldbminfo  *li)
@@ -443,7 +443,7 @@ ldbm_txn_ruv_modify_context( Slapi_PBlock *pb, modify_context *mc )
     bentry = find_entry2modify_only( pb, be, &bentry_addr, &txn );
 
     if (NULL == bentry) {
-	/* Uh oh, we couldn't find and lock the RUV entry! */
+        /* Uh oh, we couldn't find and lock the RUV entry! */
         LDAPDebug( LDAP_DEBUG_ANY, "Error: ldbm_txn_ruv_modify_context failed to retrieve and lock RUV entry\n",
             0, 0, 0 );
         rc = -1;
diff --git a/ldap/servers/slapd/back-ldbm/monitor.c b/ldap/servers/slapd/back-ldbm/monitor.c
index 409c771..469778d 100644
--- a/ldap/servers/slapd/back-ldbm/monitor.c
+++ b/ldap/servers/slapd/back-ldbm/monitor.c
@@ -130,9 +130,9 @@ int ldbm_back_monitor_instance_search(Slapi_PBlock *pb, Slapi_Entry *e,
         /* fetch cache statistics */
         cache_get_stats(&(inst->inst_dncache), &hits, &tries, 
                         &nentries, &maxentries, &size, &maxsize);
-        sprintf(buf, "%" NSPRIu64, (long long unsigned int)hits);
+        sprintf(buf, "%" NSPRIu64, hits);
         MSET("dnCacheHits");
-        sprintf(buf, "%" NSPRIu64, (long long unsigned int)tries);
+        sprintf(buf, "%" NSPRIu64, tries);
         MSET("dnCacheTries");
         sprintf(buf, "%lu", (unsigned long)(100.0*(double)hits / (double)(tries > 0 ? tries : 1)));
         MSET("dnCacheHitRatio");
@@ -148,11 +148,11 @@ int ldbm_back_monitor_instance_search(Slapi_PBlock *pb, Slapi_Entry *e,
     /* normalized dn cache stats */
     if(ndn_cache_started()){
         ndn_cache_get_stats(&hits, &tries, &size, &maxsize, &count);
-        sprintf(buf, "%" NSPRIu64, (long long unsigned int)tries);
+        sprintf(buf, "%" NSPRIu64, tries);
         MSET("normalizedDnCacheTries");
-        sprintf(buf, "%" NSPRIu64, (long long unsigned int)hits);
+        sprintf(buf, "%" NSPRIu64, hits);
         MSET("normalizedDnCacheHits");
-        sprintf(buf, "%" NSPRIu64, (long long unsigned int)(tries - hits));
+        sprintf(buf, "%" NSPRIu64, (tries - hits));
         MSET("normalizedDnCacheMisses");
         sprintf(buf, "%lu", (unsigned long)(100.0*(double)hits / (double)(tries > 0 ? tries : 1)));
         MSET("normalizedDnCacheHitRatio");
diff --git a/ldap/servers/slapd/bind.c b/ldap/servers/slapd/bind.c
index 7acec84..70d2d19 100644
--- a/ldap/servers/slapd/bind.c
+++ b/ldap/servers/slapd/bind.c
@@ -899,25 +899,25 @@ log_bind_access (
         slapi_log_access( LDAP_DEBUG_STATS, 
                           "conn=%" NSPRIu64 " op=%d BIND dn=\"%s\" "
                           "method=sasl version=%d mech=%s, %s\n",
-                          (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, dn,
+                          pb->pb_conn->c_connid, pb->pb_op->o_opid, dn,
                           version, saslmech, msg );
     } else if (method == LDAP_AUTH_SASL && saslmech) {
         slapi_log_access( LDAP_DEBUG_STATS, 
                           "conn=%" NSPRIu64 " op=%d BIND dn=\"%s\" "
                           "method=sasl version=%d mech=%s\n",
-                          (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, dn,
+                          pb->pb_conn->c_connid, pb->pb_op->o_opid, dn,
                           version, saslmech );
     } else if (msg) {
         slapi_log_access( LDAP_DEBUG_STATS, 
                           "conn=%" NSPRIu64 " op=%d BIND dn=\"%s\" "
                           "method=%ld version=%d, %s\n",
-                          (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, dn,
+                          pb->pb_conn->c_connid, pb->pb_op->o_opid, dn,
                           method, version, msg );
     } else {
         slapi_log_access( LDAP_DEBUG_STATS, 
                           "conn=%" NSPRIu64 " op=%d BIND dn=\"%s\" "
                           "method=%ld version=%d\n",
-                          (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, dn,
+                          pb->pb_conn->c_connid, pb->pb_op->o_opid, dn,
                           method, version );
     }
 }
diff --git a/ldap/servers/slapd/compare.c b/ldap/servers/slapd/compare.c
index 873d07f..5fb1d2f 100644
--- a/ldap/servers/slapd/compare.c
+++ b/ldap/servers/slapd/compare.c
@@ -144,7 +144,7 @@ do_compare( Slapi_PBlock *pb )
 
 	slapi_log_access( LDAP_DEBUG_STATS,
 	    "conn=%" NSPRIu64 " op=%d CMP dn=\"%s\" attr=\"%s\"\n",
-	    (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, dn, ava.ava_type );
+	    pb->pb_conn->c_connid, pb->pb_op->o_opid, dn, ava.ava_type );
 
 	/*
 	 * We could be serving multiple database backends.  Select the
diff --git a/ldap/servers/slapd/connection.c b/ldap/servers/slapd/connection.c
index 529a3b1..9f0d9dc 100644
--- a/ldap/servers/slapd/connection.c
+++ b/ldap/servers/slapd/connection.c
@@ -448,7 +448,7 @@ connection_reset(Connection* conn, int ns, PRNetAddr * from, int fromLen, int is
     /* log useful stuff to our access log */
     slapi_log_access( LDAP_DEBUG_STATS,
 	    "conn=%" NSPRIu64 " fd=%d slot=%d %sconnection from %s to %s\n",
-	    (long long unsigned int)conn->c_connid, conn->c_sd, ns, pTmp, str_ip, str_destip );
+	    conn->c_connid, conn->c_sd, ns, pTmp, str_ip, str_destip );
 
     /* initialize the remaining connection fields */
     conn->c_ldapversion = LDAP_VERSION3;
@@ -548,7 +548,7 @@ connection_need_new_password(const Connection *conn, const Operation *op, Slapi_
 	{
 		slapi_add_pwd_control ( pb, LDAP_CONTROL_PWEXPIRED, 0);	
 		slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d %s\n",
-			(long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid,
+			pb->pb_conn->c_connid, pb->pb_op->o_opid,
 			"UNPROCESSED OPERATION - need new password" );
 		send_ldap_result( pb, LDAP_UNWILLING_TO_PERFORM, 
 			NULL, NULL, 0, NULL );
@@ -592,7 +592,7 @@ connection_dispatch_operation(Connection *conn, Operation *op, Slapi_PBlock *pb)
 		slapi_log_access( LDAP_DEBUG_STATS,
 			"conn=%" NSPRIu64 " op=%d UNPROCESSED OPERATION"
 			" - Insufficient SSF (local_ssf=%d sasl_ssf=%d ssl_ssf=%d)\n",
-			(long long unsigned int)conn->c_connid, op->o_opid, conn->c_local_ssf,
+			conn->c_connid, op->o_opid, conn->c_local_ssf,
 			conn->c_sasl_ssf, conn->c_ssl_ssf );
 		send_ldap_result( pb, LDAP_UNWILLING_TO_PERFORM, NULL,
 			"Minimum SSF not met.", 0, NULL );
@@ -620,7 +620,7 @@ connection_dispatch_operation(Connection *conn, Operation *op, Slapi_PBlock *pb)
 		slapi_log_access( LDAP_DEBUG_STATS,
 			"conn=%" NSPRIu64 " op=%d UNPROCESSED OPERATION"
 			" - Anonymous access not allowed\n",
-			(long long unsigned int)conn->c_connid, op->o_opid );
+			conn->c_connid, op->o_opid );
 
 		send_ldap_result( pb, LDAP_INAPPROPRIATE_AUTH, NULL,
                                   "Anonymous access is not allowed.",
@@ -676,7 +676,7 @@ connection_dispatch_operation(Connection *conn, Operation *op, Slapi_PBlock *pb)
 			int i = 1;
 			int ret = setsockopt(conn->c_sd,IPPROTO_TCP,TCP_CORK,&i,sizeof(i));
 			if (ret < 0) {
-				LDAPDebug(LDAP_DEBUG_ANY, "Failed to set TCP_CORK on connection %" NSPRIu64 "\n",(long long unsigned int)conn->c_connid, 0, 0);
+				LDAPDebug(LDAP_DEBUG_ANY, "Failed to set TCP_CORK on connection %" NSPRIu64 "\n",conn->c_connid, 0, 0);
 			}
 			pop_cork = 1;
 		}
@@ -689,7 +689,7 @@ connection_dispatch_operation(Connection *conn, Operation *op, Slapi_PBlock *pb)
 			int i = 0;
 			int ret = setsockopt(conn->c_sd,IPPROTO_TCP,TCP_CORK,&i,sizeof(i));
 			if (ret < 0) {
-				LDAPDebug(LDAP_DEBUG_ANY, "Failed to clear TCP_CORK on connection %" NSPRIu64 "\n",(long long unsigned int)conn->c_connid, 0, 0);
+				LDAPDebug(LDAP_DEBUG_ANY, "Failed to clear TCP_CORK on connection %" NSPRIu64 "\n",conn->c_connid, 0, 0);
 			}
 		}
 #endif
@@ -728,7 +728,7 @@ int connection_release_nolock (Connection *conn)
     {
         slapi_log_error(SLAPI_LOG_FATAL, "connection",
 		                "conn=%" NSPRIu64 " fd=%d Attempt to release connection that is not acquired\n",
-		                (long long unsigned int)conn->c_connid, conn->c_sd);
+		                conn->c_connid, conn->c_sd);
         PR_ASSERT (PR_FALSE);
         return -1;
     }
@@ -749,7 +749,7 @@ int connection_acquire_nolock (Connection *conn)
 	/* This may happen while other threads are still working on this connection */
         slapi_log_error(SLAPI_LOG_FATAL, "connection",
 		                "conn=%" NSPRIu64 " fd=%d Attempt to acquire connection in the closing state\n",
-		                (long long unsigned int)conn->c_connid, conn->c_sd);
+		                conn->c_connid, conn->c_sd);
         return -1;
     }
     else
@@ -2966,13 +2966,13 @@ log_ber_too_big_error(const Connection *conn, ber_len_t ber_len,
 			"conn=%" NSPRIu64 " fd=%d Incoming BER Element was too long, max allowable"
 			" is %" BERLEN_T " bytes. Change the nsslapd-maxbersize attribute in"
 			" cn=config to increase.\n",
-			(long long unsigned int)conn->c_connid, conn->c_sd, maxbersize );
+			conn->c_connid, conn->c_sd, maxbersize );
 	} else {
 		slapi_log_error( SLAPI_LOG_FATAL, "connection",
 			"conn=%" NSPRIu64 " fd=%d Incoming BER Element was %" BERLEN_T " bytes, max allowable"
 			" is %" BERLEN_T " bytes. Change the nsslapd-maxbersize attribute in"
 			" cn=config to increase.\n",
-			(long long unsigned int)conn->c_connid, conn->c_sd, ber_len, maxbersize );
+			conn->c_connid, conn->c_sd, ber_len, maxbersize );
 	}
 }
 
@@ -3023,13 +3023,13 @@ disconnect_server_nomutex( Connection *conn, PRUint64 opconnid, int opid, PRErro
 		if (error && (EPIPE != error) ) {
 			slapi_log_access( LDAP_DEBUG_STATS,
 			  "conn=%" NSPRIu64 " op=%d fd=%d closed error %d (%s) - %s\n",
-			  (long long unsigned int)conn->c_connid, opid, conn->c_sd, error,
+			  conn->c_connid, opid, conn->c_sd, error,
 			  slapd_system_strerror(error),
 			  slapd_pr_strerror(reason));
 		} else {
 			slapi_log_access( LDAP_DEBUG_STATS,
 			  "conn=%" NSPRIu64 " op=%d fd=%d closed - %s\n",
-			  (long long unsigned int)conn->c_connid, opid, conn->c_sd,
+			  conn->c_connid, opid, conn->c_sd,
 			  slapd_pr_strerror(reason));
 		}
 
diff --git a/ldap/servers/slapd/conntable.c b/ldap/servers/slapd/conntable.c
index f1643ca..5225e11 100644
--- a/ldap/servers/slapd/conntable.c
+++ b/ldap/servers/slapd/conntable.c
@@ -440,8 +440,8 @@ connection_table_as_entry(Connection_Table *ct, Slapi_Entry *e)
 			 *     by max threads.
 			 */
 			PR_snprintf(maxthreadbuf, sizeof(maxthreadbuf), "%d:%"NSPRIu64":%"NSPRIu64"",
-				maxthreadstate, (long long unsigned int)ct->c[i].c_maxthreadscount,
-				(long long unsigned int)ct->c[i].c_maxthreadsblocked);
+				maxthreadstate, ct->c[i].c_maxthreadscount,
+				ct->c[i].c_maxthreadsblocked);
 
 			if ((lendn + strlen(maxthreadbuf)) > (BUFSIZ - 46)) {
 				/*
@@ -475,17 +475,17 @@ connection_table_as_entry(Connection_Table *ct, Slapi_Entry *e)
 	val.bv_len = strlen( buf );
 	attrlist_replace( &e->e_attrs, "currentconnections", vals );
 
-	PR_snprintf( buf, sizeof(buf), "%" NSPRIu64, (long long unsigned int)slapi_counter_get_value(num_conns));
+	PR_snprintf( buf, sizeof(buf), "%" NSPRIu64, slapi_counter_get_value(num_conns));
 	val.bv_val = buf;
 	val.bv_len = strlen( buf );
 	attrlist_replace( &e->e_attrs, "totalconnections", vals );
 
-	PR_snprintf( buf, sizeof(buf), "%" NSPRIu64, (long long unsigned int)slapi_counter_get_value(conns_in_maxthreads));
+	PR_snprintf( buf, sizeof(buf), "%" NSPRIu64, slapi_counter_get_value(conns_in_maxthreads));
 	val.bv_val = buf;
 	val.bv_len = strlen( buf );
 	attrlist_replace( &e->e_attrs, "currentconnectionsatmaxthreads", vals );
 
-	PR_snprintf( buf, sizeof(buf), "%" NSPRIu64, (long long unsigned int)slapi_counter_get_value(max_threads_count));
+	PR_snprintf( buf, sizeof(buf), "%" NSPRIu64, slapi_counter_get_value(max_threads_count));
 	val.bv_val = buf;
 	val.bv_len = strlen( buf );
 	attrlist_replace( &e->e_attrs, "maxthreadsperconnhits", vals );
diff --git a/ldap/servers/slapd/control.c b/ldap/servers/slapd/control.c
index d97aa2f..02b88c1 100644
--- a/ldap/servers/slapd/control.c
+++ b/ldap/servers/slapd/control.c
@@ -367,7 +367,7 @@ get_ldapmessage_controls_ext(
                 slapi_pblock_set(pb, SLAPI_MANAGEDSAIT, &ctrl_not_found);
                 slapi_pblock_set(pb, SLAPI_PWPOLICY, &ctrl_not_found);
                 slapi_log_error(SLAPI_LOG_CONNS, "connection", "Warning: conn=%" NSPRIu64 " op=%d contains an empty list of controls\n",
-                        (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid);
+                        pb->pb_conn->c_connid, pb->pb_op->o_opid);
         } else {
                 if ((tag != LBER_END_OF_SEQORSET) && (len != -1)) {
                         goto free_and_return;
diff --git a/ldap/servers/slapd/delete.c b/ldap/servers/slapd/delete.c
index b7fe02b..6d1a45b 100644
--- a/ldap/servers/slapd/delete.c
+++ b/ldap/servers/slapd/delete.c
@@ -294,7 +294,7 @@ static void op_shared_delete (Slapi_PBlock *pb)
 		if (!internal_op )
 		{
 			slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d DEL dn=\"%s\"%s\n",
-							(long long unsigned int)pb->pb_conn->c_connid,
+							pb->pb_conn->c_connid,
 							pb->pb_op->o_opid,
 							slapi_sdn_get_dn(sdn),
 							proxystr ? proxystr: "");
diff --git a/ldap/servers/slapd/extendop.c b/ldap/servers/slapd/extendop.c
index 4710c98..e5a4fcb 100644
--- a/ldap/servers/slapd/extendop.c
+++ b/ldap/servers/slapd/extendop.c
@@ -282,14 +282,14 @@ do_extended( Slapi_PBlock *pb )
 		LDAPDebug( LDAP_DEBUG_ARGS, "do_extended: oid (%s)\n", extoid, 0, 0 );
 
 		slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d EXT oid=\"%s\"\n",
-				(long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, extoid );
+				pb->pb_conn->c_connid, pb->pb_op->o_opid, extoid );
 	} else {
 		LDAPDebug( LDAP_DEBUG_ARGS, "do_extended: oid (%s-%s)\n",
 				extoid, name, 0 );
 
 		slapi_log_access( LDAP_DEBUG_STATS,
 			"conn=%" NSPRIu64 " op=%d EXT oid=\"%s\" name=\"%s\"\n",
-			(long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, extoid, name );
+			pb->pb_conn->c_connid, pb->pb_op->o_opid, extoid, name );
 	}
 
 	/* during a bulk import, only BULK_IMPORT_DONE is allowed! 
diff --git a/ldap/servers/slapd/modify.c b/ldap/servers/slapd/modify.c
index fb0fdde..9b2f42d 100644
--- a/ldap/servers/slapd/modify.c
+++ b/ldap/servers/slapd/modify.c
@@ -713,7 +713,7 @@ static void op_shared_modify (Slapi_PBlock *pb, int pw_change, char *old_pw)
 		if ( !internal_op )
 		{
 			slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d MOD dn=\"%s\"%s\n",
-							 (long long unsigned int)pb->pb_conn->c_connid,
+							 pb->pb_conn->c_connid,
 							 pb->pb_op->o_opid,
 							 slapi_sdn_get_dn(sdn),
 							 proxystr ? proxystr : "");
@@ -1245,7 +1245,7 @@ static int op_shared_allow_pw_change (Slapi_PBlock *pb, LDAPMod *mod, char **old
 		if (operation_is_flag_set(operation,OP_FLAG_ACTION_LOG_ACCESS))
 		{
 			slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d MOD dn=\"%s\"\n",
-					(long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid,
+					pb->pb_conn->c_connid, pb->pb_op->o_opid,
 					slapi_sdn_get_dn(&sdn));
 		}
 
@@ -1285,7 +1285,7 @@ static int op_shared_allow_pw_change (Slapi_PBlock *pb, LDAPMod *mod, char **old
 					proxystr = slapi_ch_smprintf(" authzid=\"%s\"", proxydn);
 				}
 				slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d MOD dn=\"%s\"%s\n",
-						(long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid,
+						pb->pb_conn->c_connid, pb->pb_op->o_opid,
 						slapi_sdn_get_dn(&sdn), proxystr ? proxystr : "");
 			}
 
@@ -1326,7 +1326,7 @@ static int op_shared_allow_pw_change (Slapi_PBlock *pb, LDAPMod *mod, char **old
 				}
 
 				slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d MOD dn=\"%s\"%s, %s\n",
-						(long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid,
+						pb->pb_conn->c_connid, pb->pb_op->o_opid,
 						slapi_sdn_get_dn(&sdn),
 						proxystr ? proxystr : "",
 						"user is not allowed to change password");
@@ -1352,7 +1352,7 @@ static int op_shared_allow_pw_change (Slapi_PBlock *pb, LDAPMod *mod, char **old
 			if ( !internal_op )
 			{
 				slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d MOD dn=\"%s\"%s, %s\n",
-								 (long long unsigned int)pb->pb_conn->c_connid,
+								 pb->pb_conn->c_connid,
 								 pb->pb_op->o_opid,
 								 slapi_sdn_get_dn(&sdn),
 								 proxystr ? proxystr : "",
@@ -1395,7 +1395,7 @@ static int op_shared_allow_pw_change (Slapi_PBlock *pb, LDAPMod *mod, char **old
 					if ( !internal_op )
 					{
 						slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d MOD dn=\"%s\"%s, %s\n",
-										 (long long unsigned int)pb->pb_conn->c_connid,
+										 pb->pb_conn->c_connid,
 										 pb->pb_op->o_opid,
 										 slapi_sdn_get_dn(&sdn),
 										 proxystr ? proxystr : "",
diff --git a/ldap/servers/slapd/modrdn.c b/ldap/servers/slapd/modrdn.c
index 8e7aff7..b4658c3 100644
--- a/ldap/servers/slapd/modrdn.c
+++ b/ldap/servers/slapd/modrdn.c
@@ -493,7 +493,7 @@ op_shared_rename(Slapi_PBlock *pb, int passin_args)
 		{
 			slapi_log_access(LDAP_DEBUG_STATS,
 					 "conn=%" NSPRIu64 " op=%d MODRDN dn=\"%s\" newrdn=\"%s\" newsuperior=\"%s\"%s\n",
-					 (long long unsigned int)pb->pb_conn->c_connid,
+					 pb->pb_conn->c_connid,
 					 pb->pb_op->o_opid,
 					 dn,
 					 newrdn ? newrdn : "(null)",
@@ -527,7 +527,7 @@ op_shared_rename(Slapi_PBlock *pb, int passin_args)
 		if ( !internal_op ) {
 			slapi_log_error(SLAPI_LOG_ARGS, NULL, 
 				 "conn=%" NSPRIu64 " op=%d MODRDN invalid new RDN (\"%s\")\n",
-				 (long long unsigned int)pb->pb_conn->c_connid,
+				 pb->pb_conn->c_connid,
 				 pb->pb_op->o_opid,
 				 (NULL == newrdn) ? "(null)" : newrdn);
 		} else {
@@ -560,7 +560,7 @@ op_shared_rename(Slapi_PBlock *pb, int passin_args)
 		if (!internal_op) {
 			slapi_log_error(SLAPI_LOG_ARGS, NULL,
 				 "conn=%" NSPRIu64 " op=%d MODRDN invalid new superior (\"%s\")",
-				 (long long unsigned int)pb->pb_conn->c_connid,
+				 pb->pb_conn->c_connid,
 				 pb->pb_op->o_opid,
 				 newsuperior ? newsuperior : "(null)");
 		} else {
diff --git a/ldap/servers/slapd/monitor.c b/ldap/servers/slapd/monitor.c
index 5b8147a..2c15c39 100644
--- a/ldap/servers/slapd/monitor.c
+++ b/ldap/servers/slapd/monitor.c
@@ -91,19 +91,19 @@ monitor_info(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int *ret
 
 	connection_table_as_entry(the_connection_table, e);
 
-	val.bv_len = PR_snprintf( buf, sizeof(buf), "%" NSPRIu64, (long long unsigned int)slapi_counter_get_value(ops_initiated) );
+	val.bv_len = PR_snprintf( buf, sizeof(buf), "%" NSPRIu64, slapi_counter_get_value(ops_initiated) );
 	val.bv_val = buf;
 	attrlist_replace( &e->e_attrs, "opsinitiated", vals );
 
-	val.bv_len = PR_snprintf( buf, sizeof(buf), "%" NSPRIu64, (long long unsigned int)slapi_counter_get_value(ops_completed) );
+	val.bv_len = PR_snprintf( buf, sizeof(buf), "%" NSPRIu64, slapi_counter_get_value(ops_completed) );
 	val.bv_val = buf;
 	attrlist_replace( &e->e_attrs, "opscompleted", vals );
 
-	val.bv_len = PR_snprintf ( buf, sizeof(buf), "%" NSPRIu64, (long long unsigned int)g_get_num_entries_sent() );
+	val.bv_len = PR_snprintf ( buf, sizeof(buf), "%" NSPRIu64, g_get_num_entries_sent() );
 	val.bv_val = buf;
 	attrlist_replace( &e->e_attrs, "entriessent", vals );
 
-	val.bv_len = PR_snprintf ( buf, sizeof(buf), "%" NSPRIu64, (long long unsigned int)g_get_num_bytes_sent() );
+	val.bv_len = PR_snprintf ( buf, sizeof(buf), "%" NSPRIu64, g_get_num_bytes_sent() );
 	val.bv_val = buf;
 	attrlist_replace( &e->e_attrs, "bytessent", vals );
 
diff --git a/ldap/servers/slapd/operation.c b/ldap/servers/slapd/operation.c
index 69f0069..f27c673 100644
--- a/ldap/servers/slapd/operation.c
+++ b/ldap/servers/slapd/operation.c
@@ -609,7 +609,7 @@ int slapi_connection_acquire(Slapi_Connection *conn)
 	/* This may happen while other threads are still working on this connection */
         slapi_log_error(SLAPI_LOG_FATAL, "connection",
 		                "conn=%" NSPRIu64 " fd=%d Attempt to acquire connection in the closing state\n",
-		                (long long unsigned int)conn->c_connid, conn->c_sd);
+		                conn->c_connid, conn->c_sd);
         rc = -1;
     }
     else
@@ -647,7 +647,7 @@ slapi_connection_remove_operation( Slapi_PBlock *pb, Slapi_Connection *conn, Sla
 		if (conn->c_refcnt <= 0) {
         		slapi_log_error(SLAPI_LOG_FATAL, "connection",
 		                "conn=%" NSPRIu64 " fd=%d Attempt to release connection that is not acquired\n",
-		                (long long unsigned int)conn->c_connid, conn->c_sd);
+		                conn->c_connid, conn->c_sd);
         		rc = -1;
 		} else {
         		conn->c_refcnt--;
diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c
index c8a5f8c..84a2bb4 100644
--- a/ldap/servers/slapd/opshared.c
+++ b/ldap/servers/slapd/opshared.c
@@ -1740,7 +1740,7 @@ void op_shared_log_error_access (Slapi_PBlock *pb, const char *type, const char
     }
 
     slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d %s dn=\"%s\"%s, %s\n",
-                      ( pb->pb_conn ? (long long unsigned int)pb->pb_conn->c_connid : 0),
+                      ( pb->pb_conn ? pb->pb_conn->c_connid : 0),
                       ( pb->pb_op ? pb->pb_op->o_opid : 0), 
                       type, 
                       dn, 
diff --git a/ldap/servers/slapd/psearch.c b/ldap/servers/slapd/psearch.c
index b059a36..25a562a 100644
--- a/ldap/servers/slapd/psearch.c
+++ b/ldap/servers/slapd/psearch.c
@@ -313,7 +313,7 @@ ps_send_results( void *arg )
 	if (conn_acq_flag) {
 		slapi_log_error(SLAPI_LOG_CONNS, "Persistent Search",
 				"conn=%" NSPRIu64 " op=%d Could not acquire the connection - psearch aborted\n",
-				(long long unsigned int)ps->ps_pblock->pb_conn->c_connid, ps->ps_pblock->pb_op->o_opid);
+				ps->ps_pblock->pb_conn->c_connid, ps->ps_pblock->pb_op->o_opid);
 	}
 
     PR_Lock( psearch_list->pl_cvarlock );
@@ -323,7 +323,7 @@ ps_send_results( void *arg )
 	if ( ps->ps_pblock->pb_op == NULL || slapi_op_abandoned( ps->ps_pblock ) ) {
 		slapi_log_error(SLAPI_LOG_CONNS, "Persistent Search",
 				"conn=%" NSPRIu64 " op=%d The operation has been abandoned\n",
-				(long long unsigned int)ps->ps_pblock->pb_conn->c_connid, ps->ps_pblock->pb_op->o_opid);
+				ps->ps_pblock->pb_conn->c_connid, ps->ps_pblock->pb_op->o_opid);
 	    break;
 	}
 	if ( NULL == ps->ps_eq_head ) {
@@ -381,7 +381,7 @@ ps_send_results( void *arg )
 			if (rc) {
 				slapi_log_error(SLAPI_LOG_CONNS, "Persistent Search",
 								"conn=%" NSPRIu64 " op=%d Error %d sending entry %s with op status %d\n",
-								(long long unsigned int)ps->ps_pblock->pb_conn->c_connid, ps->ps_pblock->pb_op->o_opid,
+								ps->ps_pblock->pb_conn->c_connid, ps->ps_pblock->pb_op->o_opid,
 								rc, slapi_entry_get_dn_const(ec), ps->ps_pblock->pb_op->o_status);
 			}
 		}
@@ -430,7 +430,7 @@ ps_send_results( void *arg )
 
 	slapi_log_error(SLAPI_LOG_CONNS, "Persistent Search",
 					"conn=%" NSPRIu64 " op=%d Releasing the connection and operation\n",
-					(long long unsigned int)conn->c_connid, ps->ps_pblock->pb_op->o_opid);
+					conn->c_connid, ps->ps_pblock->pb_op->o_opid);
     /* Delete this op from the connection's list */
     connection_remove_operation_ext( ps->ps_pblock, conn, ps->ps_pblock->pb_op );
 
@@ -566,7 +566,7 @@ ps_service_persistent_searches( Slapi_Entry *e, Slapi_Entry *eprev, ber_int_t ch
 		slapi_log_error(SLAPI_LOG_CONNS, "Persistent Search",
 						"conn=%" NSPRIu64 " op=%d entry %s with chgtype %d "
 						"matches the ps changetype %d\n",
-						(long long unsigned int)ps->ps_pblock->pb_conn->c_connid,
+						ps->ps_pblock->pb_conn->c_connid,
 						ps->ps_pblock->pb_op->o_opid,
 						edn, chgtype, ps->ps_changetypes);
 
diff --git a/ldap/servers/slapd/result.c b/ldap/servers/slapd/result.c
index 45a5b4c..d5984df 100644
--- a/ldap/servers/slapd/result.c
+++ b/ldap/servers/slapd/result.c
@@ -2002,7 +2002,7 @@ log_result( Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentrie
 							  "conn=%" NSPRIu64 " op=%d RESULT err=%d"
 							  " tag=%" BERTAG_T " nentries=%d etime=%s%s%s"
 							  ", SASL bind in progress\n",
-							  (long long unsigned int)op->o_connid,
+							  op->o_connid,
 							  op->o_opid,
 							  err, tag, nentries,
 							  etime,
@@ -2034,7 +2034,7 @@ log_result( Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentrie
 							  "conn=%" NSPRIu64 " op=%d RESULT err=%d"
 							  " tag=%" BERTAG_T " nentries=%d etime=%s%s%s"
 							  " dn=\"%s\"\n",
-							  (long long unsigned int)op->o_connid,
+							  op->o_connid,
 							  op->o_opid,
 							  err, tag, nentries,
 							  etime,
@@ -2059,7 +2059,7 @@ log_result( Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentrie
 			slapi_log_access( LDAP_DEBUG_STATS,
 							  "conn=%" NSPRIu64 " op=%d RESULT err=%d"
 							  " tag=%" BERTAG_T " nentries=%d etime=%s%s%s\n",
-							  (long long unsigned int)op->o_connid,
+							  op->o_connid,
 							  op->o_opid,
 							  err, tag, nentries,
 							  etime,
@@ -2123,7 +2123,7 @@ log_entry( Operation *op, Slapi_Entry *e )
 	if ( !internal_op )
 	{
 		slapi_log_access( LDAP_DEBUG_STATS2, "conn=%" NSPRIu64 " op=%d ENTRY dn=\"%s\"\n",
-			(long long unsigned int)op->o_connid, op->o_opid,
+			op->o_connid, op->o_opid,
 			slapi_entry_get_dn_const(e));
 	}
 	else
@@ -2148,7 +2148,7 @@ log_referral( Operation *op )
 	if ( !internal_op )
 	{
 		slapi_log_access( LDAP_DEBUG_STATS2, "conn=%" NSPRIu64 " op=%d REFERRAL\n",
-			(long long unsigned int)op->o_connid, op->o_opid );
+			op->o_connid, op->o_opid );
 	}
 	else
 	{
diff --git a/ldap/servers/slapd/sasl_io.c b/ldap/servers/slapd/sasl_io.c
index 3fe9057..b522d3d 100644
--- a/ldap/servers/slapd/sasl_io.c
+++ b/ldap/servers/slapd/sasl_io.c
@@ -281,7 +281,7 @@ sasl_io_start_packet(PRFileDesc *fd, PRIntn flags, PRIntervalTime timeout, PRInt
         ber_tag_t tag = 0;
 
         slapi_log_error( SLAPI_LOG_CONNS, "sasl_io_start_packet", "conn=%" NSPRIu64 " fd=%d "
-                "Sent an LDAP message that was not encrypted.\n", (long long unsigned int)c->c_connid,
+                "Sent an LDAP message that was not encrypted.\n", c->c_connid,
                 c->c_sd);
 
         /* Build a berval so we can get the length before reading in the entire packet */
@@ -297,7 +297,7 @@ sasl_io_start_packet(PRFileDesc *fd, PRIntn flags, PRIntervalTime timeout, PRInt
                     "conn=%" NSPRIu64 " fd=%d Incoming BER Element was too long, max allowable "
                     "is %" BERLEN_T " bytes. Change the nsslapd-maxbersize attribute in "
                     "cn=config to increase.\n",
-                    (long long unsigned int)c->c_connid, c->c_sd, maxbersize );
+                    c->c_connid, c->c_sd, maxbersize );
             PR_SetError(PR_IO_ERROR, 0);
             return PR_FAILURE;
         }
@@ -388,7 +388,7 @@ sasl_io_start_packet(PRFileDesc *fd, PRIntn flags, PRIntervalTime timeout, PRInt
                 if (*ber->ber_ptr == LDAP_REQ_UNBIND){
 #endif
                     slapi_log_error( SLAPI_LOG_CONNS, "sasl_io_start_packet", "conn=%" NSPRIu64 " fd=%d "
-                            "Received unencrypted UNBIND operation.\n", (long long unsigned int)c->c_connid,
+                            "Received unencrypted UNBIND operation.\n", c->c_connid,
                             c->c_sd);
                     sp->encrypted_buffer_count = sp->encrypted_buffer_offset;
                     sp->encrypted_buffer_offset = 0;
@@ -398,9 +398,9 @@ sasl_io_start_packet(PRFileDesc *fd, PRIntn flags, PRIntervalTime timeout, PRInt
                 slapi_log_error( SLAPI_LOG_CONNS, "sasl_io_start_packet", "conn=%" NSPRIu64 " fd=%d "
                         "Error: received an LDAP message (tag 0x%lx) that was not encrypted.\n",
 #ifdef USE_OPENLDAP
-                        (long long unsigned int)c->c_connid, c->c_sd, (long unsigned int)tag);
+                        c->c_connid, c->c_sd, (long unsigned int)tag);
 #else
-                        (long long unsigned int)c->c_connid, c->c_sd, (long unsigned int)*ber->ber_ptr);
+                        c->c_connid, c->c_sd, (long unsigned int)*ber->ber_ptr);
 #endif
             }
         }
@@ -409,7 +409,7 @@ done:
         /* If we got here we have garbage, or a denied LDAP operation */
         slapi_log_error( SLAPI_LOG_CONNS, "sasl_io_start_packet", "conn=%" NSPRIu64 " fd=%d "
                 "Error: received an invalid message that was not encrypted.\n",
-                (long long unsigned int)c->c_connid, c->c_sd);
+                c->c_connid, c->c_sd);
 
         if (NULL != ber){
             ber_free(ber, 1);
diff --git a/ldap/servers/slapd/saslbind.c b/ldap/servers/slapd/saslbind.c
index 85b62cb..3ec9cd8 100644
--- a/ldap/servers/slapd/saslbind.c
+++ b/ldap/servers/slapd/saslbind.c
@@ -858,7 +858,7 @@ void ids_sasl_check_bind(Slapi_PBlock *pb)
         slapi_pblock_get( pb, SLAPI_OPERATION, &operation);
         slapi_log_error(SLAPI_LOG_CONNS, "ids_sasl_check_bind",
                         "cleaning up sasl IO conn=%" NSPRIu64 " op=%d complete=%d continuing=%d\n",
-                        (long long unsigned int)pb->pb_conn->c_connid, operation->o_opid,
+                        pb->pb_conn->c_connid, operation->o_opid,
                         (pb->pb_conn->c_flags & CONN_FLAG_SASL_COMPLETE), continuing);
         /* reset flag */
         pb->pb_conn->c_flags &= ~CONN_FLAG_SASL_COMPLETE;
diff --git a/ldap/servers/slapd/search.c b/ldap/servers/slapd/search.c
index 5cdef9c..d591c1b 100644
--- a/ldap/servers/slapd/search.c
+++ b/ldap/servers/slapd/search.c
@@ -410,7 +410,7 @@ static void log_search_access (Slapi_PBlock *pb, const char *base, int scope, co
 {
 	slapi_log_access(LDAP_DEBUG_STATS,
 					 "conn=%" NSPRIu64 " op=%d SRCH base=\"%s\" scope=%d filter=\"%s\", %s\n",
-					 (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid,
+					 pb->pb_conn->c_connid, pb->pb_op->o_opid,
 					 base, scope, fstr, msg ? msg : "");
 
 }
diff --git a/ldap/servers/slapd/snmp_collator.c b/ldap/servers/slapd/snmp_collator.c
index f33202d..80fbfb1 100644
--- a/ldap/servers/slapd/snmp_collator.c
+++ b/ldap/servers/slapd/snmp_collator.c
@@ -794,7 +794,7 @@ static void
 add_counter_to_value(Slapi_Entry *e, const char *type, PRUint64 countervalue)
 {
 	char value[40];
-	PR_snprintf(value,sizeof(value),"%" NSPRIu64, (long long unsigned int)countervalue);
+	PR_snprintf(value,sizeof(value),"%" NSPRIu64, countervalue);
 	slapi_entry_attr_set_charptr( e, type, value);
 }
 
diff --git a/ldap/servers/slapd/unbind.c b/ldap/servers/slapd/unbind.c
index 1b76609..8cedeec 100644
--- a/ldap/servers/slapd/unbind.c
+++ b/ldap/servers/slapd/unbind.c
@@ -82,7 +82,7 @@ do_unbind( Slapi_PBlock *pb )
 	if ( ber_get_null( ber ) == LBER_ERROR ) {
 		slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d UNBIND,"
 				" decoding error: UnBindRequest not null\n",
-				(long long unsigned int)pb->pb_conn->c_connid, operation->o_opid );
+				pb->pb_conn->c_connid, operation->o_opid );
 		/* LDAPv3 does not allow a response to an unbind... so just return. */
 		goto free_and_return;
 	}
@@ -97,7 +97,7 @@ do_unbind( Slapi_PBlock *pb )
 	if ( (err = get_ldapmessage_controls_ext( pb, ber, NULL, ignore_criticality )) != 0 ) {
 		slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d UNBIND,"
 				" error processing controls - error %d (%s)\n",
-				(long long unsigned int)pb->pb_conn->c_connid, operation->o_opid,
+				pb->pb_conn->c_connid, operation->o_opid,
 				err, ldap_err2string( err ));
 		/* LDAPv3 does not allow a response to an unbind... so just return. */
 		goto free_and_return;
@@ -111,7 +111,7 @@ do_unbind( Slapi_PBlock *pb )
 	/* ONREPL - plugins should be called and passed bind dn and, possibly, other data */
 
 	slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d UNBIND\n",
-			(long long unsigned int)pb->pb_conn->c_connid, operation->o_opid );
+			pb->pb_conn->c_connid, operation->o_opid );
 
 	/* pass the unbind to all backends */
 	be_unbindall( pb->pb_conn, operation );
-- 
1.9.3

