diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-09-15 21:18:43 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-09-15 21:18:43 +0000 |
commit | b48ee037bd610ca845b3d7e070fb73284083423f (patch) | |
tree | 2cb5bf32fa459b3f3bde84aca83ab45eb4c7a661 /Build/source/texk/dvipdfm-x/pdffont.c | |
parent | 1256fc8fd7b2e80c314e3a36c41012b70abf92f5 (diff) |
Cleanup. Remove duplicated code. Reorganize initialization process (S. Hirata).
git-svn-id: svn://tug.org/texlive/trunk@48671 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x/pdffont.c')
-rw-r--r-- | Build/source/texk/dvipdfm-x/pdffont.c | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/Build/source/texk/dvipdfm-x/pdffont.c b/Build/source/texk/dvipdfm-x/pdffont.c index e50503e94ec..d957977e05c 100644 --- a/Build/source/texk/dvipdfm-x/pdffont.c +++ b/Build/source/texk/dvipdfm-x/pdffont.c @@ -25,7 +25,6 @@ #endif #include <string.h> -#include <time.h> #include "system.h" #include "error.h" @@ -62,41 +61,6 @@ pdf_font_set_dpi (int font_dpi) PKFont_set_dpi(font_dpi); } - -#if defined(_MSC_VER) -#define strtoll _strtoi64 -#endif - -/* If an environment variable SOURCE_DATE_EPOCH is correctly defined like - * SOURCE_DATE_EPOCH=1456304492, then returns this value, to be used as the - * 'current time', otherwise returns INVALID_EPOCH_VALUE (= (time_t)-1). - * In the case of Microsoft Visual Studio 2010, the value should be less - * than 32535291600. - */ - -time_t -get_unique_time_if_given(void) -{ - const char *source_date_epoch; - int64_t epoch; - char *endptr; - time_t ret = INVALID_EPOCH_VALUE; - - source_date_epoch = getenv("SOURCE_DATE_EPOCH"); - if (source_date_epoch) { - errno = 0; - epoch = strtoll(source_date_epoch, &endptr, 10); - if (!(epoch < 0 || *endptr != '\0' || errno != 0)) { - ret = (time_t) epoch; -#if defined(_MSC_VER) - if (ret > 32535291599ULL) - ret = 32535291599ULL; -#endif - } - } - return ret; -} - void pdf_font_make_uniqueTag (char *tag) { @@ -106,7 +70,7 @@ pdf_font_make_uniqueTag (char *tag) if (first) { time_t current_time; - current_time = get_unique_time_if_given(); + current_time = dpx_util_get_unique_time_if_given(); if (current_time == INVALID_EPOCH_VALUE) current_time = time(NULL); srand(current_time); |