[vte/wip/egmont/bidi: 52/104] no vector



commit 7765dc01720772000a69c77d5a22a72a80a8d738
Author: Egmont Koblinger <egmont gmail com>
Date:   Wed Aug 29 13:29:44 2018 +0200

    no vector

 src/bidi.cc | 5 +++--
 src/bidi.hh | 3 +--
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/bidi.cc b/src/bidi.cc
index 97360364..80d476c8 100644
--- a/src/bidi.cc
+++ b/src/bidi.cc
@@ -119,7 +119,7 @@ RingView::RingView()
 
         m_height_alloc = 32;
 
-        m_bidirows.resize(m_height_alloc);
+        m_bidirows = (BidiRow **) g_malloc (sizeof (BidiRow *) * m_height_alloc);
         for (int i = 0; i < m_height_alloc; i++) {
                 m_bidirows[i] = new BidiRow();
         }
@@ -130,6 +130,7 @@ RingView::~RingView()
         for (int i = 0; i < m_height_alloc; i++) {
                 delete m_bidirows[i];
         }
+        g_free (m_bidirows);
 }
 
 void RingView::set_ring(Ring *ring)
@@ -153,7 +154,7 @@ void RingView::set_rows(vte::grid::row_t s, vte::grid::row_t l)
                 while (l > m_height_alloc) {
                         m_height_alloc *= 2;
                 }
-                m_bidirows.resize(m_height_alloc);
+                m_bidirows = (BidiRow **) g_realloc (m_bidirows, sizeof (BidiRow *) * m_height_alloc);
                 for (; i < m_height_alloc; i++) {
                         m_bidirows[i] = new BidiRow();
                         m_bidirows[i]->set_width(m_width);
diff --git a/src/bidi.hh b/src/bidi.hh
index 4685d9ca..71aeed73 100644
--- a/src/bidi.hh
+++ b/src/bidi.hh
@@ -19,7 +19,6 @@
 #pragma once
 
 #include <glib.h>
-#include <vector>
 
 #include "ring.hh"
 #include "vterowdata.hh"
@@ -90,7 +89,7 @@ public:
 private:
         Ring *m_ring;
 
-        std::vector<BidiRow *> m_bidirows;
+        BidiRow **m_bidirows;
 
         vte::grid::row_t m_start;
         vte::grid::row_t m_len;


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