summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-08-02 17:12:28 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-08-02 17:12:28 +0900
commitcae354d299688304f609c5f064702891f02260b9 (patch)
tree08ce931b12e7450ad981b07703794da6bfdaecf8
parent886fb0a782d8b0b969f61115b8b0e4e5b3bf6dc2 (diff)
eina hamster count - use a fixed version, revision etc. so builds repro
this should help with repdocucable builds by having our hamsters constant for a build of a specific code revision. @fix
-rw-r--r--src/lib/eina/eina_hamster.c32
1 files changed, 6 insertions, 26 deletions
diff --git a/src/lib/eina/eina_hamster.c b/src/lib/eina/eina_hamster.c
index 0cfd808fe2..261713b734 100644
--- a/src/lib/eina/eina_hamster.c
+++ b/src/lib/eina/eina_hamster.c
@@ -35,8 +35,11 @@
35 * @cond LOCAL 35 * @cond LOCAL
36 */ 36 */
37 37
38const char *_eina_hamster = VTIME; 38static const int _eina_hamster =
39static int _eina_hamsters = -1; 39 (VMAJ * 100 * 100 * 100) +
40 (VMIN * 100 * 100 ) +
41 (VMIC * 100 ) +
42 (VREV );
40 43
41/** 44/**
42 * @endcond 45 * @endcond
@@ -53,30 +56,7 @@ static int _eina_hamsters = -1;
53EAPI int 56EAPI int
54eina_hamster_count(void) 57eina_hamster_count(void)
55{ 58{
56 if (_eina_hamsters < 0) 59 return _eina_hamster;
57 {
58 int hrs = 0, min = 0, sec = 0;
59 int monnum = 0, day = 0, year = 0;
60 int zone = 0;
61 int fields;
62
63 fields = sscanf(_eina_hamster, "%04d-%02d-%02d %02d:%02d:%02d %d",
64 &year, &monnum, &day, &hrs, &min, &sec, &zone);
65 if (fields == 7)
66 {
67 _eina_hamsters = (hrs * 60) + min;
68 // alloc 60 for mins, 24 for hrs
69 // alloc 1-31 (32) for days, 1-12 (13) for months
70 // use year as-is, for 31 bits (signed) this gives us up to
71 // 3584 years, which is good enough imho. - 1500 years from
72 // now or so. :)
73 _eina_hamsters +=
74 (day + (monnum * 32) + (13 * 32 * year)) * (24 * 60);
75 }
76 }
77
78 // format: [rest - year][0-12 - month][0-31 - day][0-23 - hrs][0-59 - sec]
79 return _eina_hamsters;
80} 60}
81 61
82/** 62/**