[gimp] app: store plug-in mtime as gint64 instead of time_t
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: store plug-in mtime as gint64 instead of time_t
- Date: Fri, 12 Jul 2013 12:47:02 +0000 (UTC)
commit 4ab02ea2dd4581559f5a618db2435cda12ddcdbd
Author: Michael Natterer <mitch gimp org>
Date: Fri Jul 12 14:43:27 2013 +0200
app: store plug-in mtime as gint64 instead of time_t
This was an attempt to fix bug 703113 but didn't change anything,
however an explicit always-64 bit type is cleaner regardless, so here
it is.
app/plug-in/gimpplugin.c | 5 -----
app/plug-in/gimpplugindef.c | 2 +-
app/plug-in/gimpplugindef.h | 6 ++----
app/plug-in/gimppluginprocedure.h | 3 +--
app/plug-in/plug-in-rc.c | 7 ++++---
5 files changed, 8 insertions(+), 15 deletions(-)
---
diff --git a/app/plug-in/gimpplugin.c b/app/plug-in/gimpplugin.c
index 66bf879..153a311 100644
--- a/app/plug-in/gimpplugin.c
+++ b/app/plug-in/gimpplugin.c
@@ -27,7 +27,6 @@
#include <signal.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -37,10 +36,6 @@
#include <sys/wait.h>
#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
diff --git a/app/plug-in/gimpplugindef.c b/app/plug-in/gimpplugindef.c
index 4877702..9162dcc 100644
--- a/app/plug-in/gimpplugindef.c
+++ b/app/plug-in/gimpplugindef.c
@@ -199,7 +199,7 @@ gimp_plug_in_def_set_help_domain (GimpPlugInDef *plug_in_def,
void
gimp_plug_in_def_set_mtime (GimpPlugInDef *plug_in_def,
- time_t mtime)
+ gint64 mtime)
{
GSList *list;
diff --git a/app/plug-in/gimpplugindef.h b/app/plug-in/gimpplugindef.h
index 5b9a259..adfd74e 100644
--- a/app/plug-in/gimpplugindef.h
+++ b/app/plug-in/gimpplugindef.h
@@ -21,8 +21,6 @@
#define __GIMP_PLUG_IN_DEF_H__
-#include <time.h>
-
#include "core/gimpobject.h"
@@ -45,7 +43,7 @@ struct _GimpPlugInDef
gchar *locale_domain_path;
gchar *help_domain_name;
gchar *help_domain_uri;
- time_t mtime;
+ gint64 mtime;
gboolean needs_query; /* Does the plug-in need to be queried ? */
gboolean has_init; /* Does the plug-in need to be initialized ? */
};
@@ -74,7 +72,7 @@ void gimp_plug_in_def_set_help_domain (GimpPlugInDef *plug_in_def,
const gchar *domain_uri);
void gimp_plug_in_def_set_mtime (GimpPlugInDef *plug_in_def,
- time_t mtime);
+ gint64 mtime);
void gimp_plug_in_def_set_needs_query (GimpPlugInDef *plug_in_def,
gboolean needs_query);
void gimp_plug_in_def_set_has_init (GimpPlugInDef *plug_in_def,
diff --git a/app/plug-in/gimppluginprocedure.h b/app/plug-in/gimppluginprocedure.h
index caf21c2..62ad992 100644
--- a/app/plug-in/gimppluginprocedure.h
+++ b/app/plug-in/gimppluginprocedure.h
@@ -20,7 +20,6 @@
#ifndef __GIMP_PLUG_IN_PROCEDURE_H__
#define __GIMP_PLUG_IN_PROCEDURE_H__
-#include <time.h> /* time_t */
#include <gdk-pixbuf/gdk-pixbuf.h>
@@ -53,7 +52,7 @@ struct _GimpPlugInProcedure
guint8 *icon_data;
gchar *image_types;
GimpPlugInImageType image_types_val;
- time_t mtime;
+ gint64 mtime;
gboolean installed_during_init;
/* file proc specific members */
diff --git a/app/plug-in/plug-in-rc.c b/app/plug-in/plug-in-rc.c
index f448d51..c8bb944 100644
--- a/app/plug-in/plug-in-rc.c
+++ b/app/plug-in/plug-in-rc.c
@@ -261,7 +261,7 @@ plug_in_def_deserialize (Gimp *gimp,
GimpPlugInProcedure *proc = NULL;
gchar *name;
gchar *path;
- gint mtime;
+ gint64 mtime;
GTokenType token;
if (! gimp_scanner_parse_string (scanner, &name))
@@ -273,7 +273,7 @@ plug_in_def_deserialize (Gimp *gimp,
plug_in_def = gimp_plug_in_def_new (path);
g_free (path);
- if (! gimp_scanner_parse_int (scanner, &mtime))
+ if (! gimp_scanner_parse_int64 (scanner, &mtime))
{
g_object_unref (plug_in_def);
return G_TOKEN_INT;
@@ -829,7 +829,8 @@ plug_in_rc_write (GSList *plug_in_defs,
gimp_config_writer_open (writer, "plug-in-def");
gimp_config_writer_string (writer, utf8);
- gimp_config_writer_printf (writer, "%ld", plug_in_def->mtime);
+ gimp_config_writer_printf (writer, "%"G_GINT64_FORMAT,
+ plug_in_def->mtime);
g_free (utf8);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]