[vte] sixel: Reset repeat counter when receiving the next command



commit f728689e89ef4f6b83527c9a0d340ee52b7d0cf0
Author: Christian Persch <chpe src gnome org>
Date:   Sat Apr 3 16:07:50 2021 +0200

    sixel: Reset repeat counter when receiving the next command
    
    This was already done when receiving one of the known commands; do the
    same when receiving an unimplemented command.

 src/sixel-context.hh | 13 ++++++-------
 src/sixel-parser.hh  |  9 ++++-----
 2 files changed, 10 insertions(+), 12 deletions(-)
---
diff --git a/src/sixel-context.hh b/src/sixel-context.hh
index b3adea86..60114991 100644
--- a/src/sixel-context.hh
+++ b/src/sixel-context.hh
@@ -543,13 +543,6 @@ private:
                 m_repeat_count = seq.param(0, 1);
         }
 
-        /* FIXMEchpe: should also set
-         *
-         *      m_repeat_count = 1;
-         *
-         * for all the unused RESERVED_* sixel commands.
-         */
-
         void
         SIXEL(uint8_t sixel) noexcept
         {
@@ -596,6 +589,12 @@ private:
                 m_repeat_count = 1;
         }
 
+        void
+        SIXEL_NOP(vte::sixel::Sequence const& seq) noexcept
+        {
+                m_repeat_count = 1;
+        }
+
         void
         SIXEL_ST(char32_t st) noexcept
         {
diff --git a/src/sixel-parser.hh b/src/sixel-parser.hh
index 821acdc9..850928da 100644
--- a/src/sixel-parser.hh
+++ b/src/sixel-parser.hh
@@ -61,7 +61,7 @@ protected:
 
         unsigned m_command{(unsigned)Command::NONE};
         unsigned m_n_args{0};
-        vte_seq_arg_t m_args[VTE_SIXEL_PARSER_ARG_MAX]{0, 0, 0, 0, 0, 0 ,0 ,0};
+        vte_seq_arg_t m_args[VTE_SIXEL_PARSER_ARG_MAX]{0, 0, 0, 0, 0, 0 ,0, 0};
 
         constexpr auto capacity() const noexcept
         {
@@ -330,7 +330,7 @@ private:
                 case Command::DECGCI: return delegate.DECGCI(m_seq);
                 case Command::DECGCR: return delegate.DECGCR(m_seq);
                 case Command::DECGNL: return delegate.DECGNL(m_seq);
-                case Command::NONE:
+                case Command::NONE:   return;
                 case Command::RESERVED_2_05:
                 case Command::RESERVED_2_06:
                 case Command::RESERVED_2_07:
@@ -343,9 +343,8 @@ private:
                 case Command::RESERVED_2_15:
                 case Command::RESERVED_3_12:
                 case Command::RESERVED_3_13:
-                case Command::RESERVED_3_14:
-                default:
-                        return;
+                case Command::RESERVED_3_14: return delegate.SIXEL_NOP(m_seq);
+                default: __builtin_unreachable(); return;
                 }
         }
 


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