[libgepub] lib: Fix gepub_text_chunk_new() related warnings



commit 953d8ef63600f015d005a30e8f440c8aad213b1b
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Jun 22 09:58:40 2017 +0200

    lib: Fix gepub_text_chunk_new() related warnings
    
    There was no need to use an unsigned char for storage or as a function
    argument, so change the data type and cast the calls instead.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=784081

 libgepub/gepub-text-chunk.c |    2 +-
 libgepub/gepub-text-chunk.h |    4 ++--
 libgepub/gepub-utils.c      |    8 ++++----
 3 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/libgepub/gepub-text-chunk.c b/libgepub/gepub-text-chunk.c
index 377bc53..0f222a6 100644
--- a/libgepub/gepub-text-chunk.c
+++ b/libgepub/gepub-text-chunk.c
@@ -54,7 +54,7 @@ gepub_text_chunk_class_init (GepubTextChunkClass *klass)
  * Returns: (transfer none): the chunk text
  */
 GepubTextChunk *
-gepub_text_chunk_new (GepubTextChunkType type, const guchar *text)
+gepub_text_chunk_new (GepubTextChunkType type, const gchar *text)
 {
     GepubTextChunk *t;
 
diff --git a/libgepub/gepub-text-chunk.h b/libgepub/gepub-text-chunk.h
index b4031ec..65bc1e3 100644
--- a/libgepub/gepub-text-chunk.h
+++ b/libgepub/gepub-text-chunk.h
@@ -43,7 +43,7 @@ struct _GepubTextChunk {
     GObject parent;
 
     GepubTextChunkType type;
-    guchar *text;
+    gchar *text;
 };
 
 struct _GepubTextChunkClass {
@@ -54,7 +54,7 @@ typedef struct _GepubTextChunk      GepubTextChunk;
 typedef struct _GepubTextChunkClass GepubTextChunkClass;
 
 GType               gepub_text_chunk_get_type     (void) G_GNUC_CONST;
-GepubTextChunk     *gepub_text_chunk_new          (GepubTextChunkType type, const guchar *text);
+GepubTextChunk     *gepub_text_chunk_new          (GepubTextChunkType type, const gchar *text);
 const char         *gepub_text_chunk_type_str     (GepubTextChunk *chunk);
 const char         *gepub_text_chunk_text         (GepubTextChunk *chunk);
 GepubTextChunkType  gepub_text_chunk_type         (GepubTextChunk *chunk);
diff --git a/libgepub/gepub-utils.c b/libgepub/gepub-utils.c
index aa1ba41..599aa19 100644
--- a/libgepub/gepub-utils.c
+++ b/libgepub/gepub-utils.c
@@ -192,13 +192,13 @@ gepub_utils_get_text_elements (xmlNode *node)
             GepubTextChunk *text_chunk = NULL;
 
             if (gepub_utils_has_parent_tag (cur_node, "b", "strong", NULL)) {
-                text_chunk = gepub_text_chunk_new (GEPUBTextBold, cur_node->content);
+                text_chunk = gepub_text_chunk_new (GEPUBTextBold, (char *) cur_node->content);
             } else if (gepub_utils_has_parent_tag (cur_node, "i", "em", NULL)) {
-                text_chunk = gepub_text_chunk_new (GEPUBTextItalic, cur_node->content);
+                text_chunk = gepub_text_chunk_new (GEPUBTextItalic, (char *) cur_node->content);
             } else if (gepub_utils_has_parent_tag (cur_node, "h1", "h2", "h3", "h4", "h5", NULL)) {
-                text_chunk = gepub_text_chunk_new (GEPUBTextHeader, cur_node->content);
+                text_chunk = gepub_text_chunk_new (GEPUBTextHeader, (char *) cur_node->content);
             } else if (gepub_utils_has_parent_tag (cur_node, "p", NULL)) {
-                text_chunk = gepub_text_chunk_new (GEPUBTextNormal, cur_node->content);
+                text_chunk = gepub_text_chunk_new (GEPUBTextNormal, (char *) cur_node->content);
             }
 
             if (text_chunk)


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