summaryrefslogtreecommitdiff
path: root/src/modules/prefs
diff options
context:
space:
mode:
authorMike McCormack <mikem@atratus.org>2012-12-01 01:12:18 +0000
committerMike McCormack <mikem@ring3k.org>2012-12-01 01:12:18 +0000
commit8a339fa8ac8a233864cf47c24b770e5a3f8e2c88 (patch)
tree2975d6217428e26cbbee51e5c522555719340bba /src/modules/prefs
parente2875caa3a3349f4af593162ba49c14eb829ee4d (diff)
elementary: Fix shadow and initializer warnings
Signed-off-by: Mike McCormack <mikem@atratus.org> SVN revision: 79956
Diffstat (limited to 'src/modules/prefs')
-rw-r--r--src/modules/prefs/elm_datetime.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/modules/prefs/elm_datetime.c b/src/modules/prefs/elm_datetime.c
index f9681ec2d..75f06091a 100644
--- a/src/modules/prefs/elm_datetime.c
+++ b/src/modules/prefs/elm_datetime.c
@@ -24,7 +24,9 @@ elm_prefs_datetime_add(const Elm_Prefs_Item_Iface *iface __UNUSED__,
24 Elm_Prefs_Item_Changed_Cb cb) 24 Elm_Prefs_Item_Changed_Cb cb)
25{ 25{
26 Evas_Object *obj = elm_datetime_add(prefs); 26 Evas_Object *obj = elm_datetime_add(prefs);
27 struct tm time = {0}; 27 struct tm t;
28
29 memset(&t, 0, sizeof t);
28 30
29 elm_datetime_field_visible_set(obj, ELM_DATETIME_HOUR, EINA_FALSE); 31 elm_datetime_field_visible_set(obj, ELM_DATETIME_HOUR, EINA_FALSE);
30 elm_datetime_field_visible_set(obj, ELM_DATETIME_MINUTE, EINA_FALSE); 32 elm_datetime_field_visible_set(obj, ELM_DATETIME_MINUTE, EINA_FALSE);
@@ -32,17 +34,17 @@ elm_prefs_datetime_add(const Elm_Prefs_Item_Iface *iface __UNUSED__,
32 34
33 evas_object_smart_callback_add(obj, "changed", _item_changed_cb, cb); 35 evas_object_smart_callback_add(obj, "changed", _item_changed_cb, cb);
34 36
35 time.tm_year = spec.d.min.y - 1900; 37 t.tm_year = spec.d.min.y - 1900;
36 time.tm_mon = spec.d.min.m - 1; 38 t.tm_mon = spec.d.min.m - 1;
37 time.tm_mday = spec.d.min.d; 39 t.tm_mday = spec.d.min.d;
38 40
39 elm_datetime_value_min_set(obj, &time); 41 elm_datetime_value_min_set(obj, &t);
40 42
41 time.tm_year = spec.d.max.y - 1900; 43 t.tm_year = spec.d.max.y - 1900;
42 time.tm_mon = spec.d.max.m - 1; 44 t.tm_mon = spec.d.max.m - 1;
43 time.tm_mday = spec.d.max.d; 45 t.tm_mday = spec.d.max.d;
44 46
45 elm_datetime_value_max_set(obj, &time); 47 elm_datetime_value_max_set(obj, &t);
46 48
47 return obj; 49 return obj;
48} 50}
@@ -52,16 +54,16 @@ elm_prefs_datetime_value_set(Evas_Object *obj,
52 Eina_Value *value) 54 Eina_Value *value)
53{ 55{
54 struct timeval val; 56 struct timeval val;
55 struct tm *time; 57 struct tm *t;
56 58
57 if (eina_value_type_get(value) != EINA_VALUE_TYPE_TIMEVAL) 59 if (eina_value_type_get(value) != EINA_VALUE_TYPE_TIMEVAL)
58 return EINA_FALSE; 60 return EINA_FALSE;
59 61
60 eina_value_get(value, &val); 62 eina_value_get(value, &val);
61 63
62 time = gmtime(&(val.tv_sec)); 64 t = gmtime(&(val.tv_sec));
63 65
64 if (elm_datetime_value_set(obj, time)) return EINA_TRUE; 66 if (elm_datetime_value_set(obj, t)) return EINA_TRUE;
65 67
66 return EINA_FALSE; 68 return EINA_FALSE;
67} 69}
@@ -70,12 +72,14 @@ static Eina_Bool
70elm_prefs_datetime_value_get(Evas_Object *obj, 72elm_prefs_datetime_value_get(Evas_Object *obj,
71 Eina_Value *value) 73 Eina_Value *value)
72{ 74{
73 struct timeval val = {0}; 75 struct timeval val;
74 struct tm time; 76 struct tm t;
77
78 memset(&val, 0, sizeof val);
75 79
76 if (!elm_datetime_value_get(obj, &time)) return EINA_FALSE; 80 if (!elm_datetime_value_get(obj, &t)) return EINA_FALSE;
77 81
78 val.tv_sec = mktime(&time); 82 val.tv_sec = mktime(&t);
79 83
80 if (!eina_value_setup(value, EINA_VALUE_TYPE_TIMEVAL)) return EINA_FALSE; 84 if (!eina_value_setup(value, EINA_VALUE_TYPE_TIMEVAL)) return EINA_FALSE;
81 if (!eina_value_set(value, val)) return EINA_FALSE; 85 if (!eina_value_set(value, val)) return EINA_FALSE;