[dia/zbrown/graphene-rect: 9/11] general: add missing annotations




commit ca445a1e1c4026dcd973f4111f5a8be40bba81c7
Author: Zander Brown <zbrown gnome org>
Date:   Tue Apr 6 21:43:05 2021 +0100

    general: add missing annotations

 app/display.c                  |  2 +-
 lib/prop_basic.c               | 91 +++++++++++++++++++++++-------------------
 objects/custom/custom_object.c |  5 +++
 plug-ins/xfig/xfig-export.c    |  1 +
 plug-ins/xfig/xfig-import.c    |  3 +-
 5 files changed, 60 insertions(+), 42 deletions(-)
---
diff --git a/app/display.c b/app/display.c
index 3a4b258fe..397cf7409 100644
--- a/app/display.c
+++ b/app/display.c
@@ -1280,7 +1280,7 @@ ddisplay_close (DDisplay *ddisp)
         /* saving succeeded */
         recent_file_history_add(ddisp->diagram->filename);
       }
-
+      G_GNUC_FALLTHROUGH;
     case DIA_EXIT_DIALOG_QUIT:
       if (close_ddisp) {
         ddisp_destroy (ddisp);
diff --git a/lib/prop_basic.c b/lib/prop_basic.c
index 951a1237f..0258b4ec1 100644
--- a/lib/prop_basic.c
+++ b/lib/prop_basic.c
@@ -326,79 +326,90 @@ static const PropertyOps noopprop_ops = {
 /* Each time its code is executed, a g_assert_not_reached() will be run... */
 /***************************************************************************/
 
-InvalidProperty *
-invalidprop_new(const PropDescription *pdesc,
-                PropDescToPropPredicate reason)
+G_GNUC_NORETURN InvalidProperty *
+invalidprop_new (const PropDescription   *pdesc,
+                 PropDescToPropPredicate  reason)
 {
-  g_assert_not_reached();
-  return NULL;
+  g_assert_not_reached ();
 }
 
-void
-invalidprop_free(InvalidProperty *prop)
+
+G_GNUC_NORETURN void
+invalidprop_free (InvalidProperty *prop)
 {
-  g_assert_not_reached();
+  g_assert_not_reached ();
 }
 
-InvalidProperty *
-invalidprop_copy(InvalidProperty *src)
+
+G_GNUC_NORETURN InvalidProperty *
+invalidprop_copy (InvalidProperty *src)
 {
-  g_assert_not_reached();
-  return NULL;
+  g_assert_not_reached ();
 }
 
-WIDGET *
-invalidprop_get_widget(InvalidProperty *prop, PropDialog *dialog)
+
+G_GNUC_NORETURN GtkWidget *
+invalidprop_get_widget (InvalidProperty *prop, PropDialog *dialog)
 {
-  g_assert_not_reached();
-  return NULL;
+  g_assert_not_reached ();
 }
 
-void
-invalidprop_reset_widget(InvalidProperty *prop, WIDGET *widget)
+
+G_GNUC_NORETURN void
+invalidprop_reset_widget (InvalidProperty *prop, GtkWidget *widget)
 {
-  g_assert_not_reached();
+  g_assert_not_reached ();
 }
 
-void
-invalidprop_set_from_widget(InvalidProperty *prop, WIDGET *widget)
+
+G_GNUC_NORETURN void
+invalidprop_set_from_widget (InvalidProperty *prop, GtkWidget *widget)
 {
-  g_assert_not_reached();
+  g_assert_not_reached ();
 }
 
-void
-invalidprop_load(InvalidProperty *prop, AttributeNode attr, DataNode data, DiaContext *ctx)
+
+G_GNUC_NORETURN void
+invalidprop_load (InvalidProperty *prop, AttributeNode attr, DataNode data, DiaContext *ctx)
 {
-  g_assert_not_reached();
+  g_assert_not_reached ();
 }
 
-void
-invalidprop_save(InvalidProperty *prop, AttributeNode attr, DiaContext *ctx)
+
+G_GNUC_NORETURN void
+invalidprop_save (InvalidProperty *prop, AttributeNode attr, DiaContext *ctx)
 {
-  g_assert_not_reached();
+  g_assert_not_reached ();
 }
 
-gboolean
-invalidprop_can_merge(const PropDescription *pd1, const PropDescription *pd2)
+
+G_GNUC_NORETURN gboolean
+invalidprop_can_merge (const PropDescription *pd1, const PropDescription *pd2)
 {
-  g_assert_not_reached();
-  return TRUE;
+  g_assert_not_reached ();
 }
 
-void
-invalidprop_get_from_offset(const InvalidProperty *prop,
-                            void *base, guint offset, guint offset2)
+
+G_GNUC_NORETURN void
+invalidprop_get_from_offset (const InvalidProperty *prop,
+                             void                  *base,
+                             guint                  offset,
+                             guint                  offset2)
 {
-  g_assert_not_reached();
+  g_assert_not_reached ();
 }
 
-void
-invalidprop_set_from_offset(InvalidProperty *prop,
-                            void *base, guint offset, guint offset2)
+
+G_GNUC_NORETURN void
+invalidprop_set_from_offset (InvalidProperty *prop,
+                             void            *base,
+                             guint            offset,
+                             guint            offset2)
 {
-  g_assert_not_reached();
+  g_assert_not_reached ();
 }
 
+
 static const PropertyOps invalidprop_ops = {
   (PropertyType_New) invalidprop_new,
   (PropertyType_Free) invalidprop_free,
diff --git a/objects/custom/custom_object.c b/objects/custom/custom_object.c
index a486c2d71..969122116 100644
--- a/objects/custom/custom_object.c
+++ b/objects/custom/custom_object.c
@@ -676,6 +676,7 @@ custom_distance_from (Custom *custom, Point *point)
               transform_coord (custom,
                                &el->path.points[i].p2,
                                &g_array_index (barr, BezPoint, i).p2);
+              G_GNUC_FALLTHROUGH;
             case BEZ_MOVE_TO:
             case BEZ_LINE_TO:
               transform_coord (custom,
@@ -702,6 +703,7 @@ custom_distance_from (Custom *custom, Point *point)
               transform_coord (custom,
                                &el->path.points[i].p2,
                                &g_array_index (barr, BezPoint, i).p2);
+              G_GNUC_FALLTHROUGH;
             case BEZ_MOVE_TO:
             case BEZ_LINE_TO:
               transform_coord (custom,
@@ -1142,6 +1144,7 @@ custom_draw_element (GraphicElement *el,
                              &g_array_index (barr, BezPoint, i).p3);
             transform_coord (custom, &el->path.points[i].p2,
                              &g_array_index (barr, BezPoint, i).p2);
+            G_GNUC_FALLTHROUGH;
           case BEZ_MOVE_TO:
           case BEZ_LINE_TO:
             transform_coord (custom, &el->path.points[i].p1,
@@ -1168,6 +1171,7 @@ custom_draw_element (GraphicElement *el,
             transform_coord (custom,
                              &el->path.points[i].p2,
                              &g_array_index (barr, BezPoint, i).p2);
+            G_GNUC_FALLTHROUGH;
           case BEZ_MOVE_TO:
           case BEZ_LINE_TO:
             transform_coord (custom,
@@ -1556,6 +1560,7 @@ custom_update_data (Custom *custom, AnchorShape horiz, AnchorShape vert)
                              &g_array_index (barr, BezPoint, i).p3);
             transform_coord (custom, &el->path.points[i].p2,
                              &g_array_index (barr, BezPoint, i).p2);
+            G_GNUC_FALLTHROUGH;
           case BEZ_MOVE_TO:
           case BEZ_LINE_TO:
             transform_coord (custom, &el->path.points[i].p1,
diff --git a/plug-ins/xfig/xfig-export.c b/plug-ins/xfig/xfig-export.c
index eaab91836..77553019c 100644
--- a/plug-ins/xfig/xfig-export.c
+++ b/plug-ins/xfig/xfig-export.c
@@ -558,6 +558,7 @@ figArrow(XfigRenderer *renderer, Arrow *arrow, real line_width)
       message_warning(_("Fig format has no equivalent of arrow style %s; using simple arrow.\n"),
           arrow_get_name_from_type(arrow->type));
       /* Notice fallthrough */
+      G_GNUC_FALLTHROUGH;
     case ARROW_FILLED_CONCAVE:
       type = 2; style = 1; break;
     case ARROW_BLANKED_CONCAVE:
diff --git a/plug-ins/xfig/xfig-import.c b/plug-ins/xfig/xfig-import.c
index 75af448e7..e8de6b1ea 100644
--- a/plug-ins/xfig/xfig-import.c
+++ b/plug-ins/xfig/xfig-import.c
@@ -549,7 +549,8 @@ fig_read_polyline(FILE *file, DiaContext *ctx)
        }
        g_ptr_array_add(props,rprop);
     }
-       /* Notice fallthrough */
+      /* Notice fallthrough */
+      G_GNUC_FALLTHROUGH;
     case 2: /* box */
        if (points[0].x > points[2].x) {
            real tmp = points[0].x;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]