From: Cristy Date: Mon, 15 Apr 2019 13:02:06 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.8-41~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=edd02d2ed4def8e599701e4cb785c81223669a26;p=imagemagick ... --- diff --git a/MagickCore/Makefile.am b/MagickCore/Makefile.am index 9d8fd1139..39b4a353c 100644 --- a/MagickCore/Makefile.am +++ b/MagickCore/Makefile.am @@ -212,6 +212,7 @@ MAGICKCORE_BASE_SRCS = \ MagickCore/pixel-private.h \ MagickCore/policy.c \ MagickCore/policy.h \ + MagickCore/policy-private.h \ MagickCore/prepress.c \ MagickCore/prepress.h \ MagickCore/property.c \ @@ -268,6 +269,7 @@ MAGICKCORE_BASE_SRCS = \ MagickCore/thread-private.h \ MagickCore/timer.c \ MagickCore/timer.h \ + MagickCore/timer-private.h \ MagickCore/token.c \ MagickCore/token.h \ MagickCore/token-private.h \ @@ -467,6 +469,7 @@ MAGICKCORE_NOINST_HDRS = \ MagickCore/string-private.h \ MagickCore/thread_.h \ MagickCore/thread-private.h \ + MagickCore/timer-private.h \ MagickCore/token-private.h \ MagickCore/transform-private.h \ MagickCore/type-private.h \ diff --git a/MagickCore/animate.c b/MagickCore/animate.c index 06d3088f1..8e6bd70bc 100644 --- a/MagickCore/animate.c +++ b/MagickCore/animate.c @@ -67,6 +67,7 @@ #include "MagickCore/resource_.h" #include "MagickCore/string_.h" #include "MagickCore/string-private.h" +#include "MagickCore/timer-private.h" #include "MagickCore/transform.h" #include "MagickCore/utility.h" #include "MagickCore/utility-private.h" @@ -2173,10 +2174,10 @@ MagickExport Image *XAnimateImages(Display *display, /* Handle a window event. */ - timestamp=time((time_t *) NULL); + timestamp=GetMagickTime(); (void) XNextEvent(display,&event); if (windows->image.stasis == MagickFalse) - windows->image.stasis=(time((time_t *) NULL)-timestamp) > 0 ? + windows->image.stasis=(GetMagickTime()-timestamp) > 0 ? MagickTrue : MagickFalse; if (event.xany.window == windows->command.id) { diff --git a/MagickCore/blob.c b/MagickCore/blob.c index 77868e1bc..7de1023f6 100644 --- a/MagickCore/blob.c +++ b/MagickCore/blob.c @@ -68,6 +68,7 @@ #include "MagickCore/semaphore.h" #include "MagickCore/string_.h" #include "MagickCore/string-private.h" +#include "MagickCore/timer-private.h" #include "MagickCore/token.h" #include "MagickCore/utility.h" #include "MagickCore/utility-private.h" @@ -1736,7 +1737,7 @@ MagickExport void GetBlobInfo(BlobInfo *blob_info) (void) memset(blob_info,0,sizeof(*blob_info)); blob_info->type=UndefinedStream; blob_info->quantum=(size_t) MagickMaxBlobExtent; - blob_info->properties.st_mtime=time((time_t *) NULL); + blob_info->properties.st_mtime=GetMagickTime(); blob_info->properties.st_ctime=blob_info->properties.st_mtime; blob_info->debug=IsEventLogging(); blob_info->reference_count=1; diff --git a/MagickCore/cache.c b/MagickCore/cache.c index f521a09a0..0197385ac 100644 --- a/MagickCore/cache.c +++ b/MagickCore/cache.c @@ -70,6 +70,7 @@ #include "MagickCore/splay-tree.h" #include "MagickCore/string_.h" #include "MagickCore/string-private.h" +#include "MagickCore/timer-private.h" #include "MagickCore/thread-private.h" #include "MagickCore/utility.h" #include "MagickCore/utility-private.h" @@ -1681,10 +1682,10 @@ static Cache GetImagePixelCache(Image *image,const MagickBooleanType clone, Set the expire time in seconds. */ cache_timelimit=GetMagickResourceLimit(TimeResource); - cache_epoch=time((time_t *) NULL); + cache_epoch=GetMagickTime(); } if ((cache_timelimit != MagickResourceInfinity) && - ((MagickSizeType) (time((time_t *) NULL)-cache_epoch) >= cache_timelimit)) + ((MagickSizeType) (GetMagickTime()-cache_epoch) >= cache_timelimit)) { #if defined(ECANCELED) errno=ECANCELED; diff --git a/MagickCore/display.c b/MagickCore/display.c index 4e8e7eb15..0ceae3880 100644 --- a/MagickCore/display.c +++ b/MagickCore/display.c @@ -87,6 +87,7 @@ #include "MagickCore/statistic.h" #include "MagickCore/string_.h" #include "MagickCore/string-private.h" +#include "MagickCore/timer-private.h" #include "MagickCore/transform.h" #include "MagickCore/transform-private.h" #include "MagickCore/threshold.h" @@ -15073,7 +15074,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, Respond to events. */ delay=display_image->delay/MagickMax(display_image->ticks_per_second,1L); - timer=time((time_t *) NULL)+(delay == 0 ? 1 : delay)+1; + timer=GetMagickTime()+(delay == 0 ? 1 : delay)+1; update_time=0; if (resource_info->update != MagickFalse ) { @@ -15098,7 +15099,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, if (windows->image.mapped != MagickFalse ) if ((display_image->delay != 0) || (resource_info->update != 0)) { - if (timer < time((time_t *) NULL)) + if (timer < GetMagickTime()) { if (resource_info->update == MagickFalse) *state|=NextImageState | ExitState; @@ -15127,7 +15128,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, } delay=display_image->delay/MagickMax( display_image->ticks_per_second,1L); - timer=time((time_t *) NULL)+(delay == 0 ? 1 : delay)+1; + timer=GetMagickTime()+(delay == 0 ? 1 : delay)+1; } } if (XEventsQueued(display,QueuedAfterFlush) == 0) @@ -15139,12 +15140,12 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, continue; } } - timestamp=time((time_t *) NULL); + timestamp=GetMagickTime(); (void) XNextEvent(display,&event); if ((windows->image.stasis == MagickFalse) || (windows->magnify.stasis == MagickFalse)) { - if ((time((time_t *) NULL)-timestamp) > 0) + if ((GetMagickTime()-timestamp) > 0) { windows->image.stasis=MagickTrue; windows->magnify.stasis=MagickTrue; @@ -15371,7 +15372,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, } delay=display_image->delay/MagickMax(display_image->ticks_per_second, 1L); - timer=time((time_t *) NULL)+(delay == 0 ? 1 : delay)+1; + timer=GetMagickTime()+(delay == 0 ? 1 : delay)+1; break; } case ButtonRelease: @@ -15763,7 +15764,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, XRefreshWindow(display,&windows->image,&event); delay=display_image->delay/MagickMax( display_image->ticks_per_second,1L); - timer=time((time_t *) NULL)+(delay == 0 ? 1 : delay)+1; + timer=GetMagickTime()+(delay == 0 ? 1 : delay)+1; break; } if ((event.xexpose.window == windows->magnify.id) && @@ -15824,7 +15825,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info, } delay=display_image->delay/MagickMax( display_image->ticks_per_second,1L); - timer=time((time_t *) NULL)+(delay == 0 ? 1 : delay)+1; + timer=GetMagickTime()+(delay == 0 ? 1 : delay)+1; break; } case KeyRelease: diff --git a/MagickCore/image.c b/MagickCore/image.c index c089ab357..a7a9c0078 100644 --- a/MagickCore/image.c +++ b/MagickCore/image.c @@ -96,6 +96,7 @@ #include "MagickCore/thread-private.h" #include "MagickCore/threshold.h" #include "MagickCore/timer.h" +#include "MagickCore/timer-private.h" #include "MagickCore/token.h" #include "MagickCore/token-private.h" #include "MagickCore/utility.h" @@ -207,7 +208,7 @@ MagickExport Image *AcquireImage(const ImageInfo *image_info, image->channel_mask=DefaultChannels; image->channel_map=AcquirePixelChannelMap(); image->blob=CloneBlobInfo((BlobInfo *) NULL); - image->timestamp=time((time_t *) NULL); + image->timestamp=GetMagickTime(); image->debug=IsEventLogging(); image->reference_count=1; image->semaphore=AcquireSemaphoreInfo(); diff --git a/MagickCore/log.c b/MagickCore/log.c index 4ec9467dd..b494cd33a 100644 --- a/MagickCore/log.c +++ b/MagickCore/log.c @@ -57,9 +57,10 @@ #include "MagickCore/timer.h" #include "MagickCore/string_.h" #include "MagickCore/string-private.h" -#include "MagickCore/token.h" #include "MagickCore/thread_.h" #include "MagickCore/thread-private.h" +#include "MagickCore/timer-private.h" +#include "MagickCore/token.h" #include "MagickCore/utility.h" #include "MagickCore/utility-private.h" #include "MagickCore/version.h" @@ -975,7 +976,7 @@ static char *TranslateEvent(const char *module,const char *function, exception=AcquireExceptionInfo(); log_info=(LogInfo *) GetLogInfo("*",exception); exception=DestroyExceptionInfo(exception); - seconds=time((time_t *) NULL); + seconds=GetMagickTime(); elapsed_time=GetElapsedTime(&log_info->timer); user_time=GetUserTime(&log_info->timer); text=AcquireString(event); diff --git a/MagickCore/policy-private.h b/MagickCore/policy-private.h index 04659eb43..79ec719f8 100644 --- a/MagickCore/policy-private.h +++ b/MagickCore/policy-private.h @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. - MagickCore private image color methods. + MagickCore private policy methods. */ #ifndef MAGICKCORE_POLICY_PRIVATE_H #define MAGICKCORE_POLICY_PRIVATE_H diff --git a/MagickCore/signature.c b/MagickCore/signature.c index 2315ac0e7..10223eab5 100644 --- a/MagickCore/signature.c +++ b/MagickCore/signature.c @@ -53,6 +53,7 @@ #include "MagickCore/signature.h" #include "MagickCore/signature-private.h" #include "MagickCore/string_.h" +#include "MagickCore/timer-private.h" /* Define declarations. */ @@ -138,7 +139,7 @@ MagickPrivate SignatureInfo *AcquireSignatureInfo(void) lsb_first=1; signature_info->lsb_first=(int) (*(char *) &lsb_first) == 1 ? MagickTrue : MagickFalse; - signature_info->timestamp=(ssize_t) time((time_t *) NULL); + signature_info->timestamp=(ssize_t) GetMagickTime(); signature_info->signature=MagickCoreSignature; InitializeSignature(signature_info); return(signature_info); diff --git a/MagickCore/string.c b/MagickCore/string.c index a96a35df3..738bc5d21 100644 --- a/MagickCore/string.c +++ b/MagickCore/string.c @@ -1161,86 +1161,6 @@ MagickExport ssize_t FormatMagickSize(const MagickSizeType size, % % % % % % -% F o r m a t M a g i c k T i m e % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% FormatMagickTime() returns the specified time in the Internet date/time -% format and the length of the timestamp. -% -% The format of the FormatMagickTime method is: -% -% ssize_t FormatMagickTime(const time_t time,const size_t length, -% char *timestamp) -% -% A description of each parameter follows. -% -% o time: the time since the Epoch (00:00:00 UTC, January 1, 1970), -% measured in seconds. -% -% o length: the maximum length of the string. -% -% o timestamp: Return the Internet date/time here. -% -*/ -MagickExport ssize_t FormatMagickTime(const time_t time,const size_t length, - char *timestamp) -{ - ssize_t - count; - - struct tm - gm_time, - local_time; - - time_t - timezone; - - assert(timestamp != (char *) NULL); - (void) memset(&local_time,0,sizeof(local_time)); - (void) memset(&gm_time,0,sizeof(gm_time)); -#if defined(MAGICKCORE_HAVE_LOCALTIME_R) - (void) localtime_r(&time,&local_time); -#else - { - struct tm - *my_time; - - my_time=localtime(&time); - if (my_time != (struct tm *) NULL) - (void) memcpy(&local_time,my_time,sizeof(local_time)); - } -#endif -#if defined(MAGICKCORE_HAVE_GMTIME_R) - (void) gmtime_r(&time,&gm_time); -#else - { - struct tm - *my_time; - - my_time=gmtime(&time); - if (my_time != (struct tm *) NULL) - (void) memcpy(&gm_time,my_time,sizeof(gm_time)); - } -#endif - timezone=(time_t) ((local_time.tm_min-gm_time.tm_min)/60+ - local_time.tm_hour-gm_time.tm_hour+24*((local_time.tm_year- - gm_time.tm_year) != 0 ? (local_time.tm_year-gm_time.tm_year) : - (local_time.tm_yday-gm_time.tm_yday))); - count=FormatLocaleString(timestamp,length, - "%04d-%02d-%02dT%02d:%02d:%02d%+03ld:00",local_time.tm_year+1900, - local_time.tm_mon+1,local_time.tm_mday,local_time.tm_hour, - local_time.tm_min,local_time.tm_sec,(long) timezone); - return(count); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % G e t E n v i r o n m e n t V a l u e % % % % % diff --git a/MagickCore/string_.h b/MagickCore/string_.h index 2417b736c..41721821c 100644 --- a/MagickCore/string_.h +++ b/MagickCore/string_.h @@ -83,8 +83,7 @@ extern MagickExport size_t extern MagickExport ssize_t FormatMagickSize(const MagickSizeType,const MagickBooleanType,const char *, - const size_t,char *), - FormatMagickTime(const time_t,const size_t,char *); + const size_t,char *); extern MagickExport StringInfo *AcquireStringInfo(const size_t), diff --git a/MagickCore/timer.c b/MagickCore/timer.c index 878905edf..b3d0b545e 100644 --- a/MagickCore/timer.c +++ b/MagickCore/timer.c @@ -43,11 +43,13 @@ #include "MagickCore/studio.h" #include "MagickCore/exception.h" #include "MagickCore/exception-private.h" +#include "MagickCore/locale_.h" #include "MagickCore/log.h" #include "MagickCore/memory_.h" #include "MagickCore/memory-private.h" #include "MagickCore/nt-base-private.h" #include "MagickCore/timer.h" +#include "MagickCore/timer-private.h" /* Define declarations. @@ -225,6 +227,86 @@ static double ElapsedTime(void) % % % % % % +% F o r m a t M a g i c k T i m e % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% FormatMagickTime() returns the specified time in the Internet date/time +% format and the length of the timestamp. +% +% The format of the FormatMagickTime method is: +% +% ssize_t FormatMagickTime(const time_t time,const size_t length, +% char *timestamp) +% +% A description of each parameter follows. +% +% o time: the time since the Epoch (00:00:00 UTC, January 1, 1970), +% measured in seconds. +% +% o length: the maximum length of the string. +% +% o timestamp: Return the Internet date/time here. +% +*/ +MagickExport ssize_t FormatMagickTime(const time_t time,const size_t length, + char *timestamp) +{ + ssize_t + count; + + struct tm + gm_time, + local_time; + + time_t + timezone; + + assert(timestamp != (char *) NULL); + (void) memset(&local_time,0,sizeof(local_time)); + (void) memset(&gm_time,0,sizeof(gm_time)); +#if defined(MAGICKCORE_HAVE_LOCALTIME_R) + (void) localtime_r(&time,&local_time); +#else + { + struct tm + *my_time; + + my_time=localtime(&time); + if (my_time != (struct tm *) NULL) + (void) memcpy(&local_time,my_time,sizeof(local_time)); + } +#endif +#if defined(MAGICKCORE_HAVE_GMTIME_R) + (void) gmtime_r(&time,&gm_time); +#else + { + struct tm + *my_time; + + my_time=gmtime(&time); + if (my_time != (struct tm *) NULL) + (void) memcpy(&gm_time,my_time,sizeof(gm_time)); + } +#endif + timezone=(time_t) ((local_time.tm_min-gm_time.tm_min)/60+ + local_time.tm_hour-gm_time.tm_hour+24*((local_time.tm_year- + gm_time.tm_year) != 0 ? (local_time.tm_year-gm_time.tm_year) : + (local_time.tm_yday-gm_time.tm_yday))); + count=FormatLocaleString(timestamp,length, + "%04d-%02d-%02dT%02d:%02d:%02d%+03ld:00",local_time.tm_year+1900, + local_time.tm_mon+1,local_time.tm_mday,local_time.tm_hour, + local_time.tm_min,local_time.tm_sec,(long) timezone); + return(count); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % % G e t E l a p s e d T i m e % % % % % @@ -260,6 +342,29 @@ MagickExport double GetElapsedTime(TimerInfo *time_info) % % % % % % +% G e t M a g i c k T i m e % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% GetMagickTime() returns the time as the number of seconds since the Epoch. +% +% The format of the GetElapsedTime method is: +% +% time_t GetElapsedTime(void) +% +*/ +MagickPrivate time_t GetMagickTime(void) +{ + return(time((time_t *) NULL)); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % + G e t T i m e r I n f o % % % % % diff --git a/MagickCore/timer.h b/MagickCore/timer.h index f88439fb2..988463511 100644 --- a/MagickCore/timer.h +++ b/MagickCore/timer.h @@ -57,6 +57,9 @@ extern MagickExport double extern MagickExport MagickBooleanType ContinueTimer(TimerInfo *); +extern MagickExport ssize_t + FormatMagickTime(const time_t,const size_t,char *); + extern MagickExport TimerInfo *AcquireTimerInfo(void), *DestroyTimerInfo(TimerInfo *); diff --git a/MagickCore/widget.c b/MagickCore/widget.c index 346e4274d..62d3ad204 100644 --- a/MagickCore/widget.c +++ b/MagickCore/widget.c @@ -49,6 +49,7 @@ #include "MagickCore/magick.h" #include "MagickCore/memory_.h" #include "MagickCore/string_.h" +#include "MagickCore/timer-private.h" #include "MagickCore/token.h" #include "MagickCore/token-private.h" #include "MagickCore/utility.h" @@ -8188,11 +8189,11 @@ MagickPrivate void XNoticeWidget(Display *display,XWindows *windows, /* Respond to X events. */ - timer=time((time_t *) NULL)+Timeout; + timer=GetMagickTime()+Timeout; state=UpdateConfigurationState; do { - if (time((time_t *) NULL) > timer) + if (GetMagickTime() > timer) break; if (state & UpdateConfigurationState) { diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c index 0eefa407a..0b75f36be 100644 --- a/MagickWand/mogrify.c +++ b/MagickWand/mogrify.c @@ -48,13 +48,14 @@ #include "MagickWand/MagickWand.h" #include "MagickWand/magick-wand-private.h" #include "MagickWand/mogrify-private.h" +#include "MagickCore/blob-private.h" #include "MagickCore/composite-private.h" #include "MagickCore/image-private.h" #include "MagickCore/monitor-private.h" #include "MagickCore/string-private.h" #include "MagickCore/thread-private.h" +#include "MagickCore/timer-private.h" #include "MagickCore/utility-private.h" -#include "MagickCore/blob-private.h" #if defined(MAGICKCORE_HAVE_UTIME_H) #include #endif @@ -7483,7 +7484,7 @@ WandExport MagickBooleanType MogrifyImageInfo(ImageInfo *image_info, if (*option == '+') { - seed=(unsigned long) time((time_t *) NULL); + seed=(unsigned long) GetMagickTime(); SetRandomSecretKey(seed); break; } diff --git a/MagickWand/operation.c b/MagickWand/operation.c index c93c123e1..e8781bc45 100644 --- a/MagickWand/operation.c +++ b/MagickWand/operation.c @@ -61,6 +61,7 @@ #include "MagickCore/pixel-private.h" #include "MagickCore/string-private.h" #include "MagickCore/thread-private.h" +#include "MagickCore/timer-private.h" /* Constant declaration. @@ -1334,7 +1335,7 @@ WandPrivate void CLISettingOptionInfo(MagickCLI *cli_wand, CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); SetRandomSecretKey( IfSetOption ? (unsigned long) StringToUnsignedLong(arg1) - : (unsigned long) time((time_t *) NULL) ); + : (unsigned long) GetMagickTime() ); break; } if (LocaleCompare("size",option+1) == 0) diff --git a/Makefile.in b/Makefile.in index 41ad92ae0..bd22419a9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -480,7 +480,8 @@ am__MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_SOURC MagickCore/option-private.h MagickCore/paint.c \ MagickCore/paint.h MagickCore/pixel.c MagickCore/pixel.h \ MagickCore/pixel-accessor.h MagickCore/pixel-private.h \ - MagickCore/policy.c MagickCore/policy.h MagickCore/prepress.c \ + MagickCore/policy.c MagickCore/policy.h \ + MagickCore/policy-private.h MagickCore/prepress.c \ MagickCore/prepress.h MagickCore/property.c \ MagickCore/property.h MagickCore/profile.c \ MagickCore/profile.h MagickCore/profile-private.h \ @@ -506,7 +507,8 @@ am__MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_SOURC MagickCore/string_.h MagickCore/string-private.h \ MagickCore/studio.h MagickCore/thread.c MagickCore/thread_.h \ MagickCore/thread-private.h MagickCore/timer.c \ - MagickCore/timer.h MagickCore/token.c MagickCore/token.h \ + MagickCore/timer.h MagickCore/timer-private.h \ + MagickCore/token.c MagickCore/token.h \ MagickCore/token-private.h MagickCore/transform.c \ MagickCore/transform.h MagickCore/threshold.c \ MagickCore/threshold.h MagickCore/type.c MagickCore/type.h \ @@ -4910,6 +4912,7 @@ MAGICKCORE_BASE_SRCS = \ MagickCore/pixel-private.h \ MagickCore/policy.c \ MagickCore/policy.h \ + MagickCore/policy-private.h \ MagickCore/prepress.c \ MagickCore/prepress.h \ MagickCore/property.c \ @@ -4966,6 +4969,7 @@ MAGICKCORE_BASE_SRCS = \ MagickCore/thread-private.h \ MagickCore/timer.c \ MagickCore/timer.h \ + MagickCore/timer-private.h \ MagickCore/token.c \ MagickCore/token.h \ MagickCore/token-private.h \ @@ -5160,6 +5164,7 @@ MAGICKCORE_NOINST_HDRS = \ MagickCore/string-private.h \ MagickCore/thread_.h \ MagickCore/thread-private.h \ + MagickCore/timer-private.h \ MagickCore/token-private.h \ MagickCore/transform-private.h \ MagickCore/type-private.h \ diff --git a/coders/cin.c b/coders/cin.c index c1276505f..d79f1c3bf 100644 --- a/coders/cin.c +++ b/coders/cin.c @@ -59,6 +59,7 @@ #include "MagickCore/list.h" #include "MagickCore/magick.h" #include "MagickCore/memory_.h" +#include "MagickCore/module.h" #include "MagickCore/monitor.h" #include "MagickCore/monitor-private.h" #include "MagickCore/option.h" @@ -69,7 +70,7 @@ #include "MagickCore/static.h" #include "MagickCore/string_.h" #include "MagickCore/string-private.h" -#include "MagickCore/module.h" +#include "MagickCore/timer-private.h" /* Typedef declaration. @@ -990,7 +991,7 @@ static MagickBooleanType WriteCINImage(const ImageInfo *image_info,Image *image, sizeof(cin.file.filename)); offset+=WriteBlob(image,sizeof(cin.file.filename),(unsigned char *) cin.file.filename); - seconds=time((time_t *) NULL); + seconds=GetMagickTime(); #if defined(MAGICKCORE_HAVE_LOCALTIME_R) (void) localtime_r(&seconds,&local_time); #else @@ -1093,7 +1094,7 @@ static MagickBooleanType WriteCINImage(const ImageInfo *image_info,Image *image, sizeof(cin.origination.filename)); offset+=WriteBlob(image,sizeof(cin.origination.filename),(unsigned char *) cin.origination.filename); - seconds=time((time_t *) NULL); + seconds=GetMagickTime(); (void) memset(timestamp,0,sizeof(timestamp)); (void) strftime(timestamp,MagickPathExtent,"%Y:%m:%d:%H:%M:%S%Z",&local_time); (void) memset(cin.origination.create_date,0, diff --git a/coders/dpx.c b/coders/dpx.c index f30763ecb..f6aa4b38d 100644 --- a/coders/dpx.c +++ b/coders/dpx.c @@ -65,6 +65,7 @@ #include "MagickCore/static.h" #include "MagickCore/string_.h" #include "MagickCore/string-private.h" +#include "MagickCore/timer-private.h" /* Define declaration. @@ -1587,7 +1588,7 @@ static MagickBooleanType WriteDPXImage(const ImageInfo *image_info,Image *image, (void) strncpy(dpx.file.filename,value,sizeof(dpx.file.filename)-1); offset+=WriteBlob(image,sizeof(dpx.file.filename),(unsigned char *) dpx.file.filename); - seconds=time((time_t *) NULL); + seconds=GetMagickTime(); (void) FormatMagickTime(seconds,sizeof(dpx.file.timestamp), dpx.file.timestamp); offset+=WriteBlob(image,sizeof(dpx.file.timestamp),(unsigned char *) diff --git a/coders/mat.c b/coders/mat.c index f31e59a18..3eb4571e2 100644 --- a/coders/mat.c +++ b/coders/mat.c @@ -74,6 +74,7 @@ #include "MagickCore/static.h" #include "MagickCore/string_.h" #include "MagickCore/module.h" +#include "MagickCore/timer-private.h" #include "MagickCore/transform.h" #include "MagickCore/utility-private.h" #if defined(MAGICKCORE_ZLIB_DELEGATE) @@ -1605,7 +1606,7 @@ static MagickBooleanType WriteMATImage(const ImageInfo *image_info,Image *image, return(MagickFalse); image->depth=8; - current_time=time((time_t *) NULL); + current_time=GetMagickTime(); #if defined(MAGICKCORE_HAVE_LOCALTIME_R) (void) localtime_r(¤t_time,&local_time); #else diff --git a/coders/pdb.c b/coders/pdb.c index 0ab8b498b..5a1f59885 100644 --- a/coders/pdb.c +++ b/coders/pdb.c @@ -64,6 +64,7 @@ #include "MagickCore/list.h" #include "MagickCore/magick.h" #include "MagickCore/memory_.h" +#include "MagickCore/module.h" #include "MagickCore/monitor.h" #include "MagickCore/monitor-private.h" #include "MagickCore/pixel-accessor.h" @@ -72,7 +73,7 @@ #include "MagickCore/quantum-private.h" #include "MagickCore/static.h" #include "MagickCore/string_.h" -#include "MagickCore/module.h" +#include "MagickCore/timer-private.h" #include "MagickCore/utility.h" /* @@ -815,7 +816,7 @@ static MagickBooleanType WritePDBImage(const ImageInfo *image_info,Image *image, (void) CopyMagickString(pdb_info.name,filename,sizeof(pdb_info.name)); pdb_info.attributes=0; pdb_info.version=0; - pdb_info.create_time=time((time_t *) NULL); + pdb_info.create_time=GetMagickTime(); pdb_info.modify_time=pdb_info.create_time; pdb_info.archive_time=0; pdb_info.modify_number=0; diff --git a/coders/pdf.c b/coders/pdf.c index e2d96b866..26938afe2 100644 --- a/coders/pdf.c +++ b/coders/pdf.c @@ -76,6 +76,7 @@ #include "MagickCore/static.h" #include "MagickCore/string_.h" #include "MagickCore/module.h" +#include "MagickCore/timer-private.h" #include "MagickCore/token.h" #include "MagickCore/transform.h" #include "MagickCore/utility.h" @@ -1451,7 +1452,7 @@ RestoreMSCWarning value=GetImageProperty(image,"date:create",exception); if (value != (const char *) NULL) (void) CopyMagickString(create_date,value,MagickPathExtent); - (void) FormatMagickTime(time((time_t *) NULL),MagickPathExtent,timestamp); + (void) FormatMagickTime(GetMagickTime(),MagickPathExtent,timestamp); url=(char *) MagickAuthoritativeURL; escape=EscapeParenthesis(basename); i=FormatLocaleString(xmp_profile,MagickPathExtent,XMPProfile, @@ -3007,7 +3008,7 @@ RestoreMSCWarning } } (void) WriteBlobString(image,buffer); - seconds=time((time_t *) NULL); + seconds=GetMagickTime(); #if defined(MAGICKCORE_HAVE_LOCALTIME_R) (void) localtime_r(&seconds,&local_time); #else diff --git a/coders/ps.c b/coders/ps.c index cfc0f82ce..f5dcde5b1 100644 --- a/coders/ps.c +++ b/coders/ps.c @@ -61,6 +61,7 @@ #include "MagickCore/list.h" #include "MagickCore/magick.h" #include "MagickCore/memory_.h" +#include "MagickCore/module.h" #include "MagickCore/monitor.h" #include "MagickCore/monitor-private.h" #include "MagickCore/nt-base-private.h" @@ -72,7 +73,7 @@ #include "MagickCore/quantum-private.h" #include "MagickCore/static.h" #include "MagickCore/string_.h" -#include "MagickCore/module.h" +#include "MagickCore/timer-private.h" #include "MagickCore/token.h" #include "MagickCore/transform.h" #include "MagickCore/utility.h" @@ -1670,7 +1671,7 @@ static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image, (void) FormatLocaleString(buffer,MagickPathExtent,"%%%%Title: (%s)\n", image->filename); (void) WriteBlobString(image,buffer); - timer=time((time_t *) NULL); + timer=GetMagickTime(); (void) FormatMagickTime(timer,MagickPathExtent,date); (void) FormatLocaleString(buffer,MagickPathExtent, "%%%%CreationDate: (%s)\n",date); diff --git a/coders/ps2.c b/coders/ps2.c index 8a05a3d2a..206eb4fcb 100644 --- a/coders/ps2.c +++ b/coders/ps2.c @@ -57,6 +57,7 @@ #include "MagickCore/list.h" #include "MagickCore/magick.h" #include "MagickCore/memory_.h" +#include "MagickCore/module.h" #include "MagickCore/monitor.h" #include "MagickCore/monitor-private.h" #include "MagickCore/monitor-private.h" @@ -67,7 +68,7 @@ #include "MagickCore/resource_.h" #include "MagickCore/static.h" #include "MagickCore/string_.h" -#include "MagickCore/module.h" +#include "MagickCore/timer-private.h" #include "MagickCore/utility.h" /* @@ -569,7 +570,7 @@ static MagickBooleanType WritePS2Image(const ImageInfo *image_info,Image *image, (void) FormatLocaleString(buffer,MagickPathExtent,"%%%%Title: (%s)\n", image->filename); (void) WriteBlobString(image,buffer); - timer=time((time_t *) NULL); + timer=GetMagickTime(); (void) FormatMagickTime(timer,MagickPathExtent,date); (void) FormatLocaleString(buffer,MagickPathExtent, "%%%%CreationDate: (%s)\n",date); diff --git a/coders/ps3.c b/coders/ps3.c index 24bccf1fe..6c5721d52 100644 --- a/coders/ps3.c +++ b/coders/ps3.c @@ -60,6 +60,7 @@ #include "MagickCore/list.h" #include "MagickCore/magick.h" #include "MagickCore/memory_.h" +#include "MagickCore/module.h" #include "MagickCore/monitor.h" #include "MagickCore/monitor-private.h" #include "MagickCore/option.h" @@ -70,9 +71,9 @@ #include "MagickCore/static.h" #include "MagickCore/string_.h" #include "MagickCore/module.h" +#include "MagickCore/timer-private.h" #include "MagickCore/token.h" #include "MagickCore/utility.h" -#include "MagickCore/module.h" /* Define declarations. @@ -1018,7 +1019,7 @@ static MagickBooleanType WritePS3Image(const ImageInfo *image_info,Image *image, (void) FormatLocaleString(buffer,MagickPathExtent,"%%%%Title: %s\n", image->filename); (void) WriteBlobString(image,buffer); - timer=time((time_t *) NULL); + timer=GetMagickTime(); (void) FormatMagickTime(timer,MagickPathExtent,date); (void) FormatLocaleString(buffer,MagickPathExtent, "%%%%CreationDate: %s\n",date); diff --git a/configure b/configure index cb8bf5e31..a80bb605e 100755 --- a/configure +++ b/configure @@ -4570,7 +4570,7 @@ MAGICK_PATCHLEVEL_VERSION=41 MAGICK_VERSION=7.0.8-41 -MAGICK_GIT_REVISION=15514:5e0211cfa:20190413 +MAGICK_GIT_REVISION=15524:68c4a9ce9:20190415 # Substitute library versioning