freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2-demos] master e84a929: * src/ftdump.c (Print_Name): Ignore ex


From: Alexei Podtelezhnikov
Subject: [freetype2-demos] master e84a929: * src/ftdump.c (Print_Name): Ignore exuberant timestamps.
Date: Tue, 30 Oct 2018 22:36:47 -0400 (EDT)

branch: master
commit e84a929cc156ad9a6b586101b067ff7ab8dfcb9b
Author: Alexei Podtelezhnikov <address@hidden>
Commit: Alexei Podtelezhnikov <address@hidden>

    * src/ftdump.c (Print_Name): Ignore exuberant timestamps.
---
 ChangeLog    |  4 ++++
 src/ftdump.c | 13 ++++++++-----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 336262c..8d54247 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2018-10-30  Alexei Podtelezhnikov  <address@hidden>
+
+       * src/ftdump.c (Print_Name): Ignore exuberant timestamps.
+
 2018-10-28  Alexei Podtelezhnikov  <address@hidden>
 
        * src/ftdump.c (Print_Name): Use ISO 8601 datestamps.
diff --git a/src/ftdump.c b/src/ftdump.c
index 7b71a1d..662e825 100644
--- a/src/ftdump.c
+++ b/src/ftdump.c
@@ -132,17 +132,20 @@
     if ( head )
     {
       char    buf[11];
-      time_t  created  = ( head->Created [0] << 32 ) + head->Created [1]
-                         - 2082844800;
-      time_t  modified = ( head->Modified[0] << 32 ) + head->Modified[1]
-                         - 2082844800;
+      time_t  created  = head->Created [1];
+      time_t  modified = head->Modified[1];
 
 
-      printf("   revision:   %.2f\n", head->Font_Revision / 65536.0 );
+      /* ignore most of upper bits until 2176 and adjust epoch */
+      created  += head->Created [0] == 1 ? 2212122496 : -2082844800;
+      modified += head->Modified[0] == 1 ? 2212122496 : -2082844800;
+
       strftime( buf, sizeof( buf ), "%Y-%m-%d", gmtime( &created  ) );
       printf("   created:    %s\n", buf );
       strftime( buf, sizeof( buf ), "%Y-%m-%d", gmtime( &modified ) );
       printf("   modified:   %s\n", buf );
+
+      printf("   revision:   %.2f\n", head->Font_Revision / 65536.0 );
     }
 
   }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]