From f9218423b90a8effafba323abb088cebba34fb25 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 6 Nov 2009 19:50:47 +0100 Subject: utils: renamed stringFoundInStringArray() No CamelCase. Use bool instead of int. Make both arguments mandatory. --- src/playlist_list.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/playlist_list.c') diff --git a/src/playlist_list.c b/src/playlist_list.c index b5df72ed8..2c6237ed4 100644 --- a/src/playlist_list.c +++ b/src/playlist_list.c @@ -119,8 +119,8 @@ playlist_list_open_uri(const char *uri) for (unsigned i = 0; playlist_plugins[i] != NULL; ++i) { const struct playlist_plugin *plugin = playlist_plugins[i]; - if (playlist_plugins_enabled[i] && - stringFoundInStringArray(plugin->schemes, scheme)) { + if (playlist_plugins_enabled[i] && plugin->schemes != NULL && + string_array_contains(plugin->schemes, scheme)) { playlist = playlist_plugin_open_uri(plugin, uri); if (playlist != NULL) break; @@ -143,7 +143,8 @@ playlist_list_open_stream_mime(struct input_stream *is) const struct playlist_plugin *plugin = playlist_plugins[i]; if (playlist_plugins_enabled[i] && - stringFoundInStringArray(plugin->mime_types, is->mime)) { + plugin->mime_types != NULL && + string_array_contains(plugin->mime_types, is->mime)) { /* rewind the stream, so each plugin gets a fresh start */ input_stream_seek(is, 0, SEEK_SET); @@ -168,8 +169,8 @@ playlist_list_open_stream_suffix(struct input_stream *is, const char *suffix) for (unsigned i = 0; playlist_plugins[i] != NULL; ++i) { const struct playlist_plugin *plugin = playlist_plugins[i]; - if (playlist_plugins_enabled[i] && - stringFoundInStringArray(plugin->suffixes, suffix)) { + if (playlist_plugins_enabled[i] && plugin->suffixes != NULL && + string_array_contains(plugin->suffixes, suffix)) { /* rewind the stream, so each plugin gets a fresh start */ input_stream_seek(is, 0, SEEK_SET); @@ -213,8 +214,8 @@ playlist_suffix_supported(const char *suffix) for (unsigned i = 0; playlist_plugins[i] != NULL; ++i) { const struct playlist_plugin *plugin = playlist_plugins[i]; - if (playlist_plugins_enabled[i] && - stringFoundInStringArray(plugin->suffixes, suffix)) + if (playlist_plugins_enabled[i] && plugin->suffixes != NULL && + string_array_contains(plugin->suffixes, suffix)) return true; } -- cgit v1.2.3