[epiphany/wip/ephy-sync: 97/126] sync-bookmarks: Apparently float ruins the precision of timestamps. Use double instead
- From: Gabriel - Cristian Ivascu <gabrielivascu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/wip/ephy-sync: 97/126] sync-bookmarks: Apparently float ruins the precision of timestamps. Use double instead
- Date: Fri, 19 Aug 2016 17:39:43 +0000 (UTC)
commit 98dac9dc84b90d3efd9fa731a6398fee19091813
Author: Gabriel Ivascu <ivascu gabriel59 gmail com>
Date: Sat Jul 30 19:26:19 2016 +0300
sync-bookmarks: Apparently float ruins the precision of timestamps. Use double instead
src/ephy-bookmark.c | 6 +++---
src/ephy-bookmark.h | 4 ++--
src/ephy-sync-service.c | 16 ++++++++--------
src/ephy-sync-service.h | 4 ++--
4 files changed, 15 insertions(+), 15 deletions(-)
---
diff --git a/src/ephy-bookmark.c b/src/ephy-bookmark.c
index eb299ff..85ba18f 100644
--- a/src/ephy-bookmark.c
+++ b/src/ephy-bookmark.c
@@ -35,7 +35,7 @@ struct _EphyBookmark {
gint64 time_added;
char *id;
- float modified;
+ double modified;
};
static JsonSerializableIface *serializable_iface = NULL;
@@ -339,14 +339,14 @@ ephy_bookmark_get_id (EphyBookmark *self)
void
ephy_bookmark_set_modified (EphyBookmark *self,
- float modified)
+ double modified)
{
g_return_if_fail (EPHY_IS_BOOKMARK (self));
self->modified = modified;
}
-float
+double
ephy_bookmark_get_modified (EphyBookmark *self)
{
g_return_val_if_fail (EPHY_IS_BOOKMARK (self), -1);
diff --git a/src/ephy-bookmark.h b/src/ephy-bookmark.h
index 493a58c..502b563 100644
--- a/src/ephy-bookmark.h
+++ b/src/ephy-bookmark.h
@@ -45,8 +45,8 @@ const char *ephy_bookmark_get_title (EphyBookmark *self);
const char *ephy_bookmark_get_id (EphyBookmark *self);
void ephy_bookmark_set_modified (EphyBookmark *self,
- float modified);
-float ephy_bookmark_get_modified (EphyBookmark *self);
+ double modified);
+double ephy_bookmark_get_modified (EphyBookmark *self);
void ephy_bookmark_add_tag (EphyBookmark *self,
const char *tag);
diff --git a/src/ephy-sync-service.c b/src/ephy-sync-service.c
index 0136088..657a3ec 100644
--- a/src/ephy-sync-service.c
+++ b/src/ephy-sync-service.c
@@ -68,8 +68,8 @@ typedef struct {
gchar *endpoint;
const gchar *method;
gchar *request_body;
- float modified_since;
- float unmodified_since;
+ double modified_since;
+ double unmodified_since;
SoupSessionCallback callback;
gpointer user_data;
} StorageServerRequestAsyncData;
@@ -79,8 +79,8 @@ storage_server_request_async_data_new (EphySyncService *service,
gchar *endpoint,
const gchar *method,
gchar *request_body,
- float modified_since,
- float unmodified_since,
+ double modified_since,
+ double unmodified_since,
SoupSessionCallback callback,
gpointer user_data)
{
@@ -319,13 +319,13 @@ ephy_sync_service_send_storage_request (EphySyncService *self,
}
if (data->modified_since >= 0) {
- if_modified_since = g_strdup_printf ("%.2f", data->modified_since);
+ if_modified_since = g_strdup_printf ("%.2lf", data->modified_since);
soup_message_headers_append (message->request_headers,
"X-If-Modified-Since", if_modified_since);
}
if (data->unmodified_since >= 0) {
- if_unmodified_since = g_strdup_printf ("%.2f", data->unmodified_since);
+ if_unmodified_since = g_strdup_printf ("%.2lf", data->unmodified_since);
soup_message_headers_append (message->request_headers,
"X-If-Unmodified-Since", if_unmodified_since);
}
@@ -930,8 +930,8 @@ ephy_sync_service_send_storage_message (EphySyncService *self,
gchar *endpoint,
const gchar *method,
gchar *request_body,
- float modified_since,
- float unmodified_since,
+ double modified_since,
+ double unmodified_since,
SoupSessionCallback callback,
gpointer user_data)
{
diff --git a/src/ephy-sync-service.h b/src/ephy-sync-service.h
index b9eaa7f..6623bad 100644
--- a/src/ephy-sync-service.h
+++ b/src/ephy-sync-service.h
@@ -74,8 +74,8 @@ void ephy_sync_service_send_storage_message (EphySyncService *se
gchar *endpoint,
const gchar *method,
gchar *request_body,
- float modified_since,
- float unmodified_since,
+ double modified_since,
+ double unmodified_since,
SoupSessionCallback callback,
gpointer user_data);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]