[gnumeric] Quit: fix 2038 problem.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Quit: fix 2038 problem.
- Date: Fri, 26 Jun 2020 16:50:43 +0000 (UTC)
commit 0ca0e46d61b2e0dc5c75f35289ef06d0129a254b
Author: Morten Welinder <terra gnome org>
Date: Fri Jun 26 12:49:54 2020 -0400
Quit: fix 2038 problem.
18 years to spare... We were stuffing a time_t into an int.
NEWS | 1 +
src/dialogs/dialog-quit.c | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/NEWS b/NEWS
index 44b2d609e..9b0168d2f 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,7 @@ Morten:
* Fix ssconvert --merge-to problem. [#496]
* Fix sheet size paste problem. [#497]
* Speed up really large auto-filters. [#465]
+ * Fix 2038 problem on quit.
--------------------------------------------------------------------------
Gnumeric 1.12.47
diff --git a/src/dialogs/dialog-quit.c b/src/dialogs/dialog-quit.c
index e36a03d30..640a220e2 100644
--- a/src/dialogs/dialog-quit.c
+++ b/src/dialogs/dialog-quit.c
@@ -105,7 +105,7 @@ age_renderer_func (GtkTreeViewColumn *tree_column,
g_return_if_fail (GO_IS_DOC (doc));
if (go_doc_is_dirty (doc)) {
- int quitting_time = GPOINTER_TO_INT
+ time_t quitting_time = GPOINTER_TO_SIZE
(g_object_get_data (G_OBJECT (tree_column),
"quitting_time"));
int age = quitting_time -
@@ -244,7 +244,7 @@ show_quit_dialog (GList *dirty, WBCGtk *wbcg)
int res;
gboolean quit;
GObject *age_column;
- int quitting_time = g_get_real_time () / 1000000;
+ time_t quitting_time = g_get_real_time () / 1000000;
gui = gnm_gtk_builder_load ("res:ui/quit.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
@@ -296,7 +296,7 @@ show_quit_dialog (GList *dirty, WBCGtk *wbcg)
age_column = gtk_builder_get_object (gui, "age_column");
g_object_set_data (age_column, "quitting_time",
- GINT_TO_POINTER (quitting_time));
+ GSIZE_TO_POINTER (quitting_time));
gtk_tree_view_column_set_cell_data_func
(GTK_TREE_VIEW_COLUMN (age_column),
GTK_CELL_RENDERER (gtk_builder_get_object (gui, "age_renderer")),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]