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

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

[elpa] externals/xelb 1cea22d 20/42: Provide a way to disable auto-paddi


From: Chris Feng
Subject: [elpa] externals/xelb 1cea22d 20/42: Provide a way to disable auto-padding
Date: Thu, 17 Sep 2015 23:16:44 +0000

branch: externals/xelb
commit 1cea22d26295f089139233907a97248451d5fe92
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>

    Provide a way to disable auto-padding
    
    The auto-padding feature need to be disabled for at least XIM. Perhaps it's
    better to insert auto-padding fields with code generator directly.
---
 xcb-types.el |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/xcb-types.el b/xcb-types.el
index 3fd06bf..b3eecdb 100644
--- a/xcb-types.el
+++ b/xcb-types.el
@@ -293,7 +293,8 @@ Consider let-bind it rather than change its global value.")
 (defclass xcb:-struct ()
   ((~lsb :initarg :~lsb
          :initform (symbol-value 'xcb:lsb) ;see `eieio-default-eval-maybe'
-         :type xcb:-ignore))
+         :type xcb:-ignore)
+   (~auto-padding :initarg :~auto-padding :initform t :type xcb:-ignore))
   :documentation "Struct type.")
 
 (cl-defmethod xcb:marshal ((obj xcb:-struct))
@@ -350,7 +351,7 @@ The optional POS argument indicates current byte index of 
the field (used by
             (data (slot-value obj list-name))
             implicit-padding)
        (unless (integerp list-size)
-         (setq implicit-padding t)
+         (when (slot-value obj '~auto-padding) (setq implicit-padding t))
          (setq list-size (eval list-size `((obj . ,obj))))
          (unless list-size
            (setq list-size (length data)))) ;list-size can be nil
@@ -467,7 +468,7 @@ and the second the consumed length."
            (list-size (plist-get initform 'size))
            implicit-padding)
        (unless (integerp list-size)
-         (setq implicit-padding t)
+         (when (slot-value obj '~auto-padding) (setq implicit-padding t))
          (setq list-size (eval list-size `((obj . ,obj) (ctx . ,ctx)))))
        (cl-assert (integerp list-size))
        (pcase list-type



reply via email to

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