[libgepub] lib: Make "transfer none" strings "const" instead



commit 85e11814b8b35411b443a56152a1cca29deed5fb
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Jun 21 16:53:55 2017 +0200

    lib: Make "transfer none" strings "const" instead
    
    Fixes "return discards ‘const’ qualifier from pointer target type"
    warnings and removes the need for an introspection tag.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=784050

 libgepub/gepub-text-chunk.c |    8 ++++----
 libgepub/gepub-text-chunk.h |    4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/libgepub/gepub-text-chunk.c b/libgepub/gepub-text-chunk.c
index b240caa..b422b2c 100644
--- a/libgepub/gepub-text-chunk.c
+++ b/libgepub/gepub-text-chunk.c
@@ -69,9 +69,9 @@ gepub_text_chunk_new (GepubTextChunkType type, const guchar *text)
  * gepub_text_chunk_type_str:
  * @chunk: a #GepubTextChunk
  *
- * Returns: (transfer none): the chunk text
+ * Returns: the chunk text
  */
-gchar *
+const char *
 gepub_text_chunk_type_str (GepubTextChunk *chunk)
 {
     switch (chunk->type) {
@@ -90,9 +90,9 @@ gepub_text_chunk_type_str (GepubTextChunk *chunk)
  * gepub_text_chunk_text:
  * @chunk: a #GepubTextChunk
  *
- * Returns: (transfer none): the chunk text
+ * Returns: the chunk text
  */
-gchar *
+const char *
 gepub_text_chunk_text (GepubTextChunk *chunk)
 {
     return chunk->text;
diff --git a/libgepub/gepub-text-chunk.h b/libgepub/gepub-text-chunk.h
index 7c53f15..b4031ec 100644
--- a/libgepub/gepub-text-chunk.h
+++ b/libgepub/gepub-text-chunk.h
@@ -55,8 +55,8 @@ typedef struct _GepubTextChunkClass GepubTextChunkClass;
 
 GType               gepub_text_chunk_get_type     (void) G_GNUC_CONST;
 GepubTextChunk     *gepub_text_chunk_new          (GepubTextChunkType type, const guchar *text);
-gchar              *gepub_text_chunk_type_str     (GepubTextChunk *chunk);
-gchar              *gepub_text_chunk_text         (GepubTextChunk *chunk);
+const char         *gepub_text_chunk_type_str     (GepubTextChunk *chunk);
+const char         *gepub_text_chunk_text         (GepubTextChunk *chunk);
 GepubTextChunkType  gepub_text_chunk_type         (GepubTextChunk *chunk);
 
 G_END_DECLS


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