gplugin/gplugin

Parents 288519d5c461
Children b048978ef839
Clean up some errors found by pvs-studio and add some suppressions for stuff it thinks are errors
--- a/gplugin/gplugin-loader.c Wed Jul 24 06:14:38 2019 +0000
+++ b/gplugin/gplugin-loader.c Wed Jul 24 02:29:45 2019 -0500
@@ -103,7 +103,7 @@
if(klass && klass->load)
ret = klass->load(loader, plugin, error);
- if (!ret && error && *error == NULL) {
+ if (!ret) {
g_set_error(error, GPLUGIN_DOMAIN, 0,
"Failed to load plugin : unknown");
}
--- a/gplugin/gplugin-manager.c Wed Jul 24 06:14:38 2019 +0000
+++ b/gplugin/gplugin-manager.c Wed Jul 24 02:29:45 2019 -0500
@@ -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 Wed Jul 24 06:14:38 2019 +0000
+++ b/gplugin/tests/test-option-group.c Wed Jul 24 02:29:45 2019 -0500
@@ -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));