diff src/fns.c @ 5510:6b3caa55668c

Remove the LOSING_BYTECODE compile-time option, it's been off since 1997. 2011-05-20 Aidan Kehoe <kehoea@parhasard.net> * config.h.in: * data.c (Faref): * fns.c (check_losing_bytecode): * fns.c (concat): * fns.c (Felt): Remove the LOSING_BYTECODE compile-time option entirely. It allowed access to the elements of a compiled function using #'aref, and has been turned off since 1997.
author Aidan Kehoe <kehoea@parhasard.net>
date Fri, 20 May 2011 12:16:42 +0100
parents d3e0482c7899
children fa5fc2e3d9a6
line wrap: on
line diff
--- a/src/fns.c	Wed May 18 14:21:52 2011 +0100
+++ b/src/fns.c	Fri May 20 12:16:42 2011 +0100
@@ -836,31 +836,6 @@
 
 /* Random data-structure functions */
 
-#ifdef LOSING_BYTECODE
-
-/* #### Delete this shit */
-
-/* Charcount is a misnomer here as we might be dealing with the
-   length of a vector or list, but emphasizes that we're not dealing
-   with Bytecounts in strings */
-static Charcount
-length_with_bytecode_hack (Lisp_Object seq)
-{
-  if (!COMPILED_FUNCTIONP (seq))
-    return XINT (Flength (seq));
-  else
-    {
-      Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (seq);
-
-      return (f->flags.interactivep ? COMPILED_INTERACTIVE :
-	      f->flags.domainp      ? COMPILED_DOMAIN :
-	      COMPILED_DOC_STRING)
-	+ 1;
-    }
-}
-
-#endif /* LOSING_BYTECODE */
-
 void
 check_losing_bytecode (const Ascbyte *function, Lisp_Object seq)
 {
@@ -1653,11 +1628,6 @@
         ;
       else if (VECTORP (seq) || STRINGP (seq) || BIT_VECTORP (seq))
         ;
-#ifdef LOSING_BYTECODE
-      else if (COMPILED_FUNCTIONP (seq))
-        /* Urk!  We allow this, for "compatibility"... */
-        ;
-#endif
 #if 0				/* removed for XEmacs 21 */
       else if (INTP (seq))
         /* This is too revolting to think about but maintains
@@ -1687,11 +1657,7 @@
 
     for (argnum = 0, total_length = 0; argnum < nargs; argnum++)
       {
-#ifdef LOSING_BYTECODE
-        Charcount thislen = length_with_bytecode_hack (args[argnum]);
-#else
         Charcount thislen = XINT (Flength (args[argnum]));
-#endif
         total_length += thislen;
       }
 
@@ -1752,11 +1718,7 @@
 
       if (!CONSP (seq))
 	{
-#ifdef LOSING_BYTECODE
-	  thisleni = length_with_bytecode_hack (seq);
-#else
 	  thisleni = XINT (Flength (seq));
-#endif
 	}
       if (STRINGP (seq))
 	string_source_ptr = XSTRING_DATA (seq);
@@ -2352,44 +2314,6 @@
            VECTORP     (sequence) ||
            BIT_VECTORP (sequence))
     return Faref (sequence, n);
-#ifdef LOSING_BYTECODE
-  else if (COMPILED_FUNCTIONP (sequence))
-    {
-      EMACS_INT idx = XINT (n);
-      if (idx < 0)
-        {
-        lose:
-          args_out_of_range (sequence, n);
-        }
-      /* Utter perversity */
-      {
-	Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (sequence);
-        switch (idx)
-          {
-          case COMPILED_ARGLIST:
-            return compiled_function_arglist (f);
-          case COMPILED_INSTRUCTIONS:
-            return compiled_function_instructions (f);
-          case COMPILED_CONSTANTS:
-            return compiled_function_constants (f);
-          case COMPILED_STACK_DEPTH:
-            return compiled_function_stack_depth (f);
-          case COMPILED_DOC_STRING:
-	    return compiled_function_documentation (f);
-          case COMPILED_DOMAIN:
-	    return compiled_function_domain (f);
-          case COMPILED_INTERACTIVE:
-	    if (f->flags.interactivep)
-	      return compiled_function_interactive (f);
-	    /* if we return nil, can't tell interactive with no args
-	       from noninteractive. */
-	    goto lose;
-          default:
-            goto lose;
-          }
-      }
-    }
-#endif /* LOSING_BYTECODE */
   else
     {
       check_losing_bytecode ("elt", sequence);