diff --git a/lib/7.2/modules/LR.pmod/Grammar_parser.pmod b/lib/7.2/modules/LR.pmod/Grammar_parser.pmod
index a3a9572f0fa222cec7a874905366f86c029452f9..d960c24c743db392291472ca48591be612bb34e3 100755
--- a/lib/7.2/modules/LR.pmod/Grammar_parser.pmod
+++ b/lib/7.2/modules/LR.pmod/Grammar_parser.pmod
@@ -193,11 +193,6 @@ protected private int add_nonterminal(string id)
 protected private void add_tokens(array(string) tokens)
 {
   /* NOOP */
-#if 0
-  if (sizeof(tokens)) {
-    map(tokens, add_token);
-  }
-#endif /* 0 */
 }
 
 protected private void set_left_tokens(string ignore, int pri_val, array(string) tokens)
diff --git a/lib/7.2/modules/LR.pmod/lr.pike b/lib/7.2/modules/LR.pmod/lr.pike
index 9fe5d0a843476f14e73b6e92aa5304a87970d028..e029e2e2b40a77fc2bea18d33b0b7ebf22fe2d15 100755
--- a/lib/7.2/modules/LR.pmod/lr.pike
+++ b/lib/7.2/modules/LR.pmod/lr.pike
@@ -47,21 +47,10 @@ int make_value(string s)
  */
 
 array(string) nonterminals = ({
-#if 0
-  "S", "A", "B",
-#else
   "E'", "E", "T", "F", "id", "value",
-#endif
 });
 
 array(array(string|int)) g_init = ({
-#if 0
-  ({ 0, 1, "" }),
-  ({ 1, 2, 1 }),
-  ({ 1 }),
-  ({ 2, "a", 2 }),
-  ({ 2, "b" }),
-#else
   ({ 0, 1, "" }),
   ({ 1, 1, "+", 2 }),
   ({ 1, 2 }),
@@ -81,7 +70,6 @@ array(array(string|int)) g_init = ({
   ({ 5, "7" }),
   ({ 5, "8" }),
   ({ 5, "9" }),
-#endif 
 });
 
 array(int|function(mixed ...:mixed)) action_init = ({
@@ -142,15 +130,9 @@ void create()
 
   g->set_symbol_to_string(symbol_to_string);
   
-#if 0
-  foreach (g_init, array(string|int) i) {
-    g->add_rule(rule(i[0], i[1..], a_init));
-  }
-#else
   foreach (indices(g_init), int i) {
     g->add_rule(rule(g_init[i][0], g_init[i][1..], action_init[i]));
   }
-#endif
 }
 
 class scan {
@@ -159,14 +141,7 @@ class scan {
    */
 
   array(string) s_init = ({
-#if 0
-    "a", "a", "a", "b",
-    "a", "a", "a", "b",
-    "b",
-    "a", "a", "b", "a",
-#else
     "1", "*", "(", "3", "+", "2", ")", "+", "2", "*", "3",
-#endif
     "",
   });
 
diff --git a/lib/7.2/modules/LR.pmod/parser.pike b/lib/7.2/modules/LR.pmod/parser.pike
index 54e302137a8c129a859ded0538fa92f4eace569c..76a84d020fad3d91004d8977dbbc84bf1e96edec 100644
--- a/lib/7.2/modules/LR.pmod/parser.pike
+++ b/lib/7.2/modules/LR.pmod/parser.pike
@@ -272,13 +272,6 @@ protected private mapping(string : object(priority)) operator_priority = ([]);
 
 protected private multiset(mixed) nullable = (< >);
 
-#if 0
-protected private mapping(mixed : multiset(object(rule))) derives = ([]);
-
-/* Maps from symbol to which rules may start with that symbol */
-protected private mapping(mixed : multiset(object(rule))) begins = ([]);
-#endif /* 0 */
-
 
 /* Maps from symbol to which rules use that symbol
  * (used for finding nullable symbols)
@@ -547,64 +540,6 @@ void add_rule(object(rule) r)
   /* The info calculated from this point is not at the moment used
    * by the compiler
    */
-#if 0
-  /* Now check for symbols that may begin this rule */
-  foreach (r->symbols, symbol) {
-    if (!stringp(symbol)) {
-      multiset set = begins[symbol];
-
-      r->prefix_nonterminals |= (< symbol >);
-
-      if (set) {
-	set[r] = 1;
-      } else {
-	begins[symbol] = (< r >);
-      }
-
-      if (grammar[symbol]) {
-	foreach (grammar[symbol], object(rule) r2) {
-	  r->prefix_nonterminals |= r2->prefix_nonterminals;
-	  r->prefix_tokens |= r2->prefix_tokens;
-	
-	  foreach (indices(r2->prefix_nonterminals), mixed s2) {
-	    set = begins[s2];
-
-	    if (set) {
-	      set[r] = 1;
-	    } else {
-	      begins[s2] = (< r >);
-	    }
-	  }
-	}
-      }
-      if (!nullable[symbol]) {
-	break;
-      }
-    } else {
-      r->prefix_tokens[symbol] = 1;
-      break;
-    }
-  }
-
-  /* Scan through the rules beginning with this rule's non-terminal */
-  if (begins[r->nonterminal]) {
-    foreach (indices(begins[r->nonterminal]), object(rule) r2) {
-      r2->prefix_nonterminals |= r->prefix_nonterminals;
-      r2->prefix_tokens |= r->prefix_tokens;
-
-      /* NOTE: Might want to move values(r->prefixes) out of the loop */
-      foreach (values(r->prefix_nonterminals), symbol) {
-	multiset set = begins[symbol];
-
-	if (set) {
-	  set[r2] = 1;
-	} else {
-	  begins[symbol] = (< r2 >);
-	}
-      }
-    }
-  }
-#endif /* 0 */
 }
 
 /* Here come the functions used by the compiler */
@@ -1502,13 +1437,9 @@ mixed parse(object|function(void:string|array(string|mixed)) scanner,
 	} else {
 	  // Default action.
 	  if (sizeof(a->symbols)) {
-#if 0
-	    value_stack->push(value_stack->pop(sizeof(a->symbols))[0]);
-#else /* !0 */
 	    if (sizeof(a->symbols) > 1) {
 	      value_stack->quick_pop(sizeof(a->symbols) - 1);
 	    }
-#endif /* 0 */
 	    state = state_stack->pop(sizeof(a->symbols))[0];
 	  } else {
 	    value_stack->push(0);
@@ -1517,13 +1448,9 @@ mixed parse(object|function(void:string|array(string|mixed)) scanner,
       } else {
 	// Default action.
 	if (sizeof(a->symbols)) {
-#if 0
-	  value_stack->push(value_stack->pop(sizeof(a->symbols))[0]);
-#else /* !0 */
 	  if (sizeof(a->symbols) > 1) {
 	    value_stack->quick_pop(sizeof(a->symbols) - 1);
 	  }
-#endif /* 0 */
 	  state = state_stack->pop(sizeof(a->symbols))[0];
 	} else {
 	  value_stack->push(0);
diff --git a/lib/7.2/modules/String.pmod b/lib/7.2/modules/String.pmod
index 8931bff89b1eb6dedb2f99b603bada66f894c418..0cabffcc42e67a6ff4a419fa1b1d27571a48692a 100644
--- a/lib/7.2/modules/String.pmod
+++ b/lib/7.2/modules/String.pmod
@@ -79,14 +79,9 @@ string sillycaps(string str)
 //!
 string strmult(string str, int num)
 {
-#if 1
   num*=strlen(str);
   while(strlen(str) < num) str+=str;
   return str[0..num-1];
-#endif
-#if 0
-  return sprintf("%~n",str,strlen(str)*num);
-#endif
 }
 
 /*
diff --git a/lib/7.4/modules/SSL.pmod/cipher.pike b/lib/7.4/modules/SSL.pmod/cipher.pike
index 60936d66607a6e0d4db0db35066078280d0fd6b1..14b99c370ca92346de64082c3e3ac0e844f17033 100644
--- a/lib/7.4/modules/SSL.pmod/cipher.pike
+++ b/lib/7.4/modules/SSL.pmod/cipher.pike
@@ -23,15 +23,6 @@ class CipherSpec {
   function verify;
 }
 
-#if 0
-class mac_none
-{
-  /* Dummy MAC algorithm */
-//  string hash_raw(string data) { return ""; }
-  string hash(string data, object seq_num) { return ""; }
-}
-#endif
-
 class mac_sha
 {
   constant pad_1 =  "6666666666666666666666666666666666666666";
@@ -271,11 +262,7 @@ class dh_parameters
 	orm96();
 	break;
       case 3:
-#if 0
-	[p, g, order] = args;
-#else
 	p = args[0]; g = args[1]; order = args[2];
-#endif
 	break;
       default:
 	error( "SSL.cipher.dh_parameters->create: "
diff --git a/lib/7.4/modules/SSL.pmod/constants.pike b/lib/7.4/modules/SSL.pmod/constants.pike
index 5e3bb0390178e78f7bcda9c489cd20a00768fb7f..22caf61e2ec96deb42aeb5e0405889e47440419c 100644
--- a/lib/7.4/modules/SSL.pmod/constants.pike
+++ b/lib/7.4/modules/SSL.pmod/constants.pike
@@ -130,15 +130,6 @@ constant SSL_fortezza_dms_with_fortezza_cbc_sha	= 0x001d;
 constant SSL_fortezza_dms_with_rc4_128_sha	= 0x001e;
 #endif /* !WEAK_CRYPTO_40BIT (magic comment) */
 
-#if 0
-/* Methods for signing any server_key_exchange message */
-constant SIGN_anon = 0;
-constant SIGN_rsa = 1;
-constant SIGN_dsa = 2;
-
-/* FIXME: Add SIGN-type element to table */
-#endif
-
 constant CIPHER_SUITES =
 ([ SSL_null_with_null_null :    	({ 0, 0, 0 }),
    SSL_rsa_with_null_md5 :      	({ KE_rsa, 0, HASH_md5 }), 
diff --git a/lib/7.4/modules/SSL.pmod/sslfile.pike b/lib/7.4/modules/SSL.pmod/sslfile.pike
index 2fa59d39a3f46f019975820538cbc7f4935453fd..66117074c8e8fa53496c954200bcc051ea87c064 100644
--- a/lib/7.4/modules/SSL.pmod/sslfile.pike
+++ b/lib/7.4/modules/SSL.pmod/sslfile.pike
@@ -165,15 +165,6 @@ void close()
   if (is_closed || !socket) return;
   is_closed = 1;
 
-#if 0
-  if (sizeof (write_buffer) && !blocking)
-    ssl_write_callback(socket->query_id());
-
-  if(sizeof(write_buffer) && blocking) {
-    write_blocking();
-  }
-#endif
-
   send_close();
   queue_write();
   read_callback = 0;
@@ -500,16 +491,6 @@ private void ssl_write_callback(mixed id)
 #endif
     THREAD_UNLOCK;
     write_callback(id);
-#if 0
-    if (!socket || !this_object()) {
-      // We've been closed or destructed.
-      return;
-    }
-    res = queue_write();
-
-    if (strlen(write_buffer))
-      return;
-#endif
   }
 }
 
@@ -564,10 +545,6 @@ void set_read_callback(function(mixed,string:void) r)
 #endif
   THREAD_CHECK;
   read_callback = r;
-#if 0
-  if (strlen(read_buffer)&& socket)
-    ssl_read_callback(socket->query_id(), "");
-#endif
   if (socket) update_callbacks();
 }
 
@@ -631,10 +608,6 @@ void set_nonblocking(function ...args)
     THREAD_UNLOCK;
     socket->set_nonblocking();
   }
-#if 0
-  if (strlen(read_buffer))
-    ssl_read_callback(socket->query_id(), "");
-#endif
 }
 
 void set_blocking()
diff --git a/lib/7.4/modules/Tools.pmod/Standalone.pmod/extract_autodoc.pike b/lib/7.4/modules/Tools.pmod/Standalone.pmod/extract_autodoc.pike
index 6b1cd168f01ea5d4d46d4fb4893c4a7ef74a138d..e5155f3c691ca1ceb5c8d70181a3c08f5617dbac 100644
--- a/lib/7.4/modules/Tools.pmod/Standalone.pmod/extract_autodoc.pike
+++ b/lib/7.4/modules/Tools.pmod/Standalone.pmod/extract_autodoc.pike
@@ -124,11 +124,6 @@ string extract(string filename, string imgdest, int(0..1) rootless,
     else {
       string type = ([ "pike":"class", "pmod":"module", ])[suffix];
       string name = (name_sans_suffix/"/")[-1];
-#if 0
-      werror("root: %{%O, %}\n"
-	     "type: %O\n"
-	     "name: %O\n", root, type, name);
-#endif /* 0 */
       if(name == "master.pike")
 	name = "/master";
       if(name == "module" && (filename/"/")[-1] != "module.pike") {
diff --git a/lib/7.6/modules/Calendar.pmod/YMD.pike b/lib/7.6/modules/Calendar.pmod/YMD.pike
index d21685782f558689bd932b7c769d11390a22ca6e..1bbc943a2315f75d63871c97071df7eedabca4fc 100644
--- a/lib/7.6/modules/Calendar.pmod/YMD.pike
+++ b/lib/7.6/modules/Calendar.pmod/YMD.pike
@@ -1259,12 +1259,7 @@ class cYear
 
    protected void convert_from(TimeRange other)
    {
-#if 0
-      if (other->y)
-	 create(other->y);
-      else
-#endif
-         ::convert_from(other);
+     ::convert_from(other);
       if (other->number_of_years)
 	 n=other->number_of_years();
       else
diff --git a/lib/7.6/modules/Standards.pmod/UUID.pmod/module.pmod b/lib/7.6/modules/Standards.pmod/UUID.pmod/module.pmod
index 21c3e839b95700432506d1a52b68768bfaeb7d6d..ad1e29f66d133aad5048294b8dac8fc9168fbf06 100644
--- a/lib/7.6/modules/Standards.pmod/UUID.pmod/module.pmod
+++ b/lib/7.6/modules/Standards.pmod/UUID.pmod/module.pmod
@@ -50,19 +50,10 @@ Standards.UUID.UUID make_version3(string name, string namespace) {
   //  /marcus 2007-08-05
 
   // step 2
-#if 0
-  namespace = reverse(namespace[0..3]) + reverse(namespace[4..5]) +
-    reverse(namespace[6..7]) + namespace[8..];
-#endif
 
   // step 3
   string ret = Crypto.MD5.hash(namespace+name);
 
-#if 0
-  ret = reverse(ret[0..3]) + reverse(ret[4..5]) +
-    reverse(ret[6..7]) + ret[8..];
-#endif
-
   ret &=
     "\xff\xff\xff\xff"		// time_low
     "\xff\xff"			// time_mid
diff --git a/lib/7.8/modules/SSL.pmod/Cipher.pmod b/lib/7.8/modules/SSL.pmod/Cipher.pmod
index d9364925a3859c8e667b98ac91e74c66be9bf78b..9bc26a6b081c9a099f6375a78c1c088246ae32ab 100644
--- a/lib/7.8/modules/SSL.pmod/Cipher.pmod
+++ b/lib/7.8/modules/SSL.pmod/Cipher.pmod
@@ -74,14 +74,6 @@ class CipherSpec {
   function(object,string,ADT.struct,Gmp.mpz:int(0..1)) verify;
 }
 
-#if 0
-class mac_none
-{
-  /* Dummy MAC algorithm */
-  string hash(string data, Gmp.mpz seq_num) { return ""; }
-}
-#endif
-
 //! MAC using SHA.
 //!
 //! @note
diff --git a/lib/7.8/modules/SSL.pmod/Constants.pmod b/lib/7.8/modules/SSL.pmod/Constants.pmod
index b46980b2a18ad5320acd609bf750d94e4b807490..72237ae5114237117b1dddd8e65ae61fb5b33ba4 100644
--- a/lib/7.8/modules/SSL.pmod/Constants.pmod
+++ b/lib/7.8/modules/SSL.pmod/Constants.pmod
@@ -380,16 +380,6 @@ constant TLS_ecdhe_psk_with_null_sha            = 0xc039;
 constant TLS_ecdhe_psk_with_null_sha256         = 0xc03a;
 constant TLS_ecdhe_psk_with_null_sha384         = 0xc03b;
 
-#if 0
-/* Methods for signing any server_key_exchange message (RFC 5246 7.4.1.4.1) */
-constant SIGN_anon = 0;
-constant SIGN_rsa = 1;
-constant SIGN_dsa = 2;
-constant SIGN_ecdsa = 3;
-
-/* FIXME: Add SIGN-type element to table */
-#endif
-
 constant CIPHER_SUITES =
 ([ SSL_null_with_null_null :    	({ 0, 0, 0 }),
    SSL_rsa_with_null_md5 :      	({ KE_rsa, 0, HASH_md5 }), 
diff --git a/lib/7.8/modules/SSL.pmod/connection.pike b/lib/7.8/modules/SSL.pmod/connection.pike
index e36b85a88f3f293d19003ed5b7a403afc33901d5..32f5767f8a0becfbde920ccefcd805101416c5a9 100644
--- a/lib/7.8/modules/SSL.pmod/connection.pike
+++ b/lib/7.8/modules/SSL.pmod/connection.pike
@@ -60,13 +60,6 @@ void create(int is_server, void|SSL.context ctx,
   handshake::create(is_server, ctx, min_version, max_version);
 }
 
-#if 0
-protected void destroy()
-{
-  werror("Connection destructed:\n%s\n", describe_backtrace(backtrace()));
-}
-#endif /* 0 */
-
 //! Called with alert object, sequence number of bad packet,
 //! and raw data as arguments, if a bad packet is received.
 //!
diff --git a/lib/7.8/modules/SSL.pmod/handshake.pike b/lib/7.8/modules/SSL.pmod/handshake.pike
index 2b299e8409e23fe817f1048da3c457de47c78524..9c92d3f03d59d33e7789229faaaa9ce3ad0fc1e0 100644
--- a/lib/7.8/modules/SSL.pmod/handshake.pike
+++ b/lib/7.8/modules/SSL.pmod/handshake.pike
@@ -532,11 +532,6 @@ string server_derive_master_secret(string data)
   {
   default:
     error( "Internal error\n" );
-#if 0
-    /* What is this for? */
-  case 0:
-    return 0;
-#endif
   case KE_dhe_dss:
   case KE_dhe_rsa:
     if (!sizeof(data))
diff --git a/lib/7.8/modules/SSL.pmod/sslfile.pike b/lib/7.8/modules/SSL.pmod/sslfile.pike
index b86137ba005aa21a0bdd21542ba52c55d570a185..54451f0e5fd1831fe5806cf23cccd905f636d4c0 100644
--- a/lib/7.8/modules/SSL.pmod/sslfile.pike
+++ b/lib/7.8/modules/SSL.pmod/sslfile.pike
@@ -223,10 +223,6 @@ protected constant epipe_errnos = (<
 
 protected void thread_error (string msg, THREAD_T other_thread)
 {
-#if 0 && constant (_locate_references)
-  werror ("%s\n%O got %d refs", msg, this, _refs (this));
-  _locate_references (this);
-#endif
   error ("%s"
 	 "%s\n"
 	 "User callbacks: a=%O r=%O w=%O c=%O\n"
@@ -502,15 +498,6 @@ protected void create (Stdio.File stream, SSL.context ctx,
     read_buffer = String.Buffer();
     real_backend = stream->query_backend();
     close_state = STREAM_OPEN;
-#if 0
-    // Unnecessary to init stuff to zero.
-    callback_id = 0;
-    local_backend = 0;
-    close_packet_send_state = CLOSE_PACKET_NOT_SCHEDULED;
-    local_errno = cb_errno = 0;
-    got_extra_read_call_out = 0;
-    alert_cb_called = 0;
-#endif
 
     stream->set_read_callback (0);
     stream->set_write_callback (0);
@@ -745,13 +732,6 @@ Stdio.File shutdown()
 
     write_buffer = ({});
 
-#if 0
-    accept_callback = 0;
-    read_callback = 0;
-    write_callback = 0;
-    close_callback = 0;
-#endif
-
     if (got_extra_read_call_out > 0)
       real_backend->remove_call_out (ssl_read_callback);
     got_extra_read_call_out = 0;
@@ -1092,13 +1072,6 @@ void set_callbacks (void|function(mixed, string:int) read,
     if (!zero_type(close))
       close_callback = close;
 
-#if 0
-    if (!zero_type(read_oob))
-      read_oob_callback = read_oob;
-    if (!zero_type (write_oob_cb))
-      write_oob_callback = write_oob;
-#endif
-
     if (!zero_type(accept))
       accept_callback = accept;
 
@@ -2031,14 +2004,7 @@ protected int ssl_write_callback (int called_from_real_backend)
 #endif
 	  written = stream->write (output);
 
-	if (written < 0
-#if 0
-#ifdef __NT__
-	    // You don't want to know.. (Bug observed in Pike 0.6.132.)
-	    && stream->errno() != 1
-#endif
-#endif
-	   ) {
+	if (written < 0) {
 #ifdef SIMULATE_CLOSE_PACKET_WRITE_FAILURE
 	  if (close_packet_send_state == CLOSE_PACKET_QUEUED_OR_DONE)
 	    cb_errno = System.EPIPE;
diff --git a/lib/7.8/modules/SSL.pmod/sslport.pike b/lib/7.8/modules/SSL.pmod/sslport.pike
index ae58e6e0680d69815680e8f609460b98af58c357..4cd766901740475a7b96f6a254a4e14375e85922 100644
--- a/lib/7.8/modules/SSL.pmod/sslport.pike
+++ b/lib/7.8/modules/SSL.pmod/sslport.pike
@@ -62,18 +62,6 @@ void ssl_callback(mixed id)
   }
 }
 
-#if 0
-void set_id(mixed id)
-{
-  error( "Not supported\n" );
-}
-
-mixed query_id()
-{
-  error( "Not supported\n" );
-}
-#endif
-
 //! @decl int bind(int port, @
 //!                function(SSL.sslfile|void, mixed|void: int) callback, @
 //!                string|void ip)
diff --git a/lib/7.8/modules/Stdio.pmod/module.pmod b/lib/7.8/modules/Stdio.pmod/module.pmod
index 2fe417cedb8380e36ec4e64442da8ba7eb3d8742..b123b69d094d3bddc90c84420b6dd1e53a354c99 100644
--- a/lib/7.8/modules/Stdio.pmod/module.pmod
+++ b/lib/7.8/modules/Stdio.pmod/module.pmod
@@ -768,25 +768,12 @@ class File
 
     if (!___read_callback) {
       if (___close_callback) {
-#if 0
-	/* This code only works for the POLL case! */
-	if ((peek(0, 1) == -1) && (errno() == System.EPIPE))
-#endif /* 0 */
 	  return __stdio_close_callback();
       }
       return 0;
     }
 
     if (!errno()) {
-#if 0
-      if (!(::mode() & PROP_IS_NONBLOCKING))
-	error ("Read callback called on blocking socket!\n"
-	       "Callbacks: %O, %O\n"
-	       "Id: %O\n",
-	       ___read_callback,
-	       ___close_callback,
-	       ___id);
-#endif /* 0 */
 
       string s;
 #ifdef STDIO_CALLBACK_TEST_MODE
@@ -843,9 +830,6 @@ class File
   protected int __stdio_close_callback()
   {
     BE_WERR ("__stdio_close_callback()");
-#if 0
-    if (!(::mode() & PROP_IS_NONBLOCKING)) ::set_nonblocking();
-#endif /* 0 */
 
     if (!___close_callback) return 0;
 
@@ -1398,25 +1382,13 @@ class File
   void set_blocking_keep_callbacks()
   {
      CHECK_OPEN();
-#if 0
-     ::_disable_callbacks(); // Thread safing // Unnecessary. /mast
-#endif
      ::set_blocking();
-#if 0
-     ::_enable_callbacks();
-#endif
   }
 
   void set_nonblocking_keep_callbacks()
   {
      CHECK_OPEN();
-#if 0
-     ::_disable_callbacks(); // Thread safing // Unnecessary. /mast
-#endif
      ::set_nonblocking();
-#if 0
-     ::_enable_callbacks();
-#endif
   }
    
   protected void destroy()