emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/bindat.el


From: Thien-Thi Nguyen
Subject: [Emacs-diffs] Changes to emacs/lisp/emacs-lisp/bindat.el
Date: Thu, 25 May 2006 08:51:31 +0000

Index: emacs/lisp/emacs-lisp/bindat.el
diff -u emacs/lisp/emacs-lisp/bindat.el:1.10 
emacs/lisp/emacs-lisp/bindat.el:1.11
--- emacs/lisp/emacs-lisp/bindat.el:1.10        Tue May 23 11:21:59 2006
+++ emacs/lisp/emacs-lisp/bindat.el     Thu May 25 08:51:31 2006
@@ -345,8 +345,10 @@
 
 (defun bindat-unpack (spec raw-data &optional pos)
   "Return structured data according to SPEC for binary data in RAW-DATA.
-RAW-DATA is a string or vector.  Optional third arg POS specifies the
-starting offset in RAW-DATA."
+RAW-DATA is a unibyte string or vector.  Optional third arg POS specifies
+the starting offset in RAW-DATA."
+  (when (multibyte-string-p raw-data)
+    (error "String is multibyte"))
   (unless pos (setq pos 0))
   (bindat--unpack-group spec))
 
@@ -581,10 +583,10 @@
 
 (defun bindat-pack (spec struct &optional raw-data pos)
   "Return binary data packed according to SPEC for structured data STRUCT.
-Optional third arg RAW-DATA is a pre-allocated string or vector to pack into.
-Optional fourth arg POS is the starting offset into RAW-DATA.
-Note: The result is a multibyte string; use `string-make-unibyte' on it
-to make it unibyte if necessary."
+Optional third arg RAW-DATA is a pre-allocated unibyte string or vector to
+pack into.  Optional fourth arg POS is the starting offset into RAW-DATA."
+  (when (multibyte-string-p raw-data)
+    (error "Pre-allocated string is multibyte"))
   (let ((no-return raw-data))
     (unless pos (setq pos 0))
     (unless raw-data




reply via email to

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