... which are invalid in C++ and always equate (this!=NULL) to true.
Clang 3.5 refuses to build code containing these invalid comparisons.
mutable SplayNode<V> *right;
void destroy(SPLAYFREE *);
void walk(SPLAYWALKEE *, void *callerState);
- bool empty() const { return this == NULL; }
+ bool empty() const {return false;}
SplayNode<V> const * start() const;
SplayNode<V> const * finish() const;
void
SplayNode<V>::walk(SPLAYWALKEE * walkee, void *state)
{
- if (this == NULL)
- return;
-
if (left)
left->walk(walkee, state);
SplayNode<V> const *
SplayNode<V>::start() const
{
- if (this && left)
+ if (left)
return left->start();
return this;
SplayNode<V> const *
SplayNode<V>::finish() const
{
- if (this && right)
+ if (right)
return right->finish();
return this;
void
SplayNode<V>::destroy(SPLAYFREE * free_func)
{
- if (!this)
- return;
-
if (left)
left->destroy(free_func);
SplayNode<V> *
SplayNode<V>::remove(Value const dataToRemove, SPLAYCMP * compare)
{
- if (this == NULL)
- return NULL;
-
SplayNode<V> *result = splay(dataToRemove, compare);
if (splayLastResult == 0) { /* found it */
/* create node to insert */
SplayNode<V> *newNode = new SplayNode<V>(dataToInsert);
- if (this == NULL) {
- splayLastResult = -1;
- newNode->left = newNode->right = NULL;
- return newNode;
- }
-
SplayNode<V> *newTop = splay(dataToInsert, compare);
if (splayLastResult < 0) {
SplayNode<V> *
SplayNode<V>::splay(FindValue const &dataToFind, int( * compare)(FindValue const &a, Value const &b)) const
{
- if (this == NULL) {
- /* can't have compared successfully :} */
- splayLastResult = -1;
- return NULL;
- }
-
Value temp = Value();
SplayNode<V> N(temp);
SplayNode<V> *l;
MemChunk *chunk, *freechunk, *listTail;
time_t age;
- if (!this)
- return;
if (!Chunks)
return;
const char *item;
const char *pos = NULL;
int ilen;
- assert(this && range_spec);
+ assert(range_spec);
++ParsedCount;
debugs(64, 8, "parsing range field: '" << range_spec << "'");
/* check range type */
HttpHdrRange::packInto(Packer * packer) const
{
const_iterator pos = begin();
- assert(this);
while (pos != end()) {
if (pos != begin())
int
HttpHdrRange::canonize(HttpReply *rep)
{
- assert(this && rep);
+ assert(rep);
if (rep->content_range)
clen = rep->content_range->elength;
HttpHdrRange::isComplex() const
{
int64_t offset = 0;
- assert(this);
/* check that all rangers are in "strong" order */
const_iterator pos (begin());
bool
HttpHdrRange::willBeComplex() const
{
- assert(this);
/* check that all rangers are in "strong" order, */
/* as far as we can tell without the content length */
int64_t offset = 0;
HttpHdrRange::firstOffset() const
{
int64_t offset = HttpHdrRangeSpec::UnknownPosition;
- assert(this);
const_iterator pos = begin();
while (pos != end()) {
{
int64_t offset = HttpHdrRangeSpec::UnknownPosition;
const_iterator pos = begin();
- assert(this);
while (pos != end()) {
int64_t current = (*pos)->offset;
bool
HttpHdrRange::offsetLimitExceeded(const int64_t limit) const
{
- if (NULL == this)
- /* not a range request */
- return false;
-
if (limit == 0)
/* 0 == disabled */
return true;
String::allocAndFill(const char *str, int len)
{
PROF_start(StringAllocAndFill);
- assert(this && str);
+ assert(str);
allocBuffer(len + 1);
len_ = len;
memcpy(buf_, str, len);
String::clean()
{
PROF_start(StringClean);
- assert(this);
/* TODO if mempools has already closed this will FAIL!! */
if (defined())
void
String::append( char const *str, int len)
{
- assert(this);
assert(str && len >= 0);
PROF_start(StringAppend);
char const *
Auth::UserRequest::denyMessage(char const * const default_message)
{
- if (this == NULL || getDenyMessage() == NULL) {
+ if (getDenyMessage() == NULL)
return default_message;
- }
return getDenyMessage();
}
void
Auth::Negotiate::UserRequest::authenticate(HttpRequest * aRequest, ConnStateData * conn, http_hdr_type type)
{
- assert(this);
-
/* Check that we are in the client side, where we can generate
* auth challenges */
void
Auth::Ntlm::UserRequest::authenticate(HttpRequest * aRequest, ConnStateData * conn, http_hdr_type type)
{
- assert(this);
-
/* Check that we are in the client side, where we can generate
* auth challenges */
bool
ConnStateData::areAllContextsForThisConnection() const
{
- assert(this != NULL);
ClientSocketContext::Pointer context = getCurrentContext();
while (context.getRaw()) {
ConnStateData::~ConnStateData()
{
- assert(this != NULL);
debugs(33, 3, HERE << clientConnection);
if (isOpen())
ClientSocketContext::Pointer
ConnStateData::getCurrentContext() const
{
- assert(this);
return currentobject;
}
String
ClientHttpRequest::rangeBoundaryStr() const
{
- assert(this);
const char *key;
String b(APP_FULLNAME);
b.append(":",1);
struct stat sb;
int fd = -1;
- assert(this != NULL);
debugs(47, 3, HERE << "DIR #" << sd->index);
assert(fd == -1);
const char *
StoreEntry::url() const
{
- if (this == NULL)
- return "[null_entry]";
- else if (mem_obj == NULL)
+ if (mem_obj == NULL)
return "[null_mem_obj]";
else
return mem_obj->storeId();