[Libreoffice-commits] core.git: shell/source

Pedro Giffuni pfg at apache.org
Fri Dec 11 01:36:43 PST 2015


 shell/source/unix/sysshell/recently_used_file_handler.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 7cc31b68c4c09f165f2e804847ba758820163f11
Author: Pedro Giffuni <pfg at apache.org>
Date:   Fri Dec 11 01:56:53 2015 +0000

    Do not assume time_t is long.
    
    time_t is long on some platforms but not on all.
    This plagues a warning on FreeBSD.
    
    Taken from: Jung-uk Kim
    
    (cherry picked from commit 1c030e286ac7a82eaa5b87c0f950894ab6be5027)

diff --git a/shell/source/unix/sysshell/recently_used_file_handler.cxx b/shell/source/unix/sysshell/recently_used_file_handler.cxx
index 81b9696..3049bcf 100644
--- a/shell/source/unix/sysshell/recently_used_file_handler.cxx
+++ b/shell/source/unix/sysshell/recently_used_file_handler.cxx
@@ -91,11 +91,11 @@ namespace /* private */ {
 
         void set_timestamp(const string_t& character)
         {
-            time_t t;
+            long t;
             if (sscanf(character.c_str(), "%ld", &t) != 1)
                 timestamp_ = -1;
             else
-                timestamp_ = t;
+                timestamp_ = static_cast<time_t>(t);
         }
 
         void set_is_private(SAL_UNUSED_PARAMETER const string_t& /*character*/)


More information about the Libreoffice-commits mailing list