[vte] all: Fix underalignment warnings



commit 80f41f34519d3868314b65d36fe9312e61c62ca7
Author: Christian Persch <chpe src gnome org>
Date:   Wed Feb 24 20:22:10 2021 +0100

    all: Fix underalignment warnings

 src/bidi.cc       | 8 ++++----
 src/missing.cc    | 2 +-
 src/vterowdata.cc | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/bidi.cc b/src/bidi.cc
index c7e724ff..7adf74a4 100644
--- a/src/bidi.cc
+++ b/src/bidi.cc
@@ -258,7 +258,7 @@ BidiRunner::explicit_line_shape(vte::grid::row_t row)
 
                 /* Convenience stuff, we no longer need the auto-growing GArray wrapper. */
                 count = fribidi_chars_array->len;
-                fribidi_chars = (FriBidiChar *) fribidi_chars_array->data;
+                fribidi_chars = reinterpret_cast<FriBidiChar*>(fribidi_chars_array->data);
 
                 /* Run the BiDi algorithm on the paragraph to get the embedding levels. */
                 fribidi_chartypes = g_newa (FriBidiCharType, count);
@@ -558,9 +558,9 @@ BidiRunner::implicit_paragraph(vte::grid::row_t start, vte::grid::row_t end, boo
 
         /* Convenience stuff, we no longer need the auto-growing GArray wrapper. */
         count = fribidi_chars_array->len;
-        fribidi_chars = (FriBidiChar *) fribidi_chars_array->data;
-        fribidi_map = (FriBidiStrIndex *) fribidi_map_array->data;
-        fribidi_to_term = (FriBidiStrIndex *) fribidi_to_term_array->data;
+        fribidi_chars = reinterpret_cast<FriBidiChar*>(fribidi_chars_array->data);
+        fribidi_map = reinterpret_cast<FriBidiStrIndex*>(fribidi_map_array->data);
+        fribidi_to_term = reinterpret_cast<FriBidiStrIndex*>(fribidi_to_term_array->data);
 
         /* Run the BiDi algorithm on the paragraph to get the embedding levels. */
         fribidi_chartypes = g_newa (FriBidiCharType, count);
diff --git a/src/missing.cc b/src/missing.cc
index 3cf4654f..536b1e03 100644
--- a/src/missing.cc
+++ b/src/missing.cc
@@ -195,7 +195,7 @@ fdwalk(int (*cb)(void *data, int fd),
         {
           for (pos = 0; pos < nread; pos += de->d_reclen)
             {
-              de = (struct linux_dirent64 *)(buf + pos);
+              de = reinterpret_cast<struct linux_dirent64*>(buf + pos);
 
               fd = filename_to_fd (de->d_name);
               if (fd < 0 || fd == dir_fd)
diff --git a/src/vterowdata.cc b/src/vterowdata.cc
index b4234a75..17e14736 100644
--- a/src/vterowdata.cc
+++ b/src/vterowdata.cc
@@ -51,7 +51,7 @@ _vte_cells_for_cell_array (VteCell *cells)
        if (G_UNLIKELY (!cells))
                return NULL;
 
-       return (VteCells *) (((guchar *) cells) - G_STRUCT_OFFSET (VteCells, cells));
+       return reinterpret_cast<VteCells*>(((guchar *) cells) - G_STRUCT_OFFSET (VteCells, cells));
 }
 
 static VteCells *


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