Fix many warnings.

Make the font face const char * and use eina_stringshare
This commit is contained in:
Andy Williams 2015-05-31 21:18:18 +01:00
parent 78252cefc1
commit 4d466dbc74
7 changed files with 16 additions and 15 deletions

View File

@ -1,4 +1,4 @@
EFL_VERSION([0], [1], [dev]) EFL_VERSION([0], [0], [9])
AC_INIT([edi], [efl_version], [enlightenment-devel@lists.sourceforge.net]) AC_INIT([edi], [efl_version], [enlightenment-devel@lists.sourceforge.net])
AC_PREREQ([2.65]) AC_PREREQ([2.65])

View File

@ -121,7 +121,7 @@ elm_code_diff_widget_add(Evas_Object *parent, Elm_Code *code)
} }
EAPI void EAPI void
elm_code_diff_widget_font_set(Evas_Object *widget, char *name, int size) elm_code_diff_widget_font_set(Evas_Object *widget, const char *name, int size)
{ {
Elm_Code_Widget *child; Elm_Code_Widget *child;

View File

@ -23,7 +23,8 @@ extern "C" {
EAPI Evas_Object *elm_code_diff_widget_add(Evas_Object *parent, Elm_Code *code); EAPI Evas_Object *elm_code_diff_widget_add(Evas_Object *parent, Elm_Code *code);
EAPI void elm_code_diff_widget_font_set(Evas_Object *widget, char *name, int size); EAPI void elm_code_diff_widget_font_set(Evas_Object *widget, const char *name,
int size);
/** /**
* @} * @}

View File

@ -1285,23 +1285,23 @@ _elm_code_widget_lines_visible_get(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd
} }
EOLIAN static void EOLIAN static void
_elm_code_widget_font_set(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd, char *name, _elm_code_widget_font_set(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd,
Evas_Font_Size size) const char *name, Evas_Font_Size size)
{ {
char *face = name; const char *face = name;
if (!face) if (!face)
face = "Mono"; face = "Mono";
evas_object_textgrid_font_set(pd->grid, face, size * elm_config_scale_get()); evas_object_textgrid_font_set(pd->grid, face, size * elm_config_scale_get());
if (pd->font_name) if (pd->font_name)
free((char *)pd->font_name); eina_stringshare_del((char *)pd->font_name);
pd->font_name = strdup(face); pd->font_name = eina_stringshare_add(face);
pd->font_size = size; pd->font_size = size;
} }
EOLIAN static void EOLIAN static void
_elm_code_widget_font_get(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd, char **name, _elm_code_widget_font_get(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd,
Evas_Font_Size *size) const char **name, Evas_Font_Size *size)
{ {
if (name) if (name)
*name = strdup((const char *)pd->font_name); *name = strdup((const char *)pd->font_name);

View File

@ -37,7 +37,7 @@ class Elm_Code_Widget (Elm.Layout, Elm_Interface_Atspi_Text)
@ingroup Style */ @ingroup Style */
} }
values { values {
name: char *; /*@ The name of the font to load */ name: const(char) *; /*@ The name of the font to load */
size: Evas_Font_Size; /*@ The font size for the widget */ size: Evas_Font_Size; /*@ The font size for the widget */
} }
} }

View File

@ -52,8 +52,8 @@ struct _Edi_Project_Config_Tab
struct _Edi_Project_Config_Launch struct _Edi_Project_Config_Launch
{ {
char *path; const char *path;
char *args; const char *args;
}; };
struct _Edi_Project_Config struct _Edi_Project_Config
@ -62,7 +62,7 @@ struct _Edi_Project_Config
struct struct
{ {
char *name; const char *name;
int size; int size;
} font; } font;

View File

@ -152,7 +152,7 @@ _cb_op_font_sel(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSE
} }
static void static void
_cb_op_fontsize_sel(void *data, Evas_Object *obj, void *event EINA_UNUSED) _cb_op_fontsize_sel(void *data EINA_UNUSED, Evas_Object *obj, void *event EINA_UNUSED)
{ {
int size = elm_slider_value_get(obj) + 0.5; int size = elm_slider_value_get(obj) + 0.5;