Merge pull request #2463 from cgwalters/fix-fanalyzer

Fix various mostly theoretical gcc `-fanalyzer` issues
This commit is contained in:
Luca Bruno authored and GitHub committed 2021-10-14 08:30:25 +00:00
commit 6b8295ada1
7 files changed
+25 -19

No files matched your search

+3 -3
View File
@@ -374,9 +374,9 @@ ostree_deployment_new (int index,
OstreeDeployment *self;
/* index may be -1 */
g_return_val_if_fail (osname != NULL, NULL);
g_return_val_if_fail (csum != NULL, NULL);
g_return_val_if_fail (deployserial >= 0, NULL);
g_assert (osname != NULL);
g_assert (csum != NULL);
g_assert (deployserial >= 0);
/* We can have "disconnected" deployments that don't have a
bootcsum/serial */
+1 -1
View File
@@ -183,7 +183,7 @@ static OstreeFetcherPendingURI *
pending_uri_ref (OstreeFetcherPendingURI *pending)
{
gint refcount;
g_return_val_if_fail (pending != NULL, NULL);
g_assert (pending);
refcount = g_atomic_int_add (&pending->ref_count, 1);
g_assert (refcount > 0);
return pending;
+2 -2
View File
@@ -65,8 +65,8 @@ ostree_remote_new_dynamic (const gchar *name,
{
OstreeRemote *remote;
g_return_val_if_fail (name != NULL && *name != '\0', NULL);
g_return_val_if_fail (refspec_name == NULL || *refspec_name != '\0', NULL);
g_assert (name != NULL && *name != '\0');
g_assert (refspec_name == NULL || *refspec_name != '\0');
remote = g_slice_new0 (OstreeRemote);
remote->ref_count = 1;
+6 -2
View File
@@ -1235,12 +1235,15 @@ ostree_sysroot_get_subbootversion (OstreeSysroot *self)
* ostree_sysroot_get_booted_deployment:
* @self: Sysroot
*
* This function may only be called if the sysroot is loaded.
*
* Returns: (transfer none) (nullable): The currently booted deployment, or %NULL if none
*/
OstreeDeployment *
ostree_sysroot_get_booted_deployment (OstreeSysroot *self)
{
g_return_val_if_fail (self->loadstate == OSTREE_SYSROOT_LOAD_STATE_LOADED, NULL);
g_assert (self);
g_assert (self->loadstate == OSTREE_SYSROOT_LOAD_STATE_LOADED);
return self->booted_deployment;
}
@@ -1390,7 +1393,8 @@ ostree_sysroot_get_repo (OstreeSysroot *self,
OstreeRepo *
ostree_sysroot_repo (OstreeSysroot *self)
{
g_return_val_if_fail (self->loadstate >= OSTREE_SYSROOT_LOAD_STATE_LOADED, NULL);
g_assert (self);
g_assert (self->loadstate >= OSTREE_SYSROOT_LOAD_STATE_LOADED);
g_assert (self->repo);
return self->repo;
}