Fix warnings introduced by minor type errors in recently added code.
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 12 Mar 2013 04:54:20 +0000 (21:54 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 12 Mar 2013 04:54:20 +0000 (21:54 -0700)
src/data/gnumeric-reader.c
src/data/ods-reader.c
src/ui/gui/spreadsheet-test.c

index 71dc4a1be7de28d2abbca4d52b13dfbeb13dfd4b..1b7a646a83ebe5d3bbf2ec89cf10e471e346824c 100644 (file)
@@ -138,7 +138,7 @@ struct gnumeric_reader
 void
 gnumeric_destroy (struct spreadsheet *s)
 {
-  struct gnumeric_reader *r = s;
+  struct gnumeric_reader *r = (struct gnumeric_reader *) s;
 
   if (0 == --r->ref_cnt)
     {
@@ -211,7 +211,7 @@ gnm_file_casereader_destroy (struct casereader *reader UNUSED, void *r_)
 
   caseproto_unref (r->proto);
 
-  gnumeric_destroy (r);
+  gnumeric_destroy (&r->spreadsheet);
 }
 
 
index 5306691c6cc6c23efa2423fff1a5386e7e3043fc..b3586b82ec8b7817d77f3f5dffcaf0bde6fd87f5 100644 (file)
@@ -140,7 +140,7 @@ struct ods_reader
 void
 ods_destroy (struct spreadsheet *s)
 {
-  struct ods_reader *r = s;
+  struct ods_reader *r = (struct ods_reader *) s;
 
   if (--r->ref_cnt == 0)
     {
@@ -252,7 +252,7 @@ ods_file_casereader_destroy (struct casereader *reader UNUSED, void *r_)
   xmlFree (r->current_sheet_name);
   xmlFree (r->target_sheet_name);
 
-  ods_destroy (r);
+  ods_destroy (&r->spreadsheet);
 }
 
 
index 90a10375ec460dbfd04a76c2a5a5091a508d341e..2f1680409ac45e2789b1c8c801eeccb26c1839fc 100644 (file)
@@ -52,7 +52,8 @@ on_clicked (GtkButton *button, struct xxx *stuff)
 
   opts.sheet_index = -1;
   opts.cell_range = spreadsheet_get_sheet_range (stuff->sp, x);
-  opts.sheet_name = spreadsheet_get_sheet_name (stuff->sp, x);
+  opts.sheet_name = CONST_CAST (char *,
+                                spreadsheet_get_sheet_name (stuff->sp, x));
   opts.read_names = TRUE;
   opts.asw = -1;
 
@@ -78,7 +79,7 @@ on_clicked (GtkButton *button, struct xxx *stuff)
        else
          {
            char *ss = xzalloc (width + 1);
-           strncpy (ss, value_str (val, width), width);
+            memcpy (ss, value_str (val, width), width);
            
            printf ("%s ", ss);
            free (ss);