projects
/
platform
/
upstream
/
libusbg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7e30d9d
)
libusbgx: Return suitable error codes instead of -1
author
Krzysztof Opasiak
<k.opasiak@samsung.com>
Mon, 22 Sep 2014 10:30:03 +0000
(12:30 +0200)
committer
Krzysztof Opasiak
<k.opasiak@samsung.com>
Tue, 22 Dec 2015 20:05:42 +0000
(21:05 +0100)
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
src/usbg.c
patch
|
blob
|
history
diff --git
a/src/usbg.c
b/src/usbg.c
index
cd2179e
..
4d74a0d
100644
(file)
--- a/
src/usbg.c
+++ b/
src/usbg.c
@@
-316,18
+316,15
@@
static int usbg_lookup_function_type(const char *name)
int max = sizeof(function_names)/sizeof(char *);
if (!name)
- return
-1
;
+ return
USBG_ERROR_INVALID_PARAM
;
do {
if (!strcmp(name, function_names[i]))
-
break
;
+
return i
;
i++;
} while (i != max);
- if (i == max)
- i = -1;
-
- return i;
+ return USBG_ERROR_NOT_FOUND;
}
const const char *usbg_get_function_type_str(usbg_function_type type)