summaryrefslogtreecommitdiff
path: root/legacy/embryo/src/lib/embryo_time.c
diff options
context:
space:
mode:
authordoursse <doursse>2008-04-11 19:06:18 +0000
committerdoursse <doursse@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2008-04-11 19:06:18 +0000
commita86946850d08ae3271ee64ffcb35cfbbe40faf3b (patch)
tree524005b8f2adfff14d0807fa96f7b0a3f37a808f /legacy/embryo/src/lib/embryo_time.c
parent9817e365b151b73a2b960252580b1890ddd07358 (diff)
remove trailing spaces and add indent doc for vi
SVN revision: 34246
Diffstat (limited to '')
-rw-r--r--legacy/embryo/src/lib/embryo_time.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/legacy/embryo/src/lib/embryo_time.c b/legacy/embryo/src/lib/embryo_time.c
index beaa9b3a19..e0794c3bb8 100644
--- a/legacy/embryo/src/lib/embryo_time.c
+++ b/legacy/embryo/src/lib/embryo_time.c
@@ -1,6 +1,7 @@
1/* 1/*
2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
3 */ 3 */
4
4#include "embryo_private.h" 5#include "embryo_private.h"
5#include <sys/time.h> 6#include <sys/time.h>
6#include <time.h> 7#include <time.h>
@@ -17,7 +18,7 @@ _embryo_time_seconds(Embryo_Program *ep __UNUSED__, Embryo_Cell *params __UNUSED
17 struct timeval timev; 18 struct timeval timev;
18 double t; 19 double t;
19 float f; 20 float f;
20 21
21 gettimeofday(&timev, NULL); 22 gettimeofday(&timev, NULL);
22 t = (double)(timev.tv_sec - ((timev.tv_sec / (60 * 60 * 24)) * (60 * 60 * 24))) 23 t = (double)(timev.tv_sec - ((timev.tv_sec / (60 * 60 * 24)) * (60 * 60 * 24)))
23 + (((double)timev.tv_usec) / 1000000); 24 + (((double)timev.tv_usec) / 1000000);
@@ -31,7 +32,7 @@ _embryo_time_date(Embryo_Program *ep, Embryo_Cell *params)
31 struct timeval timev; 32 struct timeval timev;
32 struct tm *tm; 33 struct tm *tm;
33 time_t tt; 34 time_t tt;
34 35
35 if (params[0] != (8 * sizeof(Embryo_Cell))) return 0; 36 if (params[0] != (8 * sizeof(Embryo_Cell))) return 0;
36 gettimeofday(&timev, NULL); 37 gettimeofday(&timev, NULL);
37 tt = (time_t)(timev.tv_sec); 38 tt = (time_t)(timev.tv_sec);
@@ -41,7 +42,7 @@ _embryo_time_date(Embryo_Program *ep, Embryo_Cell *params)
41 Embryo_Cell *cptr; 42 Embryo_Cell *cptr;
42 double t; 43 double t;
43 float f; 44 float f;
44 45
45 cptr = embryo_data_address_get(ep, params[1]); 46 cptr = embryo_data_address_get(ep, params[1]);
46 if (cptr) *cptr = tm->tm_year + 1900; 47 if (cptr) *cptr = tm->tm_year + 1900;
47 cptr = embryo_data_address_get(ep, params[2]); 48 cptr = embryo_data_address_get(ep, params[2]);
@@ -60,7 +61,7 @@ _embryo_time_date(Embryo_Program *ep, Embryo_Cell *params)
60 t = (double)tm->tm_sec + (((double)timev.tv_usec) / 1000000); 61 t = (double)tm->tm_sec + (((double)timev.tv_usec) / 1000000);
61 f = (float)t; 62 f = (float)t;
62 if (cptr) *cptr = EMBRYO_FLOAT_TO_CELL(f); 63 if (cptr) *cptr = EMBRYO_FLOAT_TO_CELL(f);
63 64
64 } 65 }
65 return 0; 66 return 0;
66} 67}