[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Towards a cleaner build: arc-mode

From: Lars Ingebrigtsen
Subject: Re: Towards a cleaner build: arc-mode
Date: Sat, 18 May 2019 08:04:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

There's one additional use of string-as-multibyte in arc-mode that I
didn't notice before:

(defun archive-l-e (str &optional len)
  "Convert little endian string/vector STR to integer.
Alternatively, STR may be a buffer position in the current buffer
in which case a second argument, length LEN, should be supplied."
  (if (stringp str)
      (setq len (length str))
    (setq str (buffer-substring str (+ str len))))
  (setq str (string-as-unibyte str))
  (let ((result 0)
        (i 0))
    (while (< i len)
      (setq i (1+ i)
            result (+ (ash result 8)
                      (aref str (- len i)))))

Hm...  These buffers are multibyte, but do not contain any characters,
just ASCII and stuff from the "byte plane"...

(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

reply via email to

[Prev in Thread] Current Thread [Next in Thread]