Commit 3a634a27 authored by Yang Tse's avatar Yang Tse
Browse files

curlassert macro replaced with DEBUGASSERT macro defined in setup_once.h

parent 06d1b029
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -46,6 +46,6 @@ const char *ares_strerror(int code)
    "Illegal hints flags specified"
  };

  assert(code >= 0 && code < (int)(sizeof(errtext) / sizeof(*errtext)));
  DEBUGASSERT(code >= 0 && code < (int)(sizeof(errtext) / sizeof(*errtext)));
  return errtext[code];
}
+13 −2
Original line number Diff line number Diff line
@@ -200,9 +200,20 @@ typedef int sig_atomic_t;
 */

#ifdef CURLDEBUG
#define DEBUGF(X) X
#define DEBUGF(x) x
#else
#define DEBUGF(X) do { } while (0)
#define DEBUGF(x) do { } while (0)
#endif


/*
 * Macro used to include assertion code only in debug builds.
 */

#if defined(CURLDEBUG) && defined(HAVE_ASSERT_H)
#define DEBUGASSERT(x) assert(x)
#else
#define DEBUGASSERT(x) do { } while (0)
#endif


+1 −1
Original line number Diff line number Diff line
@@ -527,7 +527,7 @@ CURLcode Curl_is_connected(struct connectdata *conn,
  long allow_total = 0;
  long has_passed;

  curlassert(sockindex >= FIRSTSOCKET && sockindex <= SECONDARYSOCKET);
  DEBUGASSERT(sockindex >= FIRSTSOCKET && sockindex <= SECONDARYSOCKET);

  *connected = FALSE; /* a very negative world view is best */

+2 −2
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
 *                            | (__| |_| |  _ <| |___
 *                             \___|\___/|_| \_\_____|
 *
 * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
 * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
 *
 * This software is licensed as described in the file COPYING, which
 * you should have received as part of this distribution. The terms
@@ -512,7 +512,7 @@ int Curl_resolv(struct connectdata *conn,
 */
void Curl_resolv_unlock(struct SessionHandle *data, struct Curl_dns_entry *dns)
{
  curlassert(dns && (dns->inuse>0));
  DEBUGASSERT(dns && (dns->inuse>0));

  if(data->share)
    Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
+2 −2
Original line number Diff line number Diff line
@@ -537,7 +537,7 @@ static bool init_resolve_thread (struct connectdata *conn,
#endif

#ifdef CURLRES_IPV6
  curlassert(hints);
  DEBUGASSERT(hints);
  td->hints = *hints;
#else
  (void) hints;
@@ -591,7 +591,7 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn,
  DWORD  status, ticks;
  CURLcode rc;

  curlassert (conn && td);
  DEBUGASSERT(conn && td);

  /* now, see if there's a connect timeout or a regular timeout to
     use instead of the default one */
Loading