Set the minimum value of tracker_type_e 27/150727/1 accepted/tizen_4.0_unified tizen_4.0 tizen_4.0_tv accepted/tizen/4.0/unified/20170920.081711 submit/tizen_4.0/20170918.101140 tizen_4.0.IoT.p1_release tizen_4.0.IoT.p2_release tizen_4.0.m2_release
authorKichan Kwon <k_c.kwon@samsung.com>
Mon, 18 Sep 2017 10:01:57 +0000 (19:01 +0900)
committerKichan Kwon <k_c.kwon@samsung.com>
Mon, 18 Sep 2017 10:01:57 +0000 (19:01 +0900)
Change-Id: I9ee780ff0f5297922b5469cb78804df1ff38942f
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
include/tracker.h
src/tracker.c

index ff0c41e..9478ee1 100644 (file)
@@ -53,6 +53,7 @@ typedef enum {
 } tracker_service_e;
 
 typedef enum {
+       TRACKER_TYPE_INVALID = -1,
        TRACKER_TYPE_POWER_LOCK = 0,
        TRACKER_TYPE_MAX
 } tracker_type_e;
index 4b34711..8f55549 100644 (file)
@@ -24,7 +24,7 @@ API int tracker_get_ref_counter(tracker_type_e type, int *cnt)
 {
        int ref;
 
-       if (type < 0 || type >= TRACKER_TYPE_MAX || !trackers[type]) {
+       if (type <= TRACKER_TYPE_INVALID || type >= TRACKER_TYPE_MAX || !trackers[type]) {
                _E("Try to access not existed tracker %d", type);
                return TRACKER_ERROR_INVALID_PARAMETER;
        }
@@ -43,7 +43,7 @@ API int tracker_get_tick(tracker_type_e type, int *cnt)
 {
        int count;
 
-       if (type < 0 || type >= TRACKER_TYPE_MAX || !trackers[type]) {
+       if (type <= TRACKER_TYPE_INVALID || type >= TRACKER_TYPE_MAX || !trackers[type]) {
                _E("Try to access not existed tracker %d", type);
                return TRACKER_ERROR_INVALID_PARAMETER;
        }