[gnumeric] Compilation: fix clang warning, I hope, by making cast explicit.



commit 98cfa1772540aeb8c3df995f7bfba67ad6d569d9
Author: Morten Welinder <terra gnome org>
Date:   Mon Apr 15 15:46:32 2013 -0400

    Compilation: fix clang warning, I hope, by making cast explicit.
    
    It appears that the implicit cast that turns 65536 into 0 which
    then gets stored in a b-byte field is correct.  This patch makes
    the cast explicit.

 plugins/excel/ChangeLog        | 3 +++
 plugins/excel/ms-excel-write.c | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 510eca4..192f4eb 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -8,6 +8,9 @@
        (excel_parse_name): Add argument for array data length.  All
        callers changed.  Fixes #654211.
 
+       * ms-excel-write.c (excel_write_PAGE_BREAK): Make implied cast of
+       columnm/row number to guint16 explicit.  See #693979.
+
 2013-04-14  Morten Welinder  <terra gnome org>
 
        * ms-excel-write.c (excel_write_NAME): Store the name's length in
diff --git a/plugins/excel/ms-excel-write.c b/plugins/excel/ms-excel-write.c
index d7f32b8..a2933ab 100644
--- a/plugins/excel/ms-excel-write.c
+++ b/plugins/excel/ms-excel-write.c
@@ -4809,7 +4809,7 @@ excel_write_PAGE_BREAK (BiffPut *bp, GnmPageBreaks const *breaks)
        guint8 *data;
        GnmPageBreaks *manual_pbreaks = gnm_page_breaks_dup_non_auto_breaks (breaks);
        GArray *details =  manual_pbreaks->details;
-       guint16 const maxima = manual_pbreaks->is_vert ? XLS_MaxRow_V8 : XLS_MaxCol;
+       guint16 const maxima = (guint16)(manual_pbreaks->is_vert ? XLS_MaxRow_V8 : XLS_MaxCol);
 
        /* limit size to ensure no CONTINUE (do we need this ? ) */
        if (((n = details->len)*step + 2 + 2) >= ms_biff_max_record_len (bp))


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