[glom] dialog_image_progress.cc: on_stream_read(): Add casts to avoid compiler warnings, to fix distcheck.



commit c6f78c0c846894b25f02ca3c6240b2c823ec8f85
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Jul 27 16:34:16 2009 +0200

    dialog_image_progress.cc: on_stream_read(): Add casts to avoid compiler warnings, to fix distcheck.

 ChangeLog                                     |    5 +++++
 glom/utility_widgets/dialog_image_progress.cc |    4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 445730d..a24b608 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2009-07-27  Murray Cumming  <murrayc murrayc com>
 
+	* glom/utility_widgets/dialog_image_progress.cc: on_stream_read(): Add casts 
+	to avoid compiler warnings, to fix distcheck.
+
+2009-07-27  Murray Cumming  <murrayc murrayc com>
+
 	Add more delay so that self-hosting does not fail sometimes.
 	
 	* glom/libglom/spawn_with_feedback.cc: 
diff --git a/glom/utility_widgets/dialog_image_progress.cc b/glom/utility_widgets/dialog_image_progress.cc
index 96ae952..095d3b7 100644
--- a/glom/utility_widgets/dialog_image_progress.cc
+++ b/glom/utility_widgets/dialog_image_progress.cc
@@ -129,13 +129,13 @@ void Dialog_Image_Progress::on_stream_read(const Glib::RefPtr<Gio::AsyncResult>&
     gssize size = m_stream->read_finish(result);
     g_assert(size >= 0); // Would have thrown an exception otherwise
     // Cannot read more data than there is available in the file:
-    g_assert(offset + size <= static_cast<gssize>(m_data->binary_length));
+    g_assert( static_cast<gssize>(offset + size) <= static_cast<gssize>(m_data->binary_length));
     // Load image
     m_loader->write(m_data->data + offset, size);
     // Set progress
     m_progress_bar->set_fraction(static_cast<double>(offset + size) / m_data->binary_length);
     // Read next chunk, if any
-    if(offset + size < static_cast<gssize>(m_data->binary_length))
+    if(  static_cast<gssize>(offset + size) < static_cast<gssize>(m_data->binary_length))
       // Even if choose a priority lower than GDK_PRIORITY_REDRAW + 10 for the
       // read_async we don't see the progressbar progressing while the image
       // is loading. Therefore we put an idle inbetween.



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