evas/loaders: use Eina_Stringshare where needed.

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>
This commit is contained in:
Jean-Philippe Andre 2013-07-02 15:33:32 +09:00 committed by Cedric Bail
parent 687c4aa475
commit f1506d8dd2
15 changed files with 20 additions and 18 deletions

View 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);

View 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)

View 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;
}

View 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;
}

View 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)

View 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;

View 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)

View 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)

View 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)

View 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)

View 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)

View 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)

View 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)

View 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)

View 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)