[libadwaita/wip/exalm/null] Properly check param == NULL || GTK_IS_TYPE (param)
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita/wip/exalm/null] Properly check param == NULL || GTK_IS_TYPE (param)
- Date: Mon, 27 Sep 2021 10:49:27 +0000 (UTC)
commit 6933d3bf5faac09402bd0378a3f40674b525f2c1
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Mon Sep 27 15:49:06 2021 +0500
Properly check param == NULL || GTK_IS_TYPE (param)
Can't believe it was reversed in so many places. Avoid spurious criticals.
src/adw-avatar.c | 2 +-
src/adw-carousel-indicator-dots.c | 2 +-
src/adw-carousel-indicator-lines.c | 2 +-
src/adw-flap.c | 6 +++---
src/adw-tab-bar.c | 6 +++---
src/adw-tab-box.c | 6 +++---
src/adw-tab-view.c | 10 +++++-----
src/adw-tab.c | 2 +-
8 files changed, 18 insertions(+), 18 deletions(-)
---
diff --git a/src/adw-avatar.c b/src/adw-avatar.c
index e624c53d..9dc31f3e 100644
--- a/src/adw-avatar.c
+++ b/src/adw-avatar.c
@@ -612,7 +612,7 @@ adw_avatar_set_custom_image (AdwAvatar *self,
GdkPaintable *custom_image)
{
g_return_if_fail (ADW_IS_AVATAR (self));
- g_return_if_fail (GDK_IS_PAINTABLE (custom_image) || custom_image == NULL);
+ g_return_if_fail (custom_image == NULL || GDK_IS_PAINTABLE (custom_image));
if (gtk_image_get_paintable (self->custom_image) == custom_image)
return;
diff --git a/src/adw-carousel-indicator-dots.c b/src/adw-carousel-indicator-dots.c
index e873687b..99d1e085 100644
--- a/src/adw-carousel-indicator-dots.c
+++ b/src/adw-carousel-indicator-dots.c
@@ -418,7 +418,7 @@ adw_carousel_indicator_dots_set_carousel (AdwCarouselIndicatorDots *self,
AdwCarousel *carousel)
{
g_return_if_fail (ADW_IS_CAROUSEL_INDICATOR_DOTS (self));
- g_return_if_fail (ADW_IS_CAROUSEL (carousel) || carousel == NULL);
+ g_return_if_fail (carousel == NULL || ADW_IS_CAROUSEL (carousel));
if (self->carousel == carousel)
return;
diff --git a/src/adw-carousel-indicator-lines.c b/src/adw-carousel-indicator-lines.c
index c01309b1..5095768e 100644
--- a/src/adw-carousel-indicator-lines.c
+++ b/src/adw-carousel-indicator-lines.c
@@ -403,7 +403,7 @@ adw_carousel_indicator_lines_set_carousel (AdwCarouselIndicatorLines *self,
AdwCarousel *carousel)
{
g_return_if_fail (ADW_IS_CAROUSEL_INDICATOR_LINES (self));
- g_return_if_fail (ADW_IS_CAROUSEL (carousel) || carousel == NULL);
+ g_return_if_fail (carousel == NULL || ADW_IS_CAROUSEL (carousel));
if (self->carousel == carousel)
return;
diff --git a/src/adw-flap.c b/src/adw-flap.c
index b59f5d3c..e2c40f3f 100644
--- a/src/adw-flap.c
+++ b/src/adw-flap.c
@@ -1845,7 +1845,7 @@ adw_flap_set_content (AdwFlap *self,
GtkWidget *content)
{
g_return_if_fail (ADW_IS_FLAP (self));
- g_return_if_fail (GTK_IS_WIDGET (content) || content == NULL);
+ g_return_if_fail (content == NULL || GTK_IS_WIDGET (content));
if (self->content.widget == content)
return;
@@ -1895,7 +1895,7 @@ adw_flap_set_flap (AdwFlap *self,
GtkWidget *flap)
{
g_return_if_fail (ADW_IS_FLAP (self));
- g_return_if_fail (GTK_IS_WIDGET (flap) || flap == NULL);
+ g_return_if_fail (flap == NULL || GTK_IS_WIDGET (flap));
if (self->flap.widget == flap)
return;
@@ -1946,7 +1946,7 @@ adw_flap_set_separator (AdwFlap *self,
GtkWidget *separator)
{
g_return_if_fail (ADW_IS_FLAP (self));
- g_return_if_fail (GTK_IS_WIDGET (separator) || separator == NULL);
+ g_return_if_fail (separator == NULL || GTK_IS_WIDGET (separator));
if (self->separator.widget == separator)
return;
diff --git a/src/adw-tab-bar.c b/src/adw-tab-bar.c
index f1baaa71..6f033dee 100644
--- a/src/adw-tab-bar.c
+++ b/src/adw-tab-bar.c
@@ -730,7 +730,7 @@ adw_tab_bar_set_view (AdwTabBar *self,
AdwTabView *view)
{
g_return_if_fail (ADW_IS_TAB_BAR (self));
- g_return_if_fail (ADW_IS_TAB_VIEW (view) || view == NULL);
+ g_return_if_fail (view == NULL || ADW_IS_TAB_VIEW (view));
if (self->view == view)
return;
@@ -828,7 +828,7 @@ adw_tab_bar_set_start_action_widget (AdwTabBar *self,
GtkWidget *old_widget;
g_return_if_fail (ADW_IS_TAB_BAR (self));
- g_return_if_fail (GTK_IS_WIDGET (widget) || widget == NULL);
+ g_return_if_fail (widget == NULL || GTK_IS_WIDGET (widget));
old_widget = adw_bin_get_child (self->start_action_bin);
@@ -875,7 +875,7 @@ adw_tab_bar_set_end_action_widget (AdwTabBar *self,
GtkWidget *old_widget;
g_return_if_fail (ADW_IS_TAB_BAR (self));
- g_return_if_fail (GTK_IS_WIDGET (widget) || widget == NULL);
+ g_return_if_fail (widget == NULL || GTK_IS_WIDGET (widget));
old_widget = adw_bin_get_child (self->end_action_bin);
diff --git a/src/adw-tab-box.c b/src/adw-tab-box.c
index 607a1127..2a5d38dc 100644
--- a/src/adw-tab-box.c
+++ b/src/adw-tab-box.c
@@ -3469,7 +3469,7 @@ adw_tab_box_set_view (AdwTabBox *self,
AdwTabView *view)
{
g_return_if_fail (ADW_IS_TAB_BOX (self));
- g_return_if_fail (ADW_IS_TAB_VIEW (view) || view == NULL);
+ g_return_if_fail (view == NULL || ADW_IS_TAB_VIEW (view));
if (view == self->view)
return;
@@ -3522,7 +3522,7 @@ adw_tab_box_set_adjustment (AdwTabBox *self,
GtkAdjustment *adjustment)
{
g_return_if_fail (ADW_IS_TAB_BOX (self));
- g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment) || adjustment == NULL);
+ g_return_if_fail (adjustment == NULL || GTK_IS_ADJUSTMENT (adjustment));
if (adjustment == self->adjustment)
return;
@@ -3568,7 +3568,7 @@ adw_tab_box_select_page (AdwTabBox *self,
AdwTabPage *page)
{
g_return_if_fail (ADW_IS_TAB_BOX (self));
- g_return_if_fail (ADW_IS_TAB_PAGE (page) || page == NULL);
+ g_return_if_fail (page == NULL || ADW_IS_TAB_PAGE (page));
select_page (self, page);
}
diff --git a/src/adw-tab-view.c b/src/adw-tab-view.c
index 7df25ed5..fd781986 100644
--- a/src/adw-tab-view.c
+++ b/src/adw-tab-view.c
@@ -195,7 +195,7 @@ set_page_parent (AdwTabPage *self,
AdwTabPage *parent)
{
g_return_if_fail (ADW_IS_TAB_PAGE (self));
- g_return_if_fail (ADW_IS_TAB_PAGE (parent) || parent == NULL);
+ g_return_if_fail (parent == NULL || ADW_IS_TAB_PAGE (parent));
if (self->parent == parent)
return;
@@ -1963,7 +1963,7 @@ adw_tab_page_set_icon (AdwTabPage *self,
GIcon *icon)
{
g_return_if_fail (ADW_IS_TAB_PAGE (self));
- g_return_if_fail (G_IS_ICON (icon) || icon == NULL);
+ g_return_if_fail (icon == NULL || G_IS_ICON (icon));
if (self->icon == icon)
return;
@@ -2048,7 +2048,7 @@ adw_tab_page_set_indicator_icon (AdwTabPage *self,
GIcon *indicator_icon)
{
g_return_if_fail (ADW_IS_TAB_PAGE (self));
- g_return_if_fail (G_IS_ICON (indicator_icon) || indicator_icon == NULL);
+ g_return_if_fail (indicator_icon == NULL || G_IS_ICON (indicator_icon));
if (self->indicator_icon == indicator_icon)
return;
@@ -2501,7 +2501,7 @@ adw_tab_view_set_shortcut_widget (AdwTabView *self,
GtkWidget *widget)
{
g_return_if_fail (ADW_IS_TAB_VIEW (self));
- g_return_if_fail (GTK_IS_WIDGET (widget) || widget == NULL);
+ g_return_if_fail (widget == NULL || GTK_IS_WIDGET (widget));
if (widget == self->shortcut_widget)
return;
@@ -2724,7 +2724,7 @@ adw_tab_view_add_page (AdwTabView *self,
g_return_val_if_fail (ADW_IS_TAB_VIEW (self), NULL);
g_return_val_if_fail (GTK_IS_WIDGET (child), NULL);
- g_return_val_if_fail (ADW_IS_TAB_PAGE (parent) || parent == NULL, NULL);
+ g_return_val_if_fail (parent == NULL || ADW_IS_TAB_PAGE (parent), NULL);
if (parent) {
AdwTabPage *page;
diff --git a/src/adw-tab.c b/src/adw-tab.c
index 557c1b31..c295c3b5 100644
--- a/src/adw-tab.c
+++ b/src/adw-tab.c
@@ -873,7 +873,7 @@ adw_tab_set_page (AdwTab *self,
AdwTabPage *page)
{
g_return_if_fail (ADW_IS_TAB (self));
- g_return_if_fail (ADW_IS_TAB_PAGE (page) || page == NULL);
+ g_return_if_fail (page == NULL || ADW_IS_TAB_PAGE (page));
if (self->page == page)
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]