X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=list.c;h=a2d7ff6bc5758d30a4c4b9f02096fff10af73817;hp=dadba717a8feecd68a0e7def9e5c9fd09fa9ce3d;hb=7f54fd0d1028f93f6ad9afe5e2d0a75b2263d06a;hpb=5ca53f92bc634c20fed90f338ac41561f87b834c diff --git a/list.c b/list.c index dadba717..a2d7ff6b 100644 --- a/list.c +++ b/list.c @@ -5,7 +5,7 @@ * Purpose : Declares functions to handle lists. * * Copyright : Written by and Copyright (C) 2001-2007 members of the - * Privoxy team. http://www.privoxy.org/ + * Privoxy team. https://www.privoxy.org/ * * Based on the Internet Junkbuster originally written * by and Copyright (C) 1997 Anonymous Coders and @@ -45,7 +45,7 @@ #endif #include -#if !defined(_WIN32) && !defined(__OS2__) +#if !defined(_WIN32) #include #endif @@ -55,8 +55,9 @@ #include "list.h" #include "miscutil.h" +#ifndef NDEBUG static int list_is_valid (const struct list *the_list); - +#endif /********************************************************************* * @@ -123,6 +124,7 @@ void destroy_list (struct list *the_list) } +#ifndef NDEBUG /********************************************************************* * * Function : list_is_valid @@ -130,7 +132,7 @@ void destroy_list (struct list *the_list) * Description : Check that a string list is valid. The intended * usage is "assert(list_is_valid(the_list))". * Currently this checks that "the_list->last" - * is correct, and that the list dosn't contain + * is correct, and that the list doesn't contain * circular references. It is likely to crash if * it's passed complete garbage. * @@ -142,11 +144,6 @@ void destroy_list (struct list *the_list) *********************************************************************/ static int list_is_valid (const struct list *the_list) { - /* - * If you don't want this check, just change the line below - * from "#if 1" to "#if 0". - */ -#if 1 const struct list_entry *cur_entry; const struct list_entry *last_entry = NULL; int entry = 0; @@ -199,10 +196,10 @@ static int list_is_valid (const struct list *the_list) } return (the_list->last == last_entry); -#else - return 1; -#endif + } +#endif /* ndef NDEBUG */ + /********************************************************************* * @@ -1120,7 +1117,7 @@ jb_err unmap(struct map *the_map, const char *name) * 2 : name = name parameter to look for * * Returns : the value if found, else the empty string. - * Return value is alloced as part of the map, so + * Return value is allocated as part of the map, so * it is freed when the map is destroyed. Caller * must not free or modify it. *