]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Removed some uses of RefCount::getRaw()
authorwessels <>
Sat, 21 Apr 2007 04:06:44 +0000 (04:06 +0000)
committerwessels <>
Sat, 21 Apr 2007 04:06:44 +0000 (04:06 +0000)
We can compare RefCount pointers to NULL without using getRaw() as long
as the RefCount pointer is on the left, and NULL is on the right.

src/external_acl.cc
src/redirect.cc
src/stat.cc
src/store_client.cc
src/store_swapout.cc

index 00c50246f0cadae5da0cbfa1c9a64b71c0c2e98c..9fd8083599feccf6b5ad7160e66167a59596b30e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: external_acl.cc,v 1.75 2007/04/06 12:15:51 serassio Exp $
+ * $Id: external_acl.cc,v 1.76 2007/04/20 22:11:34 wessels Exp $
  *
  * DEBUG: section 82    External ACL
  * AUTHOR: Henrik Nordstrom, MARA Systems AB
@@ -840,7 +840,7 @@ makeExternalAclKey(ACLChecklist * ch, external_acl_data * acl_data)
 
         case _external_acl_format::EXT_ACL_USER_CERT_RAW:
 
-            if (ch->conn().getRaw()) {
+            if (ch->conn() != NULL) {
                 SSL *ssl = fd_table[ch->conn()->fd].ssl;
 
                 if (ssl)
@@ -851,7 +851,7 @@ makeExternalAclKey(ACLChecklist * ch, external_acl_data * acl_data)
 
         case _external_acl_format::EXT_ACL_USER_CERTCHAIN_RAW:
 
-            if (ch->conn().getRaw()) {
+            if (ch->conn() != NULL) {
                 SSL *ssl = fd_table[ch->conn()->fd].ssl;
 
                 if (ssl)
@@ -862,7 +862,7 @@ makeExternalAclKey(ACLChecklist * ch, external_acl_data * acl_data)
 
         case _external_acl_format::EXT_ACL_USER_CERT:
 
-            if (ch->conn().getRaw()) {
+            if (ch->conn() != NULL) {
                 SSL *ssl = fd_table[ch->conn()->fd].ssl;
 
                 if (ssl)
@@ -873,7 +873,7 @@ makeExternalAclKey(ACLChecklist * ch, external_acl_data * acl_data)
 
         case _external_acl_format::EXT_ACL_CA_CERT:
 
-            if (ch->conn().getRaw()) {
+            if (ch->conn() != NULL) {
                 SSL *ssl = fd_table[ch->conn()->fd].ssl;
 
                 if (ssl)
index 5c2d6f495c22b08ab7a6aab9189eacf8e713ce83..27f58352b7cea6c3d7740a550dabd8d30bf85679 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: redirect.cc,v 1.115 2006/08/21 00:50:41 robertc Exp $
+ * $Id: redirect.cc,v 1.116 2007/04/20 22:11:34 wessels Exp $
  *
  * DEBUG: section 61    Redirector
  * AUTHOR: Duane Wessels
@@ -131,7 +131,7 @@ redirectStart(ClientHttpRequest * http, RH * handler, void *data)
 
     r = cbdataAlloc(redirectStateData);
     r->orig_url = xstrdup(http->uri);
-    r->client_addr = conn.getRaw() != NULL ? conn->log_addr : no_addr;
+    r->client_addr = conn != NULL ? conn->log_addr : no_addr;
     r->client_ident = NULL;
 
     if (http->request->auth_user_request)
@@ -140,12 +140,12 @@ redirectStart(ClientHttpRequest * http, RH * handler, void *data)
         r->client_ident = http->request->extacl_user.buf();
     }
 
-    if (!r->client_ident && (conn.getRaw() != NULL && conn->rfc931[0]))
+    if (!r->client_ident && (conn != NULL && conn->rfc931[0]))
         r->client_ident = conn->rfc931;
 
 #if USE_SSL
 
-    if (!r->client_ident && conn.getRaw() != NULL)
+    if (!r->client_ident && conn != NULL)
         r->client_ident = sslGetUserEmail(fd_table[conn->fd].ssl);
 
 #endif
index df5b24c85e76a307ec9635e96b0f9858aa2f47a4..926fff20fc03a72005cc4547ff0fc4501f234445 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: stat.cc,v 1.402 2007/04/13 22:46:03 wessels Exp $
+ * $Id: stat.cc,v 1.403 2007/04/20 22:11:34 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -1656,7 +1656,7 @@ statClientRequests(StoreEntry * s)
         ConnStateData::Pointer conn = http->getConn();
         storeAppendPrintf(s, "Connection: %p\n", conn.getRaw());
 
-        if (conn.getRaw() != NULL) {
+        if (conn != NULL) {
             fd = conn->fd;
             storeAppendPrintf(s, "\tFD %d, read %d, wrote %d\n", fd,
                               fd_table[fd].bytes_read, fd_table[fd].bytes_written);
@@ -1697,12 +1697,12 @@ statClientRequests(StoreEntry * s)
             p = http->request->extacl_user.buf();
         }
 
-        if (!p && (conn.getRaw() != NULL && conn->rfc931[0]))
+        if (!p && (conn != NULL && conn->rfc931[0]))
             p = conn->rfc931;
 
 #if USE_SSL
 
-        if (!p && conn.getRaw() != NULL)
+        if (!p && conn != NULL)
             p = sslGetUserEmail(fd_table[conn->fd].ssl);
 
 #endif
index b4efbe6f0a97f0abb43a379bf85843bd698fa7aa..f38dc0a0aab85dc71ccd856d3a9f64490a2deb09 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_client.cc,v 1.151 2007/04/20 06:54:48 wessels Exp $
+ * $Id: store_client.cc,v 1.152 2007/04/20 22:06:44 wessels Exp $
  *
  * DEBUG: section 90    Storage Manager Client-Side Interface
  * AUTHOR: Duane Wessels
@@ -369,7 +369,7 @@ store_client::doCopy(StoreEntry *anEntry)
      * if needed.
      */
 
-    if (STORE_DISK_CLIENT == getType() && NULL == swapin_sio.getRaw())
+    if (STORE_DISK_CLIENT == getType() && swapin_sio == NULL)
         startSwapin();
     else
         scheduleRead();
@@ -390,7 +390,7 @@ store_client::startSwapin()
         /* Don't set store_io_pending here */
         storeSwapInStart(this);
 
-        if (NULL == swapin_sio.getRaw()) {
+        if (swapin_sio == NULL) {
             fail();
             flags.store_copying = 0;
             return;
@@ -668,7 +668,7 @@ storeUnregister(store_client * sc, StoreEntry * e, void *data)
     if (e->store_status == STORE_OK && e->swap_status != SWAPOUT_DONE)
         e->swapOut();
 
-    if (sc->swapin_sio.getRaw()) {
+    if (sc->swapin_sio != NULL) {
         storeClose(sc->swapin_sio);
         sc->swapin_sio = NULL;
         statCounter.swap.ins++;
index 3e1b43abd4dfd8ab6545cb7db3c0af1f794601d8..8644477a84604e5fd71dc1deddfb578c233ff163 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_swapout.cc,v 1.111 2007/04/19 16:14:53 wessels Exp $
+ * $Id: store_swapout.cc,v 1.112 2007/04/20 22:06:44 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager Swapout Functions
  * AUTHOR: Duane Wessels
@@ -66,7 +66,7 @@ storeSwapOutStart(StoreEntry * e)
     generic_cbdata *c = new generic_cbdata(e);
     sio = storeCreate(e, storeSwapOutFileNotify, storeSwapOutFileClosed, c);
 
-    if (NULL == sio.getRaw()) {
+    if (sio == NULL) {
         e->swap_status = SWAPOUT_NONE;
         delete c;
         storeLog(STORE_LOG_SWAPOUTFAIL, e);
@@ -198,7 +198,7 @@ StoreEntry::swapOut()
     debug(20, 7) ("storeSwapOut: swapout.queue_offset = %d\n",
                   (int) mem_obj->swapout.queue_offset);
 
-    if (mem_obj->swapout.sio.getRaw())
+    if (mem_obj->swapout.sio != NULL)
         debug(20, 7) ("storeSwapOut: storeOffset() = %d\n",
                       (int) mem_obj->swapout.sio->offset());
 
@@ -288,7 +288,7 @@ StoreEntry::swapOut()
 
     doPages(this);
 
-    if (NULL == mem_obj->swapout.sio.getRaw())
+    if (mem_obj->swapout.sio == NULL)
         /* oops, we're not swapping out any more */
         return;
 
@@ -377,7 +377,7 @@ StoreEntry::swapOutAble() const
 {
     dlink_node *node;
 
-    if (mem_obj->swapout.sio.getRaw() != NULL)
+    if (mem_obj->swapout.sio != NULL)
         return true;
 
     if (mem_obj->inmem_lo > 0)