summaryrefslogtreecommitdiff
path: root/src/lib/eeze
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2013-04-18 17:35:37 +0100
committerStefan Schmidt <s.schmidt@samsung.com>2013-04-19 09:21:12 +0100
commit27a711b83cd8a8f56c6f4c103087523da374299b (patch)
tree479419c0a51b89d856f605535ab6c07d1f31675a /src/lib/eeze
parentd601c15302277010725d2cdd34fa40eaf5be801d (diff)
eeze/sensor: Simplify sensor object handling.
We rely on the app to provide a sensible object pointer and we now longer need to have a copy of the object around to operate on it. Simplifies code, maintenance and reduces mem copies. Win-Win :)
Diffstat (limited to 'src/lib/eeze')
-rw-r--r--src/lib/eeze/eeze_sensor.c6
-rw-r--r--src/lib/eeze/eeze_sensor_private.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/eeze/eeze_sensor.c b/src/lib/eeze/eeze_sensor.c
index 40861427be..da12a1226e 100644
--- a/src/lib/eeze/eeze_sensor.c
+++ b/src/lib/eeze/eeze_sensor.c
@@ -153,7 +153,7 @@ eeze_sensor_module_unregister(const char *name)
153 153
154 module = eina_hash_find(g_handle->modules, name); 154 module = eina_hash_find(g_handle->modules, name);
155 if (!module) return EINA_FALSE; 155 if (!module) return EINA_FALSE;
156 156
157 if (module->shutdown) 157 if (module->shutdown)
158 module->shutdown(); 158 module->shutdown();
159 159
@@ -196,7 +196,7 @@ eeze_sensor_new(Eeze_Sensor_Type type)
196 * the downside that the sensor creation takes longer. But that is only a 196 * the downside that the sensor creation takes longer. But that is only a
197 *initial cost. 197 *initial cost.
198 */ 198 */
199 if (module->read(sens->type, sens)) 199 if (module->read(sens))
200 return sens; 200 return sens;
201 201
202 free(sens); 202 free(sens);
@@ -277,7 +277,7 @@ eeze_sensor_read(Eeze_Sensor_Obj *sens)
277 if (!module) return EINA_FALSE; 277 if (!module) return EINA_FALSE;
278 278
279 if (module->read) 279 if (module->read)
280 return module->read(sens->type, sens); 280 return module->read(sens);
281 281
282 return EINA_FALSE; 282 return EINA_FALSE;
283} 283}
diff --git a/src/lib/eeze/eeze_sensor_private.h b/src/lib/eeze/eeze_sensor_private.h
index d8f0a28d37..3ba6198d8e 100644
--- a/src/lib/eeze/eeze_sensor_private.h
+++ b/src/lib/eeze/eeze_sensor_private.h
@@ -57,7 +57,7 @@ typedef struct _Eeze_Sensor_Module
57 Eina_Bool (*init)(void); /**< Pointer to module init function */ 57 Eina_Bool (*init)(void); /**< Pointer to module init function */
58 Eina_Bool (*shutdown)(void); /**< Pointer to module shutdown function */ 58 Eina_Bool (*shutdown)(void); /**< Pointer to module shutdown function */
59 Eina_Bool (*async_read)(Eeze_Sensor_Type sensor_type, void *user_data); /**< Pointer to module async_read function */ 59 Eina_Bool (*async_read)(Eeze_Sensor_Type sensor_type, void *user_data); /**< Pointer to module async_read function */
60 Eina_Bool (*read)(Eeze_Sensor_Type sensor_type, Eeze_Sensor_Obj *obj); /**< Pointer to module read function */ 60 Eina_Bool (*read)(Eeze_Sensor_Obj *obj); /**< Pointer to module read function */
61 Eina_List *sensor_list; /**< List of sensor objects attached to the module */ 61 Eina_List *sensor_list; /**< List of sensor objects attached to the module */
62} Eeze_Sensor_Module; 62} Eeze_Sensor_Module;
63 63