diff options
author | David Robillard <d@drobilla.net> | 2007-02-18 21:12:59 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-02-18 21:12:59 +0000 |
commit | ec3e2125f960aa3de9da474d175bab353745748b (patch) | |
tree | 64d5f7e53cc47cca38bf41b6d1f69bc62dafac7f /src/stringlist.c | |
parent | f340d22e82760166d24a037d8466501217b06a3e (diff) | |
download | lilv-ec3e2125f960aa3de9da474d175bab353745748b.tar.gz lilv-ec3e2125f960aa3de9da474d175bab353745748b.tar.bz2 lilv-ec3e2125f960aa3de9da474d175bab353745748b.zip |
Fixed index types of Strings and Plugins for consistency.
git-svn-id: http://svn.drobilla.net/lad/slv2@315 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/stringlist.c')
-rw-r--r-- | src/stringlist.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/stringlist.c b/src/stringlist.c index 04f2de7..bdb173e 100644 --- a/src/stringlist.c +++ b/src/stringlist.c @@ -18,6 +18,7 @@ #include <string.h> #include <stdlib.h> +#include <limits.h> #include <raptor.h> #include <slv2/stringlist.h> @@ -29,7 +30,7 @@ slv2_strings_new() } -int +unsigned slv2_strings_size(const SLV2Strings list) { return raptor_sequence_size(list); @@ -37,16 +38,19 @@ slv2_strings_size(const SLV2Strings list) char* -slv2_strings_get_at(const SLV2Strings list, int index) +slv2_strings_get_at(const SLV2Strings list, unsigned index) { - return (char*)raptor_sequence_get_at(list, index); + if (index > INT_MAX) + return NULL; + else + return (char*)raptor_sequence_get_at(list, (int)index); } bool slv2_strings_contains(const SLV2Strings list, const char* uri) { - for (int i=0; i < slv2_strings_size(list); ++i) + for (unsigned i=0; i < slv2_strings_size(list); ++i) if (!strcmp(slv2_strings_get_at(list, i), uri)) return true; |