[gnumeric] Introspection fixes.



commit bebaa4fbeb9bbeb5cc548fdf786a7281adbf13da
Author: Morten Welinder <terra gnome org>
Date:   Sat Aug 8 21:28:01 2020 -0400

    Introspection fixes.
    
    This changes tactics and uses "(type void)" to keep introspection's
    little fingers away from return values it does not understand.
    
    This fixes all the range initialization functions.

 ChangeLog        |  5 +++++
 src/position.c   | 24 ++++++++++++------------
 src/print-info.c | 13 ++++---------
 src/print-info.h |  2 +-
 src/ranges.c     | 38 ++++++++++----------------------------
 src/ranges.h     |  2 --
 6 files changed, 32 insertions(+), 52 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c923c94b16..f09f95b194 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2020-08-08  Morten Welinder  <terra gnome org>
+
+       * src/print-info.c (gnm_print_info_load_defaults): Don't return a
+       value.
+
 2020-07-16  Morten Welinder  <terra gnome org>
 
        * src/gui-util.c (gnm_dialog_setup_destroy_handlers): Fix
diff --git a/src/position.c b/src/position.c
index 81490ec76b..3889887dda 100644
--- a/src/position.c
+++ b/src/position.c
@@ -82,7 +82,7 @@ gnm_eval_pos_get_type (void)
  * @col: column.
  * @row: row
  *
- * Returns: (skip) (transfer none): the initialized #GnmEvalPos (@ep).
+ * Returns: (type void): the initialized #GnmEvalPos (@ep).
  **/
 GnmEvalPos *
 eval_pos_init (GnmEvalPos *ep, Sheet *sheet, int col, int row)
@@ -105,7 +105,7 @@ eval_pos_init (GnmEvalPos *ep, Sheet *sheet, int col, int row)
  * @s: #Sheet
  * @pos: #GnmCellPos
  *
- * Returns: (skip) (transfer none): the initialized #GnmEvalPos (@ep).
+ * Returns: (type void): the initialized #GnmEvalPos (@ep).
  **/
 GnmEvalPos *
 eval_pos_init_pos (GnmEvalPos *ep, Sheet *sheet, GnmCellPos const *pos)
@@ -127,7 +127,7 @@ eval_pos_init_pos (GnmEvalPos *ep, Sheet *sheet, GnmCellPos const *pos)
  * @ep: The position to init.
  * @dep:
  *
- * Returns: (skip) (transfer none): the initialized #GnmEvalPos (@ep).
+ * Returns: (type void): the initialized #GnmEvalPos (@ep).
  **/
 GnmEvalPos *
 eval_pos_init_dep (GnmEvalPos *ep, GnmDependent const *dep)
@@ -150,7 +150,7 @@ eval_pos_init_dep (GnmEvalPos *ep, GnmDependent const *dep)
  *
  * The function initializes an evalpos with the edit position from the
  * given sheetview.
- * Returns: (skip) (transfer none): the initialized #GnmEvalPos (@ep).
+ * Returns: (type void): the initialized #GnmEvalPos (@ep).
  **/
 GnmEvalPos *
 eval_pos_init_editpos (GnmEvalPos *ep, SheetView const *sv)
@@ -169,7 +169,7 @@ eval_pos_init_editpos (GnmEvalPos *ep, SheetView const *sv)
  *
  * The function initializes an evalpos with the given cell
  *
- * Returns: (skip) (transfer none): the initialized #GnmEvalPos (@ep).
+ * Returns: (type void): the initialized #GnmEvalPos (@ep).
  */
 GnmEvalPos *
 eval_pos_init_cell (GnmEvalPos *ep, GnmCell const *cell)
@@ -192,7 +192,7 @@ eval_pos_init_cell (GnmEvalPos *ep, GnmCell const *cell)
  *
  * The function initializes an evalpos with the given sheet.
  *
- * Returns: (skip) (transfer none): the initialized #GnmEvalPos (@ep).
+ * Returns: (type void): the initialized #GnmEvalPos (@ep).
  */
 GnmEvalPos *
 eval_pos_init_sheet (GnmEvalPos *ep, Sheet const *sheet)
@@ -244,7 +244,7 @@ gnm_parse_pos_get_type (void)
  *
  * Use either a sheet (preferred) or a workbook to initialize the supplied
  * ParsePosition.
- * Returns: (skip) (transfer none): the initialized #GnmParsePos (@pp).
+ * Returns: (type void): the initialized #GnmParsePos (@pp).
  */
 GnmParsePos *
 parse_pos_init (GnmParsePos *pp, Workbook *wb, Sheet const *sheet,
@@ -269,7 +269,7 @@ parse_pos_init (GnmParsePos *pp, Workbook *wb, Sheet const *sheet,
  * @pp: The position to init.
  * @dep: The dependent
  *
- * Returns: (skip) (transfer none): the initialized #GnmParsePos (@pp).
+ * Returns: (type void): the initialized #GnmParsePos (@pp).
  */
 GnmParsePos *
 parse_pos_init_dep (GnmParsePos *pp, GnmDependent const *dep)
@@ -288,7 +288,7 @@ parse_pos_init_dep (GnmParsePos *pp, GnmDependent const *dep)
  * @pp: The position to init.
  * @cell: The cell
  *
- * Returns: (skip) (transfer none): the initialized #GnmParsePos (@pp).
+ * Returns: (type void): the initialized #GnmParsePos (@pp).
  */
 GnmParsePos *
 parse_pos_init_cell (GnmParsePos *pp, GnmCell const *cell)
@@ -306,7 +306,7 @@ parse_pos_init_cell (GnmParsePos *pp, GnmCell const *cell)
  * @pp: The position to init.
  * @pos: #GnmEvalPos
  *
- * Returns: (skip) (transfer none): the initialized #GnmParsePos (@pp).
+ * Returns: (type void): the initialized #GnmParsePos (@pp).
  */
 GnmParsePos *
 parse_pos_init_evalpos (GnmParsePos *pp, GnmEvalPos const *ep)
@@ -321,7 +321,7 @@ parse_pos_init_evalpos (GnmParsePos *pp, GnmEvalPos const *ep)
  * @pp: The position to init.
  * @sv: sheet view
  *
- * Returns: (skip) (transfer none): the initialized #GnmParsePos (@pp).
+ * Returns: (type void): the initialized #GnmParsePos (@pp).
  */
 GnmParsePos *
 parse_pos_init_editpos (GnmParsePos *pp, SheetView const *sv)
@@ -337,7 +337,7 @@ parse_pos_init_editpos (GnmParsePos *pp, SheetView const *sv)
  * @pp: The position to init.
  * @sheet: The sheet
  *
- * Returns: (skip) (transfer none): the initialized #GnmParsePos (@pp).
+ * Returns: (type void): the initialized #GnmParsePos (@pp).
  */
 GnmParsePos *
 parse_pos_init_sheet (GnmParsePos *pp, Sheet const *sheet)
diff --git a/src/print-info.c b/src/print-info.c
index 8e322956a5..b7fba00818 100644
--- a/src/print-info.c
+++ b/src/print-info.c
@@ -294,20 +294,18 @@ load_formats (void)
  * gnm_print_info_load_defaults:
  * @pi: #GnmPrintInformation
  *
- * Returns: (skip) (transfer none): @pi
- *
  * NOTE: This reads from a globally stored configuration. If a
  *       configuration is stored along with a sheet then that will
  *       override these global defaults.
  */
-GnmPrintInformation *
+void
 gnm_print_info_load_defaults (GnmPrintInformation *res)
 {
        GSList *list;
        GtkPrintSettings *settings;
 
        if (res->page_setup != NULL)
-               return res;
+               return;
 
        res->page_setup = gnm_conf_get_page_setup ();
 
@@ -353,8 +351,6 @@ gnm_print_info_load_defaults (GnmPrintInformation *res)
        settings = gnm_conf_get_print_settings ();
        print_info_set_from_settings (res, settings);
        g_object_unref (settings);
-
-       return res;
 }
 
 /**
@@ -384,9 +380,8 @@ gnm_print_information_new (gboolean load_defaults)
        res->print_range = GNM_PRINT_ACTIVE_SHEET;
 
        if (load_defaults)
-               return gnm_print_info_load_defaults (res);
-       else
-               return res;
+               gnm_print_info_load_defaults (res);
+       return res;
 }
 
 /*
diff --git a/src/print-info.h b/src/print-info.h
index 8ba440b0bb..e6599a7e7e 100644
--- a/src/print-info.h
+++ b/src/print-info.h
@@ -128,7 +128,7 @@ typedef struct {
 
 GType             gnm_print_information_get_type (void);
 GnmPrintInformation *gnm_print_information_new         (gboolean load_defaults);
-GnmPrintInformation *gnm_print_info_load_defaults (GnmPrintInformation *pi);
+void              gnm_print_info_load_defaults (GnmPrintInformation *pi);
 GnmPrintInformation *gnm_print_info_dup         (GnmPrintInformation const *pi);
 void              gnm_print_info_free        (GnmPrintInformation *pi);
 void              gnm_print_info_save        (GnmPrintInformation *pi);
diff --git a/src/ranges.c b/src/ranges.c
index 98aba20753..a4e786ccdb 100644
--- a/src/ranges.c
+++ b/src/ranges.c
@@ -40,7 +40,7 @@
  *
  * Updates @r to fill @sheet in its entirety.
  *
- * Returns: (skip) (transfer none): @r
+ * Returns: (type void): @r
  */
 GnmRange *
 range_init_full_sheet (GnmRange *r, Sheet const *sheet)
@@ -61,7 +61,7 @@ range_init_full_sheet (GnmRange *r, Sheet const *sheet)
  *
  * Updates @r to span full columns @start_col through @end_col completely.
  *
- * Returns: (skip) (transfer none): @r
+ * Returns: (type void): @r
  */
 GnmRange *
 range_init_cols (GnmRange *r, Sheet const *sheet, int start_col, int end_col)
@@ -82,7 +82,7 @@ range_init_cols (GnmRange *r, Sheet const *sheet, int start_col, int end_col)
  *
  * Updates @r to span full rows @start_row through @end_row completely.
  *
- * Returns: (skip) (transfer none): @r
+ * Returns: (type void): @r
  */
 GnmRange *
 range_init_rows (GnmRange *r, Sheet const *sheet, int start_row, int end_row)
@@ -100,7 +100,7 @@ range_init_rows (GnmRange *r, Sheet const *sheet, int start_row, int end_row)
  *
  * Updates @r to a meaningless range
  *
- * Returns: (skip) (transfer none): @r
+ * Returns: (type void): @r
  */
 GnmRange *
 range_init_invalid (GnmRange *r)
@@ -119,7 +119,7 @@ range_init_invalid (GnmRange *r)
  *
  * Updates @r to be the same as the range part of @rr.
  *
- * Returns: (skip) (transfer none): @r
+ * Returns: (type void): @r
  */
 GnmRange *
 range_init_rangeref (GnmRange *range, GnmRangeRef const *rr)
@@ -141,7 +141,7 @@ range_init_rangeref (GnmRange *range, GnmRangeRef const *rr)
  *
  * Updates @r to be the same as the cell range of @v.
  *
- * Returns: (skip) (transfer none): @r
+ * Returns: (type void): @r
  */
 GnmRange *
 range_init_value (GnmRange *range, GnmValue const *v)
@@ -159,7 +159,7 @@ range_init_value (GnmRange *range, GnmValue const *v)
  *
  * Updates @r to be the singleton range of @pos
  *
- * Returns: (skip) (transfer none): @r
+ * Returns: (type void): @r
  */
 GnmRange *
 range_init_cellpos (GnmRange *r, GnmCellPos const *pos)
@@ -179,7 +179,7 @@ range_init_cellpos (GnmRange *r, GnmCellPos const *pos)
  *
  * Updates @r to start at @start and spanning @cols columns and @rows rows.
  *
- * Returns: (skip) (transfer none): @r
+ * Returns: (type void): @r
  */
 GnmRange *
 range_init_cellpos_size (GnmRange *r,
@@ -193,7 +193,7 @@ range_init_cellpos_size (GnmRange *r,
 }
 
 /**
- * range_init: (skip)
+ * range_init:
  * @r: A #GnmRange to change
  * @start_col: Column
  * @start_row: Row
@@ -203,7 +203,7 @@ range_init_cellpos_size (GnmRange *r,
  * Updates @r to start at (@start_col,@start_row) and end
  * at (@end_col,@end_row).
  *
- * Returns: (skip) (transfer none): @r
+ * Returns: (type void): @r
  */
 GnmRange *
 range_init (GnmRange *r, int start_col, int start_row,
@@ -219,24 +219,6 @@ range_init (GnmRange *r, int start_col, int start_row,
        return r;
 }
 
-/**
- * range_init_gi: (rename-to range_init)
- * @r: A #GnmRange to change
- * @start_col: Column
- * @start_row: Row
- * @end_col: Column
- * @end_row: Row
- *
- * Updates @r to start at (@start_col,@start_row) and end
- * at (@end_col,@end_row).
- */
-void
-range_init_gi (GnmRange *r, int start_col, int start_row,
-              int end_col, int end_row)
-{
-       range_init (r, start_col, start_row, end_col, end_row);
-}
-
 /**
  * range_parse:
  * @r: #GnmRange
diff --git a/src/ranges.h b/src/ranges.h
index a18818b538..2924096523 100644
--- a/src/ranges.h
+++ b/src/ranges.h
@@ -77,8 +77,6 @@ GnmRange   *range_init_cellpos_size (GnmRange *r, GnmCellPos const *start,
                                     int cols, int rows);
 GnmRange   *range_init              (GnmRange *r, int start_col, int start_row,
                                     int end_col, int end_row);
-void        range_init_gi           (GnmRange *r, int start_col, int start_row,
-                                    int end_col, int end_row);
 gboolean    range_parse            (GnmRange *r, char const *text,
                                     GnmSheetSize const *ss);
 


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