summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-09-30 09:59:13 +0200
committerdefault <nobody@localhost>2022-09-30 09:59:13 +0200
commita52840414d2c8482e1d27ec9d0da7babcf2eb545 (patch)
tree30451ddc3216cbca07a7126caed8fbc5510680d8 /data.c
parent3d544233a63a2105d8d91e7fd4f62f7703fef6e0 (diff)
Use doubles instead of floats.
Diffstat (limited to 'data.c')
-rw-r--r--data.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/data.c b/data.c
index 5eb729c..4aba816 100644
--- a/data.c
+++ b/data.c
@@ -172,14 +172,14 @@ d_char *user_list(void)
}
-float mtime(char *fn)
+double mtime(char *fn)
/* returns the mtime of a file or directory, or 0.0 */
{
struct stat st;
- float r = 0.0;
+ double r = 0.0;
if (fn && stat(fn, &st) != -1)
- r = (float)st.st_mtim.tv_sec;
+ r = (double)st.st_mtim.tv_sec;
return r;
}
@@ -275,7 +275,7 @@ d_char *follower_list(snac *snac)
}
-float timeline_mtime(snac *snac)
+double timeline_mtime(snac *snac)
{
xs *fn = xs_fmt("%s/timeline", snac->basedir);
return mtime(fn);
@@ -769,8 +769,8 @@ int actor_get(snac *snac, char *actor, d_char **data)
/* returns an already downloaded actor */
{
xs *fn = _actor_fn(snac, actor);
- float t;
- float max_time;
+ double t;
+ double max_time;
int status;
FILE *f;
@@ -783,7 +783,7 @@ int actor_get(snac *snac, char *actor, d_char **data)
/* maximum time for the actor data to be considered stale */
max_time = 3600.0 * 36.0;
- if (t + max_time < (float) time(NULL)) {
+ if (t + max_time < (double) time(NULL)) {
/* actor data exists but also stinks */
if ((f = fopen(fn, "a")) != NULL) {
@@ -845,9 +845,9 @@ d_char *_history_fn(snac *snac, char *id)
}
-float history_mtime(snac *snac, char * id)
+double history_mtime(snac *snac, char * id)
{
- float t = 0.0;
+ double t = 0.0;
xs *fn = _history_fn(snac, id);
if (fn != NULL)