gplugin/gplugin

c51ad2ad784f
Merged in feature/random-bug-fixes (pull request #27)

Clean up some errors found by pvs-studio and add some suppressions for stuff it thinks are errors

Approved-by: Elliott Sales de Andrade
--- a/gplugin/gplugin-loader.c Fri Jul 26 01:19:15 2019 +0000
+++ b/gplugin/gplugin-loader.c Tue Jul 30 01:14:28 2019 +0000
@@ -96,7 +96,6 @@
g_return_val_if_fail(loader != NULL, FALSE);
g_return_val_if_fail(GPLUGIN_IS_LOADER(loader), FALSE);
g_return_val_if_fail(GPLUGIN_IS_PLUGIN(plugin), FALSE);
- g_return_val_if_fail(error != NULL, FALSE);
klass = GPLUGIN_LOADER_GET_CLASS(loader);
--- a/gplugin/gplugin-manager.c Fri Jul 26 01:19:15 2019 +0000
+++ b/gplugin/gplugin-manager.c Tue Jul 30 01:14:28 2019 +0000
@@ -435,7 +435,7 @@
/* if the plugin instance is good, then break out of this
* loop.
*/
- if(plugin != NULL && GPLUGIN_IS_PLUGIN(plugin)) {
+ if(GPLUGIN_IS_PLUGIN(plugin)) {
break;
}
@@ -448,7 +448,7 @@
* don't need to do anything but free the filename which we'll
* do later.
*/
- if(plugin != NULL && GPLUGIN_IS_PLUGIN(plugin)) {
+ if(GPLUGIN_IS_PLUGIN(plugin)) {
/* we have a good plugin, huzzah! We need to add it to our
* "view" as well as the main plugin hash table.
*/
@@ -483,7 +483,7 @@
/* Grab the list of plugins with our id and prepend the new
* plugin to it before updating it.
*/
- l = g_hash_table_lookup(manager->plugins, id);
+ l = g_hash_table_lookup(manager->plugins, id); //-V1004
for(ll = l; ll; ll = ll->next) {
GPluginPlugin *splugin = GPLUGIN_PLUGIN(ll->data);
gchar *sfilename = gplugin_plugin_get_filename(splugin);
--- a/gplugin/tests/test-option-group.c Fri Jul 26 01:19:15 2019 +0000
+++ b/gplugin/tests/test-option-group.c Tue Jul 30 01:14:28 2019 +0000
@@ -43,7 +43,7 @@
paths = gplugin_manager_get_paths();
paths = g_list_sort(paths, g_str_equal);
- expected = g_list_sort(expected, g_str_equal);
+ expected = g_list_sort(expected, g_str_equal); //-V522
g_assert_cmpuint(g_list_length(paths), ==, g_list_length(expected));