[empathy/gnome-2-28] Do not use math.h for trunc(). It is useless and it does not build because we don't link with -lm.
- From: Xavier Claessens <xclaesse src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [empathy/gnome-2-28] Do not use math.h for trunc(). It is useless and it does not build because we don't link with -lm.
- Date: Tue, 22 Sep 2009 08:36:01 +0000 (UTC)
commit fecc657c0c64133dcf27477ee13e2da24a7f83ed
Author: Xavier Claessens <xclaesse gmail com>
Date: Tue Sep 22 10:14:55 2009 +0200
Do not use math.h for trunc(). It is useless and it does not build because we don't link with -lm.
libempathy-gtk/empathy-location-manager.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/libempathy-gtk/empathy-location-manager.c b/libempathy-gtk/empathy-location-manager.c
index 2018b5c..17e40aa 100644
--- a/libempathy-gtk/empathy-location-manager.c
+++ b/libempathy-gtk/empathy-location-manager.c
@@ -21,10 +21,6 @@
#include "config.h"
-/* Needed for trunc */
-#define _ISOC9X_SOURCE 1
-#define _ISOC99_SOURCE 1
-#include <math.h>
#include <string.h>
#include <time.h>
@@ -375,7 +371,7 @@ position_changed_cb (GeocluePosition *position,
if (priv->reduce_accuracy)
/* Truncate at 1 decimal place */
- longitude = trunc (longitude * 10.0) / 10.0;
+ longitude = ((int) (longitude * 10)) / 10.0;
new_value = tp_g_value_slice_new_double (longitude);
g_hash_table_insert (priv->location, g_strdup (EMPATHY_LOCATION_LON),
@@ -391,7 +387,7 @@ position_changed_cb (GeocluePosition *position,
{
if (priv->reduce_accuracy)
/* Truncate at 1 decimal place */
- latitude = trunc (latitude * 10.0) / 10.0;
+ latitude = ((int) (latitude * 10)) / 10.0;
new_value = tp_g_value_slice_new_double (latitude);
g_hash_table_replace (priv->location, g_strdup (EMPATHY_LOCATION_LAT),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]