evas/loaders: use Eina_Stringshare where needed.
authorJean-Philippe Andre <jp.andre@samsung.com>
Tue, 2 Jul 2013 06:33:32 +0000 (15:33 +0900)
committerCedric Bail <cedric.bail@samsung.com>
Tue, 2 Jul 2013 07:58:10 +0000 (16:58 +0900)
Evas loaders' open() function expect the key to be a stringshare,
so declare it as such and keep using ref() without add().

Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
15 files changed:
src/lib/evas/Evas_Loader.h
src/modules/evas/loaders/bmp/evas_image_load_bmp.c
src/modules/evas/loaders/eet/evas_image_load_eet.c
src/modules/evas/loaders/generic/evas_image_load_generic.c
src/modules/evas/loaders/gif/evas_image_load_gif.c
src/modules/evas/loaders/ico/evas_image_load_ico.c
src/modules/evas/loaders/jpeg/evas_image_load_jpeg.c
src/modules/evas/loaders/pmaps/evas_image_load_pmaps.c
src/modules/evas/loaders/png/evas_image_load_png.c
src/modules/evas/loaders/psd/evas_image_load_psd.c
src/modules/evas/loaders/tga/evas_image_load_tga.c
src/modules/evas/loaders/tiff/evas_image_load_tiff.c
src/modules/evas/loaders/wbmp/evas_image_load_wbmp.c
src/modules/evas/loaders/webp/evas_image_load_webp.c
src/modules/evas/loaders/xpm/evas_image_load_xpm.c

index 3121139..c096565 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _EVAS_LOADER_H
 #define _EVAS_LOADER_H
 
+#include "eina_stringshare.h"
+
 typedef struct _Evas_Image_Load_Opts Evas_Image_Load_Opts;
 typedef struct _Evas_Image_Animated  Evas_Image_Animated;
 typedef struct _Evas_Image_Property  Evas_Image_Property;
@@ -67,7 +69,7 @@ struct _Evas_Image_Load_Opts
 
 struct _Evas_Image_Load_Func
 {
-  void     *(*file_open) (Eina_File *f, const char *key,
+  void     *(*file_open) (Eina_File *f, Eina_Stringshare *key,
                          Evas_Image_Load_Opts *opts,
                          Evas_Image_Animated *animated,
                          int *error);
index a8e2abf..ed2037b 100644 (file)
@@ -295,7 +295,7 @@ _evas_image_load_file_header(void *map, size_t fsize, size_t *position, int *ima
 }
 
 static void *
-evas_image_load_file_open_bmp(Eina_File *f, const char *key EINA_UNUSED,
+evas_image_load_file_open_bmp(Eina_File *f, Eina_Stringshare *key EINA_UNUSED,
                               Evas_Image_Load_Opts *opts,
                               Evas_Image_Animated *animated EINA_UNUSED,
                               int *error)
index 98a44a3..3df9324 100644 (file)
@@ -15,7 +15,7 @@ struct _Evas_Loader_Internal
 };
 
 static void *
-evas_image_load_file_open_eet(Eina_File *f, const char *key,
+evas_image_load_file_open_eet(Eina_File *f, Eina_Stringshare *key,
                               Evas_Image_Load_Opts *opts EINA_UNUSED,
                               Evas_Image_Animated *animated EINA_UNUSED,
                               int *error)
@@ -43,7 +43,7 @@ evas_image_load_file_open_eet(Eina_File *f, const char *key,
         return NULL;
      }
 
-   loader->key = eina_stringshare_add(key);
+   loader->key = eina_stringshare_ref(key);
    return loader;
 }
 
index cba93be..6f00a68 100644 (file)
@@ -381,7 +381,7 @@ getdata:
 }
 
 static void *
-evas_image_load_file_open_generic(Eina_File *f, const char *key,
+evas_image_load_file_open_generic(Eina_File *f, Eina_Stringshare *key,
                                  Evas_Image_Load_Opts *opts,
                                  Evas_Image_Animated *animated EINA_UNUSED,
                                  int *error)
@@ -396,7 +396,7 @@ evas_image_load_file_open_generic(Eina_File *f, const char *key,
      }
 
    loader->f = f;
-   loader->key = eina_stringshare_add(key);
+   loader->key = eina_stringshare_ref(key);
    loader->opts = opts;
    return loader;
 }
index edf8137..7f9d484 100644 (file)
@@ -678,7 +678,7 @@ _evas_image_load_file_read(GifFileType* gft, GifByteType *buf,int length)
    return length;
 }
 static void *
-evas_image_load_file_open_gif(Eina_File *f, const char *key EINA_UNUSED,
+evas_image_load_file_open_gif(Eina_File *f, Eina_Stringshare *key EINA_UNUSED,
                                Evas_Image_Load_Opts *opts,
                                Evas_Image_Animated *animated,
                                int *error)
index 8fa01e5..5e54dbe 100644 (file)
@@ -83,7 +83,7 @@ enum
 };
 
 static void *
-evas_image_load_file_open_ico(Eina_File *f, const char *key,
+evas_image_load_file_open_ico(Eina_File *f, Eina_Stringshare *key,
                               Evas_Image_Load_Opts *opts,
                               Evas_Image_Animated *animated EINA_UNUSED,
                               int *error)
@@ -98,7 +98,7 @@ evas_image_load_file_open_ico(Eina_File *f, const char *key,
      }
 
    loader->f = f;
-   loader->key = eina_stringshare_add(key);
+   loader->key = eina_stringshare_ref(key);
    loader->opts = opts;
 
    return loader;
index 3d9999a..31048aa 100644 (file)
@@ -1262,7 +1262,7 @@ evas_image_load_file_data_jpeg_alpha_internal(Image_Entry *ie, FILE *f, int *err
 #endif
 
 static void *
-evas_image_load_file_open_jpeg(Eina_File *f, const char *key EINA_UNUSED,
+evas_image_load_file_open_jpeg(Eina_File *f, Eina_Stringshare *key EINA_UNUSED,
                               Evas_Image_Load_Opts *opts,
                               Evas_Image_Animated *animated EINA_UNUSED,
                               int *error)
index b2dca89..62551e5 100644 (file)
@@ -56,7 +56,7 @@ static size_t pmaps_buffer_raw_update(Pmaps_Buffer *b);
 static int pmaps_buffer_comment_skip(Pmaps_Buffer *b);
 
 static void *
-evas_image_load_file_open_pmaps(Eina_File *f, const char *key EINA_UNUSED,
+evas_image_load_file_open_pmaps(Eina_File *f, Eina_Stringshare *key EINA_UNUSED,
                                Evas_Image_Load_Opts *opts EINA_UNUSED,
                                Evas_Image_Animated *animated EINA_UNUSED,
                                int *error EINA_UNUSED)
index 9fb3954..eef8385 100644 (file)
@@ -44,7 +44,7 @@ _evas_image_png_read(png_structp png_ptr, png_bytep out, png_size_t count)
 }
 
 static void *
-evas_image_load_file_open_png(Eina_File *f, const char *key EINA_UNUSED,
+evas_image_load_file_open_png(Eina_File *f, Eina_Stringshare *key EINA_UNUSED,
                               Evas_Image_Load_Opts *opts,
                               Evas_Image_Animated *animated EINA_UNUSED,
                               int *error)
index d11a7f6..e553196 100644 (file)
@@ -147,7 +147,7 @@ is_psd(PSD_Header *header)
 }
 
 static void *
-evas_image_load_file_open_psd(Eina_File *f, const char *key EINA_UNUSED,
+evas_image_load_file_open_psd(Eina_File *f, Eina_Stringshare *key EINA_UNUSED,
                              Evas_Image_Load_Opts *opts EINA_UNUSED,
                              Evas_Image_Animated *animated EINA_UNUSED,
                              int *error EINA_UNUSED)
index 8a482c4..6c022dc 100644 (file)
@@ -57,7 +57,7 @@ struct _tga_footer
 } __attribute__((packed));
 
 static void *
-evas_image_load_file_open_tga(Eina_File *f, const char *key EINA_UNUSED,
+evas_image_load_file_open_tga(Eina_File *f, Eina_Stringshare *key EINA_UNUSED,
                              Evas_Image_Load_Opts *opts EINA_UNUSED,
                              Evas_Image_Animated *animated EINA_UNUSED,
                              int *error EINA_UNUSED)
index 260a8b8..b170fe6 100644 (file)
@@ -85,7 +85,7 @@ _evas_tiff_UnmapProc(thandle_t handle, tdata_t data, toff_t size EINA_UNUSED)
 }
 
 static void *
-evas_image_load_file_open_tiff(Eina_File *f, const char *key EINA_UNUSED,
+evas_image_load_file_open_tiff(Eina_File *f, Eina_Stringshare *key EINA_UNUSED,
                               Evas_Image_Load_Opts *opts EINA_UNUSED,
                               Evas_Image_Animated *animated EINA_UNUSED,
                               int *error EINA_UNUSED)
index 1726b55..1bfc5ae 100644 (file)
@@ -30,7 +30,7 @@ read_mb(unsigned int *data, void *map, size_t length, size_t *position)
 }
 
 static void *
-evas_image_load_file_open_wbmp(Eina_File *f, const char *key EINA_UNUSED,
+evas_image_load_file_open_wbmp(Eina_File *f, Eina_Stringshare *key EINA_UNUSED,
                               Evas_Image_Load_Opts *opts EINA_UNUSED,
                               Evas_Image_Animated *animated EINA_UNUSED,
                               int *error EINA_UNUSED)
index 69ac690..36a6aa3 100644 (file)
@@ -41,7 +41,7 @@ evas_image_load_file_check(Eina_File *f, void *map,
 }
 
 static void *
-evas_image_load_file_open_webp(Eina_File *f, const char *key EINA_UNUSED,
+evas_image_load_file_open_webp(Eina_File *f, Eina_Stringshare *key EINA_UNUSED,
                               Evas_Image_Load_Opts *opts EINA_UNUSED,
                               Evas_Image_Animated *animated EINA_UNUSED,
                               int *error EINA_UNUSED)
index f09a8a2..b340191 100644 (file)
@@ -649,7 +649,7 @@ evas_image_load_file_xpm(Eina_File *f, Evas_Image_Property *prop, void *pixels,
 }
 
 static void *
-evas_image_load_file_open_xpm(Eina_File *f, const char *key EINA_UNUSED,
+evas_image_load_file_open_xpm(Eina_File *f, Eina_Stringshare *key EINA_UNUSED,
                              Evas_Image_Load_Opts *opts EINA_UNUSED,
                              Evas_Image_Animated *animated EINA_UNUSED,
                              int *error EINA_UNUSED)