brasero r1875 - in trunk: . src



Author: philippr
Date: Wed Feb  4 21:09:20 2009
New Revision: 1875
URL: http://svn.gnome.org/viewvc/brasero?rev=1875&view=rev

Log:
2009-02-04  Philippe Rouquier  <ykw localhost localdomain>

	Fix some build warnings

	* src/brasero-sum-dialog.c (brasero_sum_dialog_corruption_warning):
	* src/burn-job.c (_round_speed), (brasero_job_get_speed),
	(brasero_job_get_max_speed):

Modified:
   trunk/ChangeLog
   trunk/src/brasero-sum-dialog.c
   trunk/src/burn-job.c

Modified: trunk/src/brasero-sum-dialog.c
==============================================================================
--- trunk/src/brasero-sum-dialog.c	(original)
+++ trunk/src/brasero-sum-dialog.c	Wed Feb  4 21:09:20 2009
@@ -165,7 +165,6 @@
 brasero_sum_dialog_corruption_warning (BraseroSumDialog *self,
 				       const gchar **wrong_sums)
 {
-	gchar *string;
 	GtkWidget *tree;
 	GtkWidget *scroll;
 	GtkWidget *button;
@@ -175,16 +174,13 @@
 	GtkCellRenderer *renderer;
 	GtkTreeViewColumn *column;
 
-	string = g_strdup_printf ("<b><big>%s</big></b>",
-				  _("The following files appear to be corrupted:"));
-
 	message = gtk_message_dialog_new_with_markup (GTK_WINDOW (self),
 						      GTK_DIALOG_MODAL |
 						      GTK_DIALOG_DESTROY_WITH_PARENT,
 						      GTK_MESSAGE_ERROR,
 						      GTK_BUTTONS_NONE,
-						      string);
-	g_free (string);
+						      "<b><big>%s</big></b>",
+						      _("The following files appear to be corrupted:"));
 
 	gtk_window_set_resizable (GTK_WINDOW (message), TRUE);
 	gtk_widget_set_size_request (GTK_WIDGET (message), 440, 300);

Modified: trunk/src/burn-job.c
==============================================================================
--- trunk/src/burn-job.c	(original)
+++ trunk/src/burn-job.c	Wed Feb  4 21:09:20 2009
@@ -34,7 +34,6 @@
 #include <unistd.h>
 #include <sys/time.h>
 #include <sys/resource.h>
-#include <math.h>
 
 #include <glib.h>
 #include <glib-object.h>
@@ -54,9 +53,6 @@
 #include "brasero-drive.h"
 #include "brasero-medium.h"
 
-/* For nearbyintf ()*/
-#define _ISOC99_SOURCE
-
 typedef struct _BraseroJobOutput {
 	gchar *image;
 	gchar *toc;
@@ -1623,6 +1619,19 @@
 	return BRASERO_BURN_OK;
 }
 
+static int
+_round_speed (float number)
+{
+	int retval = (gint) number;
+
+	/* NOTE: number must always be positive */
+	number -= (float) retval;
+	if (number >= 0.5)
+		return retval + 1;
+
+	return retval;
+}
+
 BraseroBurnResult
 brasero_job_get_speed (BraseroJob *self, guint *speed)
 {
@@ -1641,11 +1650,11 @@
 
 	media = brasero_burn_session_get_dest_media (session);
 	if (media & BRASERO_MEDIUM_DVD)
-		*speed = nearbyint (BRASERO_RATE_TO_SPEED_DVD (rate));
+		*speed = _round_speed (BRASERO_RATE_TO_SPEED_DVD (rate));
 	else if (media & BRASERO_MEDIUM_BD)
-		*speed = nearbyint (BRASERO_RATE_TO_SPEED_BD (rate));
+		*speed = _round_speed (BRASERO_RATE_TO_SPEED_BD (rate));
 	else
-		*speed = nearbyint (BRASERO_RATE_TO_SPEED_CD (rate));
+		*speed = _round_speed (BRASERO_RATE_TO_SPEED_CD (rate));
 
 	return BRASERO_BURN_OK;
 }
@@ -1695,11 +1704,11 @@
 	rate = brasero_medium_get_max_write_speed (medium);
 	media = brasero_medium_get_status (medium);
 	if (media & BRASERO_MEDIUM_DVD)
-		*speed = nearbyint (BRASERO_RATE_TO_SPEED_DVD (rate));
+		*speed = _round_speed (BRASERO_RATE_TO_SPEED_DVD (rate));
 	else if (media & BRASERO_MEDIUM_BD)
-		*speed = nearbyint (BRASERO_RATE_TO_SPEED_BD (rate));
+		*speed = _round_speed (BRASERO_RATE_TO_SPEED_BD (rate));
 	else
-		*speed = nearbyint (BRASERO_RATE_TO_SPEED_CD (rate));
+		*speed = _round_speed (BRASERO_RATE_TO_SPEED_CD (rate));
 
 	return BRASERO_BURN_OK;
 }



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