From: wessels <> Date: Sat, 21 Apr 2007 04:06:44 +0000 (+0000) Subject: Removed some uses of RefCount::getRaw() X-Git-Tag: SQUID_3_0_PRE6~65 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=85a4b153406e2f68e40e23d79fec8fbe7cf47af8;p=thirdparty%2Fsquid.git Removed some uses of RefCount::getRaw() 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. --- diff --git a/src/external_acl.cc b/src/external_acl.cc index 00c50246f0..9fd8083599 100644 --- a/src/external_acl.cc +++ b/src/external_acl.cc @@ -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) diff --git a/src/redirect.cc b/src/redirect.cc index 5c2d6f495c..27f58352b7 100644 --- a/src/redirect.cc +++ b/src/redirect.cc @@ -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 diff --git a/src/stat.cc b/src/stat.cc index df5b24c85e..926fff20fc 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -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 diff --git a/src/store_client.cc b/src/store_client.cc index b4efbe6f0a..f38dc0a0aa 100644 --- a/src/store_client.cc +++ b/src/store_client.cc @@ -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++; diff --git a/src/store_swapout.cc b/src/store_swapout.cc index 3e1b43abd4..8644477a84 100644 --- a/src/store_swapout.cc +++ b/src/store_swapout.cc @@ -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)