Elementary calendar: Fixed warnings from -Wshadow option.

SVN revision: 59653
This commit is contained in:
Daniel Juyung Seo 2011-05-24 12:57:44 +00:00
parent a0ba6ba525
commit 1e61a1731b
1 changed files with 17 additions and 17 deletions

View File

@ -42,7 +42,7 @@ struct _Widget_Data
int year_min, year_max, spin_speed;
int today_it, selected_it, first_day_it;
Ecore_Timer *spin, *update_timer;
char * (*format_func) (struct tm *stime);
char * (*format_func) (struct tm *selected_time);
const char *weekdays[7];
struct tm current_time, selected_time;
Day_Color day_color[42]; // EINA_DEPRECATED
@ -120,12 +120,12 @@ _sizing_eval(Evas_Object *obj)
}
static inline int
_maxdays_get(struct tm *time)
_maxdays_get(struct tm *selected_time)
{
int month, year;
month = time->tm_mon;
year = time->tm_year + 1900;
month = selected_time->tm_mon;
year = selected_time->tm_year + 1900;
return _days_in_month[((!(year % 4)) &&
((!(year % 400)) ||
@ -168,10 +168,10 @@ _today(Widget_Data *wd, int it)
}
static char *
_format_month_year(struct tm *stime)
_format_month_year(struct tm *selected_time)
{
char buf[32];
if (!strftime(buf, sizeof(buf), "%B %Y", stime)) return NULL;
if (!strftime(buf, sizeof(buf), "%B %Y", selected_time)) return NULL;
return strdup(buf);
}
@ -337,21 +337,21 @@ _populate(Evas_Object *obj)
EINA_LIST_FOREACH(wd->marks, l, mark)
{
struct tm *mtime = &mark->mark_time;
int mon = wd->selected_time.tm_mon;
int month = wd->selected_time.tm_mon;
int year = wd->selected_time.tm_year;
int mday_it = mtime->tm_mday + wd->first_day_it - 1;
switch (mark->repeat)
{
case ELM_CALENDAR_UNIQUE:
if ((mtime->tm_mon == mon) && (mtime->tm_year == year))
if ((mtime->tm_mon == month) && (mtime->tm_year == year))
_cit_mark(wd->calendar, mday_it, mark->mark_type);
break;
case ELM_CALENDAR_DAILY:
if (((mtime->tm_year == year) && (mtime->tm_mon < mon)) ||
if (((mtime->tm_year == year) && (mtime->tm_mon < month)) ||
(mtime->tm_year < year))
day = 1;
else if ((mtime->tm_year == year) && (mtime->tm_mon == mon))
else if ((mtime->tm_year == year) && (mtime->tm_mon == month))
day = mtime->tm_mday;
else
break;
@ -360,10 +360,10 @@ _populate(Evas_Object *obj)
mark->mark_type);
break;
case ELM_CALENDAR_WEEKLY:
if (((mtime->tm_year == year) && (mtime->tm_mon < mon)) ||
if (((mtime->tm_year == year) && (mtime->tm_mon < month)) ||
(mtime->tm_year < year))
day = 1;
else if ((mtime->tm_year == year) && (mtime->tm_mon == mon))
else if ((mtime->tm_year == year) && (mtime->tm_mon == month))
day = mtime->tm_mday;
else
break;
@ -374,12 +374,12 @@ _populate(Evas_Object *obj)
break;
case ELM_CALENDAR_MONTHLY:
if (((mtime->tm_year < year) ||
((mtime->tm_year == year) && (mtime->tm_mon <= mon))) &&
((mtime->tm_year == year) && (mtime->tm_mon <= month))) &&
(mtime->tm_mday <= maxdays))
_cit_mark(wd->calendar, mday_it, mark->mark_type);
break;
case ELM_CALENDAR_ANNUALLY:
if ((mtime->tm_year <= year) && (mtime->tm_mon == mon) &&
if ((mtime->tm_year <= year) && (mtime->tm_mon == month) &&
(mtime->tm_mday <= maxdays))
_cit_mark(wd->calendar, mday_it, mark->mark_type);
break;
@ -1076,10 +1076,10 @@ elm_calendar_selected_time_get(const Evas_Object *obj, struct tm *selected_time)
* Example:
* @code
* static char *
* _format_month_year(struct tm *stime)
* _format_month_year(struct tm *selected_time)
* {
* char buf[32];
* if (!strftime(buf, sizeof(buf), "%B %Y", stime)) return NULL;
* if (!strftime(buf, sizeof(buf), "%B %Y", selected_time)) return NULL;
* return strdup(buf);
* }
* elm_calendar_format_function_set(calendar, _format_month_year);
@ -1092,7 +1092,7 @@ elm_calendar_selected_time_get(const Evas_Object *obj, struct tm *selected_time)
* @ingroup Calendar
*/
EAPI void
elm_calendar_format_function_set(Evas_Object *obj, char * (*format_function) (struct tm *stime))
elm_calendar_format_function_set(Evas_Object *obj, char * (*format_function) (struct tm *selected_time))
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);