Skip to content

Commit

Permalink
cosmetic
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Dec 6, 2023
1 parent 609152b commit 5fe47ac
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 29 deletions.
4 changes: 2 additions & 2 deletions MagickCache/MagickCache.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 1999-2021 ImageMagick Studio LLC, a non-profit organization
Copyright 1999 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
Expand Down Expand Up @@ -29,7 +29,7 @@

#include <limits.h>
#include <MagickCore/MagickCore.h>
#include <MagickCache/version.h>
#include "MagickCache/version.h"

#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion MagickCache/magick-cache-private.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 1999-2021 ImageMagick Studio LLC, a non-profit organization
Copyright 1999 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License. You may
Expand Down
30 changes: 13 additions & 17 deletions MagickCache/magick-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,7 @@ MagickExport MagickBooleanType ClearMagickCacheResourceException(
%
% The format of the GetMagickCacheResourceExtent method is:
%
% const size_t GetMagickCacheResourceExtent(
% const MagickCacheResource *resource)
% size_t GetMagickCacheResourceExtent(const MagickCacheResource *resource)
%
% A description of each parameter follows:
%
Expand Down Expand Up @@ -1023,7 +1022,7 @@ MagickExport MagickBooleanType GetMagickCacheResource(MagickCache *cache,
%
% The format of the GetMagickCacheResourceBlob method is:
%
% const void *GetMagickCacheResourceBlob(MagickCache *cache,
% void *GetMagickCacheResourceBlob(MagickCache *cache,
% MagickCacheResource *resource)
%
% A description of each parameter follows:
Expand Down Expand Up @@ -1344,7 +1343,7 @@ MagickExport MagickBooleanType GetMagickCacheResourceID(MagickCache *cache,
%
% The format of the GetMagickCacheResourceImage method is:
%
% const Image *GetMagickCacheResourceImage(MagickCache *cache,
% Image *GetMagickCacheResourceImage(MagickCache *cache,
% MagickCacheResource *resource,const char *extract)
%
% A description of each parameter follows:
Expand Down Expand Up @@ -1436,7 +1435,7 @@ MagickExport Image *GetMagickCacheResourceImage(MagickCache *cache,
%
% The format of the GetMagickCacheResourceIRI method is:
%
% const char *GetMagickCacheResourceIRI(MagickCacheResource *resource)
% char *GetMagickCacheResourceIRI(MagickCacheResource *resource)
%
% A description of each parameter follows:
%
Expand Down Expand Up @@ -1467,7 +1466,7 @@ MagickExport char *GetMagickCacheResourceIRI(
%
% The format of the GetMagickCacheResourceMeta method is:
%
% const char *GetMagickCacheResourceMeta(MagickCacheResource *resource)
% char *GetMagickCacheResourceMeta(MagickCacheResource *resource)
%
% A description of each parameter follows:
%
Expand Down Expand Up @@ -1529,7 +1528,7 @@ MagickExport char *GetMagickCacheResourceMeta(MagickCache *cache,
%
% The format of the GetMagickCacheResourceSize method is:
%
% const void GetMagickCacheResourceSize(
% void GetMagickCacheResourceSize(
% const MagickCacheResource *resource,size_t *columns,size_t *rows)
%
% A description of each parameter follows:
Expand Down Expand Up @@ -1562,7 +1561,7 @@ MagickExport void GetMagickCacheResourceSize(
%
% The format of the GetMagickCacheResourceTimestamp method is:
%
% const time_t GetMagickCacheResourceTimestamp(
% time_t GetMagickCacheResourceTimestamp(
% const MagickCacheResource *resource)
%
% A description of each parameter follows:
Expand Down Expand Up @@ -1594,8 +1593,7 @@ MagickExport time_t GetMagickCacheResourceTimestamp(
%
% The format of the GetMagickCacheResourceTTL method is:
%
% const time_t GetMagickCacheResourceTTL(
% const MagickCacheResource *resource)
% time_t GetMagickCacheResourceTTL(const MagickCacheResource *resource)
%
% A description of each parameter follows:
%
Expand Down Expand Up @@ -1626,7 +1624,7 @@ MagickExport time_t GetMagickCacheResourceTTL(
%
% The format of the GetMagickCacheResourceType method is:
%
% const MagickCacheResourceType GetMagickCacheResourceType(
% MagickCacheResourceType GetMagickCacheResourceType(
% const MagickCacheResource *resource)
%
% A description of each parameter follows:
Expand Down Expand Up @@ -1658,7 +1656,7 @@ MagickExport MagickCacheResourceType GetMagickCacheResourceType(
%
% The format of the GetMagickCacheResourceVersion method is:
%
% const size_t GetMagickCacheResourceVersion(
% size_t GetMagickCacheResourceVersion(
% const MagickCacheResource *resource)
%
% A description of each parameter follows:
Expand Down Expand Up @@ -1690,7 +1688,7 @@ MagickExport size_t GetMagickCacheResourceVersion(
%
% The format of the GetMagickCacheResource method is:
%
% const time_t GetMagickCacheResourceTimestamp(const MagickCache *cache)
% time_t GetMagickCacheResourceTimestamp(const MagickCache *cache)
%
% A description of each parameter follows:
%
Expand Down Expand Up @@ -1770,8 +1768,7 @@ MagickExport MagickBooleanType IdentifyMagickCacheResource(MagickCache *cache,
(void) GetMagickUTCTime(&resource->timestamp,&timestamp);
(void) strftime(iso8601,sizeof(iso8601),"%FT%TZ",&timestamp);
expired=' ';
if ((resource->ttl != 0) &&
(difftime(time(0),resource->timestamp) > (double) resource->ttl))
if ((resource->ttl != 0) && ((resource->timestamp+resource->ttl) < time(0)))
expired='*';
(void) fprintf(file,"%s%s %s %g:%g:%g:%g%c %s\n",GetMagickCacheResourceIRI(
resource),size,extent,(double) (resource->ttl/(3600*24)),(double)
Expand Down Expand Up @@ -1819,8 +1816,7 @@ MagickExport MagickBooleanType IsMagickCacheResourceExpired(MagickCache *cache,
status=GetMagickCacheResource(cache,resource);
if (status == MagickFalse)
return(status);
if ((resource->ttl != 0) &&
(difftime(time(0),resource->timestamp) > (double) resource->ttl))
if ((resource->ttl != 0) && ((resource->timestamp+resource->ttl) <= time(0)))
{
errno=ESTALE;
return(MagickTrue);
Expand Down
2 changes: 1 addition & 1 deletion MagickCache/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
% March 2022 %
% %
% %
% Copyright 1999-2021 ImageMagick Studio LLC, a non-profit organization %
% Copyright 1999 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,15 @@ AUTOHEADER = ${SHELL} '/home/cristy/MagickCache/missing' autoheader
AUTOMAKE = ${SHELL} '/home/cristy/MagickCache/missing' automake-1.16
AWK = gawk
CC = gcc
CCDEPMODE = depmode=none
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2
CPP = gcc -E
CPPFLAGS =
CSCOPE = cscope
CTAGS = ctags
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=none
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -g -O2
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
Expand Down Expand Up @@ -256,7 +256,7 @@ LIPO =
LN_S = ln -s
LTLIBOBJS =
LT_SYS_LIBRARY_PATH =
MAGICKCACHE_GIT_REVISION = 212:ad75fab:20231204
MAGICKCACHE_GIT_REVISION = 213:609152b:20231205
MAGICKCACHE_LIBRARY_AGE = 0
MAGICKCACHE_LIBRARY_CURRENT = 0
MAGICKCACHE_LIBRARY_CURRENT_MIN = 0
Expand All @@ -271,8 +271,8 @@ MAGICKCACHE_MINOR_VERSION = 0
MAGICKCACHE_PATCHLEVEL_VERSION = 1
MAGICKCACHE_PCFLAGS =
MAGICKCACHE_VERSION = 1.0.0-1
MAGICKCORE_CFLAGS = -I/usr/local/include/ImageMagick-7 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=64
MAGICKCORE_LIBS = -L/usr/local/lib -lMagickCore-7.Q16HDRI
MAGICKCORE_CFLAGS = -I/usr/include/ImageMagick-7 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16
MAGICKCORE_LIBS = -lMagickCore-7.Q16HDRI
MAGICKPP_LIB_VERSION_TEXT = 1.0.0
MAKEINFO = ${SHELL} '/home/cristy/MagickCache/missing' makeinfo
MANIFEST_TOOL = :
Expand All @@ -299,7 +299,7 @@ PACKAGE_VERSION_ADDENDUM = -1
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
PKG_CONFIG_PATH = /usr/local//lib/pkgconfig
PKG_CONFIG_PATH =
RANLIB = ranlib
SED = /usr/bin/sed
SET_MAKE =
Expand Down
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -3953,7 +3953,7 @@ MAGICKCACHE_PATCHLEVEL_VERSION=1

MAGICKCACHE_VERSION=1.0.0-1

MAGICKCACHE_GIT_REVISION=212:ad75fab:20231204
MAGICKCACHE_GIT_REVISION=213:609152b:20231205


# Substitute library versioning
Expand Down
2 changes: 1 addition & 1 deletion tests/magick-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ static MagickBooleanType MagickCacheCLI(int argc,char **argv,
(void) FormatLocaleFile(stdout,"%g: put magick cache (image)\n",(double)
tests);
tests++;
(void) strcpy(image_info->filename,"rose.miff");
(void) strcpy(image_info->filename,"rose:");
if (cache != (MagickCache *) NULL)
rose=ReadImage(image_info,exception);
if ((cache != (MagickCache *) NULL) &&
Expand Down

0 comments on commit 5fe47ac

Please sign in to comment.