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_PREREQ([2.65])

View File

@ -121,7 +121,7 @@ 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)
elm_code_diff_widget_font_set(Evas_Object *widget, const char *name, int size)
{
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 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
_elm_code_widget_font_set(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd, char *name,
Evas_Font_Size size)
_elm_code_widget_font_set(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd,
const char *name, Evas_Font_Size size)
{
char *face = name;
const char *face = name;
if (!face)
face = "Mono";
evas_object_textgrid_font_set(pd->grid, face, size * elm_config_scale_get());
if (pd->font_name)
free((char *)pd->font_name);
pd->font_name = strdup(face);
eina_stringshare_del((char *)pd->font_name);
pd->font_name = eina_stringshare_add(face);
pd->font_size = size;
}
EOLIAN static void
_elm_code_widget_font_get(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd, char **name,
Evas_Font_Size *size)
_elm_code_widget_font_get(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd,
const char **name, Evas_Font_Size *size)
{
if (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 */
}
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 */
}
}

View File

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

View File

@ -152,7 +152,7 @@ _cb_op_font_sel(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSE
}
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;