forked from enlightenment/efl
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:
parent
687c4aa475
commit
f1506d8dd2
|
@ -1,6 +1,8 @@
|
||||||
#ifndef _EVAS_LOADER_H
|
#ifndef _EVAS_LOADER_H
|
||||||
#define _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_Load_Opts Evas_Image_Load_Opts;
|
||||||
typedef struct _Evas_Image_Animated Evas_Image_Animated;
|
typedef struct _Evas_Image_Animated Evas_Image_Animated;
|
||||||
typedef struct _Evas_Image_Property Evas_Image_Property;
|
typedef struct _Evas_Image_Property Evas_Image_Property;
|
||||||
|
@ -67,7 +69,7 @@ struct _Evas_Image_Load_Opts
|
||||||
|
|
||||||
struct _Evas_Image_Load_Func
|
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_Load_Opts *opts,
|
||||||
Evas_Image_Animated *animated,
|
Evas_Image_Animated *animated,
|
||||||
int *error);
|
int *error);
|
||||||
|
|
|
@ -295,7 +295,7 @@ _evas_image_load_file_header(void *map, size_t fsize, size_t *position, int *ima
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
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_Load_Opts *opts,
|
||||||
Evas_Image_Animated *animated EINA_UNUSED,
|
Evas_Image_Animated *animated EINA_UNUSED,
|
||||||
int *error)
|
int *error)
|
||||||
|
|
|
@ -15,7 +15,7 @@ struct _Evas_Loader_Internal
|
||||||
};
|
};
|
||||||
|
|
||||||
static void *
|
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_Load_Opts *opts EINA_UNUSED,
|
||||||
Evas_Image_Animated *animated EINA_UNUSED,
|
Evas_Image_Animated *animated EINA_UNUSED,
|
||||||
int *error)
|
int *error)
|
||||||
|
@ -43,7 +43,7 @@ evas_image_load_file_open_eet(Eina_File *f, const char *key,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
loader->key = eina_stringshare_add(key);
|
loader->key = eina_stringshare_ref(key);
|
||||||
return loader;
|
return loader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -381,7 +381,7 @@ getdata:
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
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_Load_Opts *opts,
|
||||||
Evas_Image_Animated *animated EINA_UNUSED,
|
Evas_Image_Animated *animated EINA_UNUSED,
|
||||||
int *error)
|
int *error)
|
||||||
|
@ -396,7 +396,7 @@ evas_image_load_file_open_generic(Eina_File *f, const char *key,
|
||||||
}
|
}
|
||||||
|
|
||||||
loader->f = f;
|
loader->f = f;
|
||||||
loader->key = eina_stringshare_add(key);
|
loader->key = eina_stringshare_ref(key);
|
||||||
loader->opts = opts;
|
loader->opts = opts;
|
||||||
return loader;
|
return loader;
|
||||||
}
|
}
|
||||||
|
|
|
@ -678,7 +678,7 @@ _evas_image_load_file_read(GifFileType* gft, GifByteType *buf,int length)
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
static void *
|
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_Load_Opts *opts,
|
||||||
Evas_Image_Animated *animated,
|
Evas_Image_Animated *animated,
|
||||||
int *error)
|
int *error)
|
||||||
|
|
|
@ -83,7 +83,7 @@ enum
|
||||||
};
|
};
|
||||||
|
|
||||||
static void *
|
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_Load_Opts *opts,
|
||||||
Evas_Image_Animated *animated EINA_UNUSED,
|
Evas_Image_Animated *animated EINA_UNUSED,
|
||||||
int *error)
|
int *error)
|
||||||
|
@ -98,7 +98,7 @@ evas_image_load_file_open_ico(Eina_File *f, const char *key,
|
||||||
}
|
}
|
||||||
|
|
||||||
loader->f = f;
|
loader->f = f;
|
||||||
loader->key = eina_stringshare_add(key);
|
loader->key = eina_stringshare_ref(key);
|
||||||
loader->opts = opts;
|
loader->opts = opts;
|
||||||
|
|
||||||
return loader;
|
return loader;
|
||||||
|
|
|
@ -1262,7 +1262,7 @@ evas_image_load_file_data_jpeg_alpha_internal(Image_Entry *ie, FILE *f, int *err
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void *
|
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_Load_Opts *opts,
|
||||||
Evas_Image_Animated *animated EINA_UNUSED,
|
Evas_Image_Animated *animated EINA_UNUSED,
|
||||||
int *error)
|
int *error)
|
||||||
|
|
|
@ -56,7 +56,7 @@ static size_t pmaps_buffer_raw_update(Pmaps_Buffer *b);
|
||||||
static int pmaps_buffer_comment_skip(Pmaps_Buffer *b);
|
static int pmaps_buffer_comment_skip(Pmaps_Buffer *b);
|
||||||
|
|
||||||
static void *
|
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_Load_Opts *opts EINA_UNUSED,
|
||||||
Evas_Image_Animated *animated EINA_UNUSED,
|
Evas_Image_Animated *animated EINA_UNUSED,
|
||||||
int *error EINA_UNUSED)
|
int *error EINA_UNUSED)
|
||||||
|
|
|
@ -44,7 +44,7 @@ _evas_image_png_read(png_structp png_ptr, png_bytep out, png_size_t count)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
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_Load_Opts *opts,
|
||||||
Evas_Image_Animated *animated EINA_UNUSED,
|
Evas_Image_Animated *animated EINA_UNUSED,
|
||||||
int *error)
|
int *error)
|
||||||
|
|
|
@ -147,7 +147,7 @@ is_psd(PSD_Header *header)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
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_Load_Opts *opts EINA_UNUSED,
|
||||||
Evas_Image_Animated *animated EINA_UNUSED,
|
Evas_Image_Animated *animated EINA_UNUSED,
|
||||||
int *error EINA_UNUSED)
|
int *error EINA_UNUSED)
|
||||||
|
|
|
@ -57,7 +57,7 @@ struct _tga_footer
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
static void *
|
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_Load_Opts *opts EINA_UNUSED,
|
||||||
Evas_Image_Animated *animated EINA_UNUSED,
|
Evas_Image_Animated *animated EINA_UNUSED,
|
||||||
int *error EINA_UNUSED)
|
int *error EINA_UNUSED)
|
||||||
|
|
|
@ -85,7 +85,7 @@ _evas_tiff_UnmapProc(thandle_t handle, tdata_t data, toff_t size EINA_UNUSED)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
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_Load_Opts *opts EINA_UNUSED,
|
||||||
Evas_Image_Animated *animated EINA_UNUSED,
|
Evas_Image_Animated *animated EINA_UNUSED,
|
||||||
int *error EINA_UNUSED)
|
int *error EINA_UNUSED)
|
||||||
|
|
|
@ -30,7 +30,7 @@ read_mb(unsigned int *data, void *map, size_t length, size_t *position)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
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_Load_Opts *opts EINA_UNUSED,
|
||||||
Evas_Image_Animated *animated EINA_UNUSED,
|
Evas_Image_Animated *animated EINA_UNUSED,
|
||||||
int *error EINA_UNUSED)
|
int *error EINA_UNUSED)
|
||||||
|
|
|
@ -41,7 +41,7 @@ evas_image_load_file_check(Eina_File *f, void *map,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
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_Load_Opts *opts EINA_UNUSED,
|
||||||
Evas_Image_Animated *animated EINA_UNUSED,
|
Evas_Image_Animated *animated EINA_UNUSED,
|
||||||
int *error EINA_UNUSED)
|
int *error EINA_UNUSED)
|
||||||
|
|
|
@ -649,7 +649,7 @@ evas_image_load_file_xpm(Eina_File *f, Evas_Image_Property *prop, void *pixels,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
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_Load_Opts *opts EINA_UNUSED,
|
||||||
Evas_Image_Animated *animated EINA_UNUSED,
|
Evas_Image_Animated *animated EINA_UNUSED,
|
||||||
int *error EINA_UNUSED)
|
int *error EINA_UNUSED)
|
||||||
|
|
Loading…
Reference in New Issue