Edje: Fixed a couple of warnings that really don't indicate issues.

Global shadow warnings are annoying and thus will be ignored at the moment,
There are other issues as well though, for example, not using cpp_token_file.
I don't know if that's intended or not, so I won't just suppress the warning.

SVN revision: 67242
This commit is contained in:
Tom Hacohen 2012-01-16 12:34:13 +00:00
parent ee4f301853
commit 544dfc53b3
4 changed files with 39 additions and 28 deletions

View File

@ -44,7 +44,9 @@ main(int argc, char **argv)
int argi = 1; /* Next argument to handle. */
struct cpp_options *opts = &options;
enum cpp_token kind;
int got_text;
#if EPP_DEBUG
int got_text = 0;
#endif
p = argv[0] + strlen(argv[0]);
#ifndef __EMX__
@ -76,7 +78,6 @@ main(int argc, char **argv)
else if (!freopen(opts->out_fname, "w", stdout))
cpp_pfatal_with_name(&parse_in, opts->out_fname);
got_text = 0;
for (i = 0;; i++)
{
kind = cpp_get_token(&parse_in);
@ -108,7 +109,9 @@ main(int argc, char **argv)
case CPP_COMMA:
case CPP_SEMICOLON:
case CPP_3DOTS:
got_text = 1;
#if EPP_DEBUG
got_text = 1;
#endif
continue;
case CPP_COMMENT:
@ -130,7 +133,9 @@ main(int argc, char **argv)
exit(FATAL_EXIT_CODE);
}
parse_in.limit = parse_in.token_buffer;
got_text = 0;
#if EPP_DEBUG
got_text = 0;
#endif
}
done:

View File

@ -20,14 +20,18 @@ EAPI Eina_Error EDJE_EDIT_ERROR_GROUP_CURRENTLY_USED = 0 ;
EAPI Eina_Error EDJE_EDIT_ERROR_GROUP_REFERENCED = 0;
EAPI Eina_Error EDJE_EDIT_ERROR_GROUP_DOES_NOT_EXIST = 0;
/* Get ed(Edje*) from obj(Evas_Object*) */
#define GET_ED_OR_RETURN(RET) \
Edje *ed; \
/* Get eed(Edje_Edit*) from obj(Evas_Object*) */
#define GET_EED_OR_RETURN(RET) \
Edje_Edit *eed; \
if (!evas_object_smart_type_check_ptr(obj, _edje_edit_type)) \
return RET; \
eed = evas_object_smart_data_get(obj); \
if (!eed) return RET; \
if (!eed) return RET;
/* Get ed(Edje*) from obj(Evas_Object*) */
#define GET_ED_OR_RETURN(RET) \
Edje *ed; \
GET_EED_OR_RETURN(RET); \
ed = (Edje *)eed;
/* Get rp(Edje_Real_Part*) from obj(Evas_Object*) and part(char*) */
@ -4778,7 +4782,7 @@ edje_edit_image_id_get(Evas_Object *obj, const char *image_name)
{
eina_error_set(0);
GET_ED_OR_RETURN(-1);
GET_EED_OR_RETURN(-1);
return _edje_image_id_find(eed, image_name);
}
@ -5161,7 +5165,6 @@ EAPI Eina_Bool
edje_edit_program_add(Evas_Object *obj, const char *name)
{
Edje_Program *epr;
Edje_Part_Collection *pc;
eina_error_set(0);
@ -5178,7 +5181,7 @@ edje_edit_program_add(Evas_Object *obj, const char *name)
if (!epr) return EINA_FALSE;
//Add program to group
pc = ed->collection;
// pc = ed->collection;
/* By default, source and signal are empty, so they fill in nocmp category */
ed->collection->programs.nocmp = realloc(ed->collection->programs.nocmp,
@ -5224,7 +5227,6 @@ edje_edit_program_del(Evas_Object *obj, const char *prog)
Eina_List *l, *l_next;
Edje_Program_Target *prt;
Edje_Program_After *pa;
Edje_Part_Collection *pc;
Edje_Program *p;
Program_Script *ps, *old_ps;
int id, i;
@ -5235,7 +5237,7 @@ edje_edit_program_del(Evas_Object *obj, const char *prog)
GET_ED_OR_RETURN(EINA_FALSE);
GET_EPR_OR_RETURN(EINA_FALSE);
pc = ed->collection;
//pc = ed->collection;
//Remove program from programs list
id = epr->id;
@ -5724,7 +5726,7 @@ edje_edit_program_action_set(Evas_Object *obj, const char *prog, Edje_Action_Typ
eina_error_set(0);
GET_ED_OR_RETURN(EINA_FALSE);
GET_EED_OR_RETURN(EINA_FALSE);
GET_EPR_OR_RETURN(EINA_FALSE);
//printf("SET ACTION for program: %s [%d]\n", prog, action);
@ -6068,7 +6070,7 @@ edje_edit_script_set(Evas_Object *obj, const char *code)
{
eina_error_set(0);
GET_ED_OR_RETURN();
GET_EED_OR_RETURN();
free(eed->embryo_source);
free(eed->embryo_processed);
@ -6091,7 +6093,7 @@ edje_edit_script_program_get(Evas_Object *obj, const char *prog)
eina_error_set(0);
GET_ED_OR_RETURN(NULL);
GET_EED_OR_RETURN(NULL);
GET_EPR_OR_RETURN(NULL);
if (epr->action != EDJE_ACTION_TYPE_SCRIPT)
@ -6111,7 +6113,7 @@ edje_edit_script_program_set(Evas_Object *obj, const char *prog, const char *cod
eina_error_set(0);
GET_ED_OR_RETURN();
GET_EED_OR_RETURN();
GET_EPR_OR_RETURN();
if (epr->action != EDJE_ACTION_TYPE_SCRIPT)
@ -6537,7 +6539,7 @@ almost_out:
EAPI Eina_Bool
edje_edit_script_compile(Evas_Object *obj)
{
GET_ED_OR_RETURN(EINA_FALSE);
GET_EED_OR_RETURN(EINA_FALSE);
if (!eed->script_need_recompile)
return EINA_TRUE;
@ -6548,7 +6550,7 @@ edje_edit_script_compile(Evas_Object *obj)
EAPI const Eina_List *
edje_edit_script_error_list_get(Evas_Object *obj)
{
GET_ED_OR_RETURN(NULL);
GET_EED_OR_RETURN(NULL);
return eed->errors;
}
@ -6630,7 +6632,7 @@ _edje_generate_source_of_program(Evas_Object *obj, const char *program, Eina_Str
const char *api_name, *api_description;
Edje_Program *epr;
GET_ED_OR_RETURN(EINA_FALSE);
GET_EED_OR_RETURN(EINA_FALSE);
epr = _edje_program_get_byname(obj, program);
@ -7773,7 +7775,7 @@ edje_edit_print_internal_status(Evas_Object *obj)
*/
eina_error_set(0);
GET_ED_OR_RETURN();
GET_EED_OR_RETURN();
_edje_generate_source(obj);
/*

View File

@ -376,7 +376,7 @@ _elua_gc(lua_State *L) // Stack usage [-0, +0, e]
// nil ~
static char *
_elua_push_name(lua_State *L, char *q, int index) // Stack usage [-0, +1, e or m]
_elua_push_name(lua_State *L, char *q, int idx) // Stack usage [-0, +1, e or m]
{
char *p = q;
char temp = '\0';
@ -387,8 +387,8 @@ _elua_push_name(lua_State *L, char *q, int index) // Stack usage [-0, +1, e or
q++;
temp = *q;
*q = '\0';
if (index > 0)
lua_getfield(L, index, p); // Stack usage [-0, +1, e]
if (idx > 0)
lua_getfield(L, idx, p); // Stack usage [-0, +1, e]
else
lua_pushstring(L, p); // Stack usage [-0, +1, m]
*q = temp;

View File

@ -351,8 +351,10 @@ _edje_multisense_internal_sound_sample_play(Edje *ed, const char *sample_name, c
command.type.sample.speed = speed;
size = write(command_pipe[1], &command, sizeof(command));
#else
ed = NULL; // warning shh
if (speed > 0) sample_name = NULL; // warning shh
// warning shh
(void) ed;
(void) sample_name;
(void) speed;
#endif
return (size == sizeof(Edje_Multisense_Sound_Action));
}
@ -371,8 +373,10 @@ _edje_multisense_internal_sound_tone_play(Edje *ed, const char *tone_name, const
command.type.tone.duration = duration;
size = write(command_pipe[1], &command, sizeof(command));
#else
ed = NULL; // warning shh
if (duration > 0) tone_name = NULL; // warning shh
// warning shh
(void) ed;
(void) duration;
(void) tone_name;
#endif
return (size == sizeof(Edje_Multisense_Sound_Action));