summaryrefslogtreecommitdiff
path: root/lib/sqfs
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-11-28 16:11:22 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-11-28 16:11:22 +0100
commit7f53d2785816e5b65dfdb0daa4039249569e58f9 (patch)
treeb8d44ef940d87ccc110501cbe66c5a5a3cbedbfb /lib/sqfs
parent9e91c1558c40eaabd38f8f422555d6d8831e527f (diff)
Cleanup: Return combined return value from compressor id by name
Instead of returning the ID through a pointer and an error code as return status, return a single int that could be a compressor ID (positive values) or an error code (negative values). Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs')
-rw-r--r--lib/sqfs/comp/compressor.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/sqfs/comp/compressor.c b/lib/sqfs/comp/compressor.c
index 0b8b5e9..8049ade 100644
--- a/lib/sqfs/comp/compressor.c
+++ b/lib/sqfs/comp/compressor.c
@@ -130,15 +130,13 @@ const char *sqfs_compressor_name_from_id(E_SQFS_COMPRESSOR id)
return names[id];
}
-int sqfs_compressor_id_from_name(const char *name, E_SQFS_COMPRESSOR *out)
+int sqfs_compressor_id_from_name(const char *name)
{
size_t i;
for (i = 0; i < sizeof(names) / sizeof(names[0]); ++i) {
- if (names[i] != NULL && strcmp(names[i], name) == 0) {
- *out = i;
- return 0;
- }
+ if (names[i] != NULL && strcmp(names[i], name) == 0)
+ return i;
}
return SQFS_ERROR_UNSUPPORTED;