emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/emms 9db19a5abd 31/42: Remove emms--use-bindat-type


From: ELPA Syncer
Subject: [elpa] externals/emms 9db19a5abd 31/42: Remove emms--use-bindat-type
Date: Wed, 1 Nov 2023 15:58:01 -0400 (EDT)

branch: externals/emms
commit 9db19a5abd013c05b7ea42f0e8132c0a64b4e82e
Author: Petteri Hintsanen <petterih@iki.fi>
Commit: Petteri Hintsanen <petterih@iki.fi>

    Remove emms--use-bindat-type
---
 emms-info-flac.el           | 6 +++---
 emms-info-mp3.el            | 8 ++++----
 emms-info-ogg.el            | 3 +--
 emms-info-opus.el           | 9 ++++-----
 emms-info-spc.el            | 3 +--
 emms-info-vorbis.el         | 9 ++++-----
 emms.el                     | 4 ----
 test/emms-info-ogg-tests.el | 2 +-
 8 files changed, 18 insertions(+), 26 deletions(-)

diff --git a/emms-info-flac.el b/emms-info-flac.el
index b34c902038..bc2f82f41d 100644
--- a/emms-info-flac.el
+++ b/emms-info-flac.el
@@ -47,7 +47,7 @@ but in practice processing must be constrained to prevent 
memory
 exhaustion in case of garbled or malicious inputs.")
 
 (defconst emms-info-flac--meta-header-bindat-spec
-  (if emms--use-bindat-type
+  (if (eval-when-compile (fboundp 'bindat-type))
       (bindat-type
         (flags u8)
         (length uint 24)
@@ -62,7 +62,7 @@ exhaustion in case of garbled or malicious inputs.")
   "FLAC metadata block header specification.")
 
 (defconst emms-info-flac--stream-info-block-bindat-spec
-  (if emms--use-bindat-type
+  (if (eval-when-compile (fboundp 'bindat-type))
       (bindat-type
         (min-block-size uint 16)
         (max-block-size uint 16)
@@ -79,7 +79,7 @@ exhaustion in case of garbled or malicious inputs.")
   "FLAC stream info block specification.")
 
 (defconst emms-info-flac--comment-block-bindat-spec
-  (if emms--use-bindat-type
+  (if (eval-when-compile (fboundp 'bindat-type))
       (bindat-type
         (vendor-length uint 32 'le)
         (_ unit (when (> vendor-length emms-info-vorbis--max-vendor-length)
diff --git a/emms-info-mp3.el b/emms-info-mp3.el
index 58afa7b006..5e897f4325 100644
--- a/emms-info-mp3.el
+++ b/emms-info-mp3.el
@@ -54,7 +54,7 @@
   "id3v2 header magic pattern.")
 
 (defconst emms-info-id3v2--header-bindat-spec
-  (if emms--use-bindat-type
+  (if (eval-when-compile (fboundp 'bindat-type))
       (bindat-type
         (file-identifier str 3)
         (_ unit (unless (equal file-identifier emms-info-id3v2--magic-pattern)
@@ -81,7 +81,7 @@
   "id3v2 header specification.")
 
 (defconst emms-info-id3v2--frame-header-bindat-spec
-  (if emms--use-bindat-type
+  (if (eval-when-compile (fboundp 'bindat-type))
       (bindat-type
         (id str (if (= emms-info-id3v2--version 2) 3 4))
         (_ unit (unless (emms-info-id3v2--valid-frame-id-p id)
@@ -512,7 +512,7 @@ Return the text as string."
   "Sample rate for each MPEG version/layer combination.")
 
 (defconst emms-info-mp3--vbri-header-bindat-spec
-  (if emms--use-bindat-type
+  (if (eval-when-compile (fboundp 'bindat-type))
       (bindat-type
         (id str 4)
         (version uint 16)
@@ -531,7 +531,7 @@ This specification is purposefully incomplete, as we are
 interested only in the frame count.")
 
 (defconst emms-info-mp3--xing-header-bindat-spec
-    (if emms--use-bindat-type
+    (if (eval-when-compile (fboundp 'bindat-type))
         (bindat-type
           (id vec 4)
           (flags bits 4)
diff --git a/emms-info-ogg.el b/emms-info-ogg.el
index 1c25a16d2d..393841228c 100644
--- a/emms-info-ogg.el
+++ b/emms-info-ogg.el
@@ -39,7 +39,6 @@
 
 ;;; Code:
 
-(require 'emms)
 (require 'emms-info-opus)
 (require 'emms-info-vorbis)
 (require 'bindat)
@@ -63,7 +62,7 @@ exhaustion in case of garbled or malicious inputs.")
   "Ogg format magic capture pattern.")
 
 (defconst emms-info-ogg--page-bindat-spec
-  (if emms--use-bindat-type
+  (if (eval-when-compile (fboundp 'bindat-type))
       (bindat-type
         (capture-pattern str 4)
         (_ unit (unless (equal capture-pattern emms-info-ogg--magic-pattern)
diff --git a/emms-info-opus.el b/emms-info-opus.el
index 665e5e13a5..42415ee32d 100644
--- a/emms-info-opus.el
+++ b/emms-info-opus.el
@@ -25,7 +25,6 @@
 
 ;; This file contains Opus-specific code for `emms-info-ogg' feature.
 
-(require 'emms)
 (require 'emms-info-vorbis)
 (require 'bindat)
 
@@ -36,7 +35,7 @@
   "Opus identification header magic pattern.")
 
 (defconst emms-info-opus--channel-mapping-bindat-spec
-  (if emms--use-bindat-type
+  (if (eval-when-compile (fboundp 'bindat-type))
       (bindat-type
         (stream-count u8)
         (coupled-count u8)
@@ -47,7 +46,7 @@
   "Opus channel mapping table specification.")
 
 (defconst emms-info-opus--id-header-bindat-spec
-  (if emms--use-bindat-type
+  (if (eval-when-compile (fboundp 'bindat-type))
       (bindat-type
         (opus-head str 8)
         (_ unit (unless (equal opus-head emms-info-opus--id-magic-pattern)
@@ -90,7 +89,7 @@
   "Opus comment header magic pattern.")
 
 (defconst emms-info-opus--comment-header-bindat-spec
-  (if emms--use-bindat-type
+  (if (eval-when-compile (fboundp 'bindat-type))
       (bindat-type
         (opus-tags str 8)
         (_ unit (unless (equal opus-tags emms-info-opus--tags-magic-pattern)
@@ -128,7 +127,7 @@
   "Opus comment header specification.")
 
 (defconst emms-info-opus--headers-bindat-spec
-  (if emms--use-bindat-type
+  (if (eval-when-compile (fboundp 'bindat-type))
       (bindat-type
         (identification-header type emms-info-opus--id-header-bindat-spec)
         (comment-header type emms-info-opus--comment-header-bindat-spec))
diff --git a/emms-info-spc.el b/emms-info-spc.el
index 258a5d81a2..104534de22 100644
--- a/emms-info-spc.el
+++ b/emms-info-spc.el
@@ -30,7 +30,6 @@
 
 ;;; Code:
 
-(require 'emms)
 (require 'bindat)
 
 (defconst emms-info-spc--id666-magic-pattern
@@ -38,7 +37,7 @@
   "id666 header magic pattern.")
 
 (defconst emms-info-spc--id666-header-bindat-spec
-  (if emms--use-bindat-type
+  (if (eval-when-compile (fboundp 'bindat-type))
       (bindat-type
         (file-identifier str 33)
         (_ unit (unless (equal file-identifier
diff --git a/emms-info-vorbis.el b/emms-info-vorbis.el
index 1f50e738c1..97ac4e6898 100644
--- a/emms-info-vorbis.el
+++ b/emms-info-vorbis.el
@@ -28,7 +28,6 @@
 ;;; Code:
 
 (require 'bindat)
-(require 'emms)
 
 (defconst emms-info-vorbis--max-comments 1024
   "Maximum number of Vorbis comment fields in a stream.
@@ -83,7 +82,7 @@ their comments have almost the same format as Vorbis.")
   "Header packet magic pattern.")
 
 (defconst emms-info-vorbis--id-header-bindat-spec
-  (if emms--use-bindat-type
+  (if (eval-when-compile (fboundp 'bindat-type))
       (bindat-type
         (packet-type u8)
         (_ unit (unless (= packet-type 1)
@@ -134,7 +133,7 @@ their comments have almost the same format as Vorbis.")
   "Vorbis identification header specification.")
 
 (defconst emms-info-vorbis--comment-field-bindat-spec
-  (if emms--use-bindat-type
+  (if (eval-when-compile (fboundp 'bindat-type))
       (bindat-type
         (length uint 32 'le)
         (_ unit (when (> length emms-info-vorbis--max-comment-size)
@@ -148,7 +147,7 @@ their comments have almost the same format as Vorbis.")
   "Vorbis comment field specification.")
 
 (defconst emms-info-vorbis--comment-header-bindat-spec
-  (if emms--use-bindat-type
+  (if (eval-when-compile (fboundp 'bindat-type))
       (bindat-type
         (packet-type u8)
         (_ unit (unless (= packet-type 3)
@@ -201,7 +200,7 @@ their comments have almost the same format as Vorbis.")
   "Vorbis comment header specification.")
 
 (defconst emms-info-vorbis--headers-bindat-spec
-  (if emms--use-bindat-type
+  (if (eval-when-compile (fboundp 'bindat-type))
       (bindat-type
         (_ struct (identification-header type 
emms-info-vorbis--id-header-bindat-spec)
                   (comment-header type 
emms-info-vorbis--comment-header-bindat-spec)))
diff --git a/emms.el b/emms.el
index e0cbba3c0b..826cb1b33d 100644
--- a/emms.el
+++ b/emms.el
@@ -45,10 +45,6 @@
 ;;; Code:
 (require 'emms-compat)
 
-(defvar emms--use-bindat-type
-  (eval-when-compile (fboundp 'bindat-type))
-"Use bindat-type macro.")
-
 (defvar emms-version "16"
   "EMMS version string.")
 
diff --git a/test/emms-info-ogg-tests.el b/test/emms-info-ogg-tests.el
index 0f51efeb92..d109b28c3e 100644
--- a/test/emms-info-ogg-tests.el
+++ b/test/emms-info-ogg-tests.el
@@ -115,7 +115,7 @@ This is a helper function for 
`emms-ogg-test-decode-last-page'."
            (page-segments . 1)
            (segment-table . [10])
            (payload . "OggS123456")))))
-    (unless emms--use-bindat-type
+    (unless (eval-when-compile (fboundp 'bindat-type))
       (push (cons 'granule-position-bytes [0 36 8 1 0 0 0 0]) valid-result))
     (should (emms-equal-lists (emms-ogg-test--decode-last-page valid)
                               valid-result))



reply via email to

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