diff options
| author | 2022-09-30 09:59:13 +0200 | |
|---|---|---|
| committer | 2022-09-30 09:59:13 +0200 | |
| commit | a52840414d2c8482e1d27ec9d0da7babcf2eb545 (patch) | |
| tree | 30451ddc3216cbca07a7126caed8fbc5510680d8 /data.c | |
| parent | Timeline is cached. (diff) | |
| download | snac2-a52840414d2c8482e1d27ec9d0da7babcf2eb545.tar.gz snac2-a52840414d2c8482e1d27ec9d0da7babcf2eb545.tar.xz snac2-a52840414d2c8482e1d27ec9d0da7babcf2eb545.zip | |
Use doubles instead of floats.
Diffstat (limited to 'data.c')
| -rw-r--r-- | data.c | 18 |
1 files changed, 9 insertions, 9 deletions
| @@ -172,14 +172,14 @@ d_char *user_list(void) | |||
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | 174 | ||
| 175 | float mtime(char *fn) | 175 | double mtime(char *fn) |
| 176 | /* returns the mtime of a file or directory, or 0.0 */ | 176 | /* returns the mtime of a file or directory, or 0.0 */ |
| 177 | { | 177 | { |
| 178 | struct stat st; | 178 | struct stat st; |
| 179 | float r = 0.0; | 179 | double r = 0.0; |
| 180 | 180 | ||
| 181 | if (fn && stat(fn, &st) != -1) | 181 | if (fn && stat(fn, &st) != -1) |
| 182 | r = (float)st.st_mtim.tv_sec; | 182 | r = (double)st.st_mtim.tv_sec; |
| 183 | 183 | ||
| 184 | return r; | 184 | return r; |
| 185 | } | 185 | } |
| @@ -275,7 +275,7 @@ d_char *follower_list(snac *snac) | |||
| 275 | } | 275 | } |
| 276 | 276 | ||
| 277 | 277 | ||
| 278 | float timeline_mtime(snac *snac) | 278 | double timeline_mtime(snac *snac) |
| 279 | { | 279 | { |
| 280 | xs *fn = xs_fmt("%s/timeline", snac->basedir); | 280 | xs *fn = xs_fmt("%s/timeline", snac->basedir); |
| 281 | return mtime(fn); | 281 | return mtime(fn); |
| @@ -769,8 +769,8 @@ int actor_get(snac *snac, char *actor, d_char **data) | |||
| 769 | /* returns an already downloaded actor */ | 769 | /* returns an already downloaded actor */ |
| 770 | { | 770 | { |
| 771 | xs *fn = _actor_fn(snac, actor); | 771 | xs *fn = _actor_fn(snac, actor); |
| 772 | float t; | 772 | double t; |
| 773 | float max_time; | 773 | double max_time; |
| 774 | int status; | 774 | int status; |
| 775 | FILE *f; | 775 | FILE *f; |
| 776 | 776 | ||
| @@ -783,7 +783,7 @@ int actor_get(snac *snac, char *actor, d_char **data) | |||
| 783 | /* maximum time for the actor data to be considered stale */ | 783 | /* maximum time for the actor data to be considered stale */ |
| 784 | max_time = 3600.0 * 36.0; | 784 | max_time = 3600.0 * 36.0; |
| 785 | 785 | ||
| 786 | if (t + max_time < (float) time(NULL)) { | 786 | if (t + max_time < (double) time(NULL)) { |
| 787 | /* actor data exists but also stinks */ | 787 | /* actor data exists but also stinks */ |
| 788 | 788 | ||
| 789 | if ((f = fopen(fn, "a")) != NULL) { | 789 | if ((f = fopen(fn, "a")) != NULL) { |
| @@ -845,9 +845,9 @@ d_char *_history_fn(snac *snac, char *id) | |||
| 845 | } | 845 | } |
| 846 | 846 | ||
| 847 | 847 | ||
| 848 | float history_mtime(snac *snac, char * id) | 848 | double history_mtime(snac *snac, char * id) |
| 849 | { | 849 | { |
| 850 | float t = 0.0; | 850 | double t = 0.0; |
| 851 | xs *fn = _history_fn(snac, id); | 851 | xs *fn = _history_fn(snac, id); |
| 852 | 852 | ||
| 853 | if (fn != NULL) | 853 | if (fn != NULL) |