You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

630 lines
22 KiB

  1. --- a/src/parsetime.c
  2. +++ b/src/parsetime.c
  3. @@ -715,7 +715,7 @@ day(struct rrd_time_value *ptv)
  4. tlen = strlen(sc_token);
  5. mon = atol(sc_token);
  6. if (mon > 10*365*24*60*60) {
  7. - montime = mon;
  8. + montime = (time_t) mon;
  9. ptv->tm=*localtime(&montime);
  10. token();
  11. break;
  12. @@ -914,8 +914,11 @@ parsetime(char *tspec, struct rrd_time_v
  13. int proc_start_end (struct rrd_time_value *start_tv,
  14. struct rrd_time_value *end_tv,
  15. - time_t *start,
  16. - time_t *end){
  17. + TIME_INT *start,
  18. + TIME_INT *end){
  19. +
  20. + time_t end_t, start_t;
  21. +
  22. if (start_tv->type == RELATIVE_TO_END_TIME && /* same as the line above */
  23. end_tv->type == RELATIVE_TO_START_TIME) {
  24. rrd_set_error("the start and end times cannot be specified "
  25. @@ -935,25 +938,27 @@ int proc_start_end (struct rrd_time_valu
  26. if( start_tv->type == RELATIVE_TO_END_TIME) {
  27. struct tm tmtmp;
  28. - *end = mktime(&(end_tv->tm)) + end_tv->offset;
  29. - tmtmp = *localtime(end); /* reinit end including offset */
  30. + end_t = mktime(&(end_tv->tm)) + end_tv->offset;
  31. + *end = (TIME_INT) end_t;
  32. + tmtmp = *localtime(&end_t); /* reinit end including offset */
  33. tmtmp.tm_mday += start_tv->tm.tm_mday;
  34. tmtmp.tm_mon += start_tv->tm.tm_mon;
  35. tmtmp.tm_year += start_tv->tm.tm_year;
  36. - *start = mktime(&tmtmp) + start_tv->offset;
  37. + *start = (TIME_INT) mktime(&tmtmp) + start_tv->offset;
  38. } else {
  39. - *start = mktime(&(start_tv->tm)) + start_tv->offset;
  40. + *start = (TIME_INT) mktime(&(start_tv->tm)) + start_tv->offset;
  41. }
  42. if (end_tv->type == RELATIVE_TO_START_TIME) {
  43. struct tm tmtmp;
  44. - *start = mktime(&(start_tv->tm)) + start_tv->offset;
  45. - tmtmp = *localtime(start);
  46. + start_t = mktime(&(start_tv->tm)) + start_tv->offset;
  47. + *start = (TIME_INT) start_t;
  48. + tmtmp = *localtime(&start_t);
  49. tmtmp.tm_mday += end_tv->tm.tm_mday;
  50. tmtmp.tm_mon += end_tv->tm.tm_mon;
  51. tmtmp.tm_year += end_tv->tm.tm_year;
  52. - *end = mktime(&tmtmp) + end_tv->offset;
  53. + *end = (TIME_INT) mktime(&tmtmp) + end_tv->offset;
  54. } else {
  55. - *end = mktime(&(end_tv->tm)) + end_tv->offset;
  56. + *end = (TIME_INT) mktime(&(end_tv->tm)) + end_tv->offset;
  57. }
  58. return 0;
  59. } /* proc_start_end */
  60. --- a/src/rrd_cgi.c
  61. +++ b/src/rrd_cgi.c
  62. @@ -352,7 +352,7 @@ int main(int argc, char *argv[]) {
  63. time_t now;
  64. now = time(NULL);
  65. printf("Last-Modified: %s\n", http_time(&now));
  66. - now += labs(goodfor);
  67. + now += (time_t) labs(goodfor);
  68. printf("Expires: %s\n", http_time(&now));
  69. if (goodfor < 0) {
  70. printf("Refresh: %ld\n", labs(goodfor));
  71. @@ -491,6 +491,7 @@ char* printstrftime(long argc, char **ar
  72. char formatted[MAX_STRFTIME_SIZE];
  73. struct tm *the_tm;
  74. time_t start_tmp, end_tmp;
  75. + TIME_INT start_tmp_t, end_tmp_t;
  76. /* Make sure that we were given the right number of args */
  77. if( argc != 4) {
  78. @@ -511,15 +512,17 @@ char* printstrftime(long argc, char **ar
  79. rrd_set_error( "end time: %s", parsetime_error);
  80. return (char *) -1;
  81. }
  82. - if( proc_start_end( &start_tv, &end_tv, &start_tmp, &end_tmp) == -1) {
  83. + if( proc_start_end( &start_tv, &end_tv, &start_tmp_t, &end_tmp_t) == -1) {
  84. return (char *) -1;
  85. }
  86. /* Do we do the start or end */
  87. if( strcasecmp( args[0], "START") == 0) {
  88. + start_tmp = (time_t) start_tmp_t;
  89. the_tm = localtime( &start_tmp);
  90. }
  91. else if( strcasecmp( args[0], "END") == 0) {
  92. + end_tmp = (time_t) end_tmp_t;
  93. the_tm = localtime( &end_tmp);
  94. }
  95. else {
  96. @@ -726,7 +729,7 @@ char* printtimelast(long argc, char **ar
  97. if (buf == NULL){
  98. return stralloc("[ERROR: allocating strftime buffer]");
  99. };
  100. - last = rrd_last(argc+1, args-1);
  101. + last = (time_t) rrd_last(argc+1, args-1);
  102. if (rrd_test_error()) {
  103. char *err = malloc((strlen(rrd_get_error())+DS_NAM_SIZE)*sizeof(char));
  104. sprintf(err, "[ERROR: %s]",rrd_get_error());
  105. --- a/src/rrd_create.c
  106. +++ b/src/rrd_create.c
  107. @@ -12,12 +12,12 @@ rrd_create(int argc, char **argv)
  108. {
  109. rrd_t rrd;
  110. long i,long_tmp;
  111. - time_t last_up;
  112. + TIME_INT last_up;
  113. struct rrd_time_value last_up_tv;
  114. char *parsetime_error = NULL;
  115. /* init last_up */
  116. - last_up = time(NULL)-10;
  117. + last_up = (TIME_INT) time(NULL)-10;
  118. /* init rrd clean */
  119. rrd_init(&rrd);
  120. /* static header */
  121. @@ -74,7 +74,7 @@ rrd_create(int argc, char **argv)
  122. return(-1);
  123. }
  124. - last_up = mktime(&last_up_tv.tm) + last_up_tv.offset;
  125. + last_up = (TIME_INT) mktime(&last_up_tv.tm) + last_up_tv.offset;
  126. if (last_up < 3600*24*365*10){
  127. rrd_set_error("the first entry to the RRD should be after 1980");
  128. --- a/src/rrd_dump.c
  129. +++ b/src/rrd_dump.c
  130. @@ -24,6 +24,7 @@ rrd_dump(int argc, char **argv)
  131. long rra_base, rra_start, rra_next;
  132. FILE *in_file;
  133. rrd_t rrd;
  134. + time_t lastup_t;
  135. if(rrd_open(argv[1],&in_file,&rrd, RRD_READONLY)==-1){
  136. @@ -34,8 +35,9 @@ rrd_dump(int argc, char **argv)
  137. printf("\t<version> %s </version>\n",rrd.stat_head->version);
  138. printf("\t<step> %lu </step> <!-- Seconds -->\n",rrd.stat_head->pdp_step);
  139. #if HAVE_STRFTIME
  140. + lastup_t = (time_t) rrd.live_head->last_up;
  141. strftime(somestring,200,"%Y-%m-%d %H:%M:%S %Z",
  142. - localtime(&rrd.live_head->last_up));
  143. + localtime(&lastup_t));
  144. #else
  145. # error "Need strftime"
  146. #endif
  147. @@ -115,10 +117,10 @@ rrd_dump(int argc, char **argv)
  148. fseek(in_file,rra_start,SEEK_SET);
  149. ii=0; /* wrap if max row cnt is reached */
  150. }
  151. - now = (rrd.live_head->last_up
  152. + now = (time_t) ((rrd.live_head->last_up
  153. - rrd.live_head->last_up
  154. % (rrd.rra_def[i].pdp_cnt*rrd.stat_head->pdp_step))
  155. - + (timer*rrd.rra_def[i].pdp_cnt*rrd.stat_head->pdp_step);
  156. + + (timer*rrd.rra_def[i].pdp_cnt*rrd.stat_head->pdp_step));
  157. timer++;
  158. #if HAVE_STRFTIME
  159. --- a/src/rrd_fetch.c
  160. +++ b/src/rrd_fetch.c
  161. @@ -16,8 +16,8 @@
  162. int
  163. rrd_fetch(int argc,
  164. char **argv,
  165. - time_t *start,
  166. - time_t *end, /* which time frame do you want ?
  167. + TIME_INT *start,
  168. + TIME_INT *end, /* which time frame do you want ?
  169. * will be changed to represent reality */
  170. unsigned long *step, /* which stepsize do you want?
  171. * will be changed to represent reality */
  172. @@ -28,7 +28,7 @@ rrd_fetch(int argc,
  173. long step_tmp =1;
  174. - time_t start_tmp=0, end_tmp=0;
  175. + TIME_INT start_tmp=0, end_tmp=0;
  176. enum cf_en cf_idx;
  177. struct rrd_time_value start_tv, end_tv;
  178. @@ -119,8 +119,8 @@ int
  179. rrd_fetch_fn(
  180. char *filename, /* name of the rrd */
  181. enum cf_en cf_idx, /* which consolidation function ?*/
  182. - time_t *start,
  183. - time_t *end, /* which time frame do you want ?
  184. + TIME_INT *start,
  185. + TIME_INT *end, /* which time frame do you want ?
  186. * will be changed to represent reality */
  187. unsigned long *step, /* which stepsize do you want?
  188. * will be changed to represent reality */
  189. @@ -130,7 +130,7 @@ rrd_fetch_fn(
  190. {
  191. long i,ii;
  192. FILE *in_file;
  193. - time_t cal_start,cal_end, rra_start_time,rra_end_time;
  194. + TIME_INT cal_start,cal_end, rra_start_time,rra_end_time;
  195. long best_full_rra=0, best_part_rra=0, chosen_rra=0, rra_pointer=0;
  196. long best_step_diff=0, tmp_step_diff=0, tmp_match=0, best_match=0;
  197. long full_match, rra_base;
  198. --- a/src/rrd_first.c
  199. +++ b/src/rrd_first.c
  200. @@ -8,13 +8,13 @@
  201. #include "rrd_tool.h"
  202. -time_t
  203. +TIME_INT
  204. rrd_first(int argc, char **argv)
  205. {
  206. long rra_start,
  207. timer;
  208. unsigned long target_rraindex=0;
  209. - time_t then;
  210. + TIME_INT then;
  211. char *endptr;
  212. FILE *in_file;
  213. rrd_t rrd;
  214. --- a/src/rrd_format.h
  215. +++ b/src/rrd_format.h
  216. @@ -200,7 +200,7 @@ typedef struct rra_def_t {
  217. ****************************************************************************/
  218. typedef struct live_head_t {
  219. - time_t last_up; /* when was rrd last updated */
  220. + TIME_INT last_up; /* when was rrd last updated */
  221. } live_head_t;
  222. --- a/src/rrd_graph.c
  223. +++ b/src/rrd_graph.c
  224. @@ -123,7 +123,7 @@ col_trip_t graph_col[] = { /* default co
  225. * ((double)(x) - im->start)+0.5) */
  226. /* initialize with xtr(im,0); */
  227. int
  228. -xtr(image_desc_t *im,time_t mytime){
  229. +xtr(image_desc_t *im,TIME_INT mytime){
  230. static double pixie;
  231. if (mytime==0){
  232. pixie = (double) im->xsize / (double)(im->end - im->start);
  233. @@ -486,8 +486,8 @@ void
  234. reduce_data(
  235. enum cf_en cf, /* which consolidation function ?*/
  236. unsigned long cur_step, /* step the data currently is in */
  237. - time_t *start, /* start, end and step as requested ... */
  238. - time_t *end, /* ... by the application will be ... */
  239. + TIME_INT *start, /* start, end and step as requested ... */
  240. + TIME_INT *end, /* ... by the application will be ... */
  241. unsigned long *step, /* ... adjusted to represent reality */
  242. unsigned long *ds_cnt, /* number of data sources in file */
  243. rrd_value_t **data) /* two dimensional array containing the data */
  244. @@ -853,18 +853,20 @@ str2rpn(image_desc_t *im,char *expr){
  245. time was. Return it in seconds */
  246. int
  247. -tzoffset( time_t now ){
  248. +tzoffset( TIME_INT now ){
  249. int gm_sec, gm_min, gm_hour, gm_yday, gm_year,
  250. l_sec, l_min, l_hour, l_yday, l_year;
  251. struct tm *t;
  252. int off;
  253. - t = gmtime(&now);
  254. + time_t now_t;
  255. + now_t = (time_t) now;
  256. + t = gmtime(&now_t);
  257. gm_sec = t->tm_sec;
  258. gm_min = t->tm_min;
  259. gm_hour = t->tm_hour;
  260. gm_yday = t->tm_yday;
  261. gm_year = t->tm_year;
  262. - t = localtime(&now);
  263. + t = localtime(&now_t);
  264. l_sec = t->tm_sec;
  265. l_min = t->tm_min;
  266. l_hour = t->tm_hour;
  267. @@ -893,7 +895,7 @@ data_calc( image_desc_t *im){
  268. int dataidx;
  269. long *steparray;
  270. int stepcnt;
  271. - time_t now;
  272. + TIME_INT now;
  273. double *stack = NULL;
  274. long dc_stacksize = 0;
  275. @@ -1433,14 +1435,16 @@ data_proc( image_desc_t *im ){
  276. /* identify the point where the first gridline, label ... gets placed */
  277. -time_t
  278. +TIME_INT
  279. find_first_time(
  280. - time_t start, /* what is the initial time */
  281. + TIME_INT start_t, /* what is the initial time */
  282. enum tmt_en baseint, /* what is the basic interval */
  283. long basestep /* how many if these do we jump a time */
  284. )
  285. {
  286. struct tm tm;
  287. + time_t start;
  288. + start = (time_t) start_t;
  289. tm = *localtime(&start);
  290. switch(baseint){
  291. case TMT_SECOND:
  292. @@ -1485,15 +1489,17 @@ find_first_time(
  293. return mktime(&tm);
  294. }
  295. /* identify the point where the next gridline, label ... gets placed */
  296. -time_t
  297. +TIME_INT
  298. find_next_time(
  299. - time_t current, /* what is the initial time */
  300. + TIME_INT current_t, /* what is the initial time */
  301. enum tmt_en baseint, /* what is the basic interval */
  302. long basestep /* how many if these do we jump a time */
  303. )
  304. {
  305. struct tm tm;
  306. - time_t madetime;
  307. + time_t current;
  308. + current = (time_t) current_t;
  309. + TIME_INT madetime;
  310. tm = *localtime(&current);
  311. do {
  312. switch(baseint){
  313. @@ -2143,7 +2149,8 @@ vertical_grid(
  314. image_desc_t *im )
  315. {
  316. int xlab_sel; /* which sort of label and grid ? */
  317. - time_t ti, tilab;
  318. + TIME_INT ti, tilab;
  319. + time_t tilab_t;
  320. long factor;
  321. char graph_label[100];
  322. gdPoint polyPoints[4]; /* points for filled graph and more*/
  323. @@ -2231,9 +2238,10 @@ vertical_grid(
  324. ){
  325. int gr_pos,width;
  326. tilab= ti + im->xlab_user.precis/2; /* correct time for the label */
  327. + tilab_t = (time_t) tilab;
  328. #if HAVE_STRFTIME
  329. - strftime(graph_label,99,im->xlab_user.stst,localtime(&tilab));
  330. + strftime(graph_label,99,im->xlab_user.stst,localtime(&tilab_t));
  331. #else
  332. # error "your libc has no strftime I guess we'll abort the exercise here."
  333. #endif
  334. @@ -2487,7 +2495,7 @@ int lazy_check(image_desc_t *im){
  335. return 0; /* can't stat */
  336. /* one pixel in the existing graph is more then what we would
  337. change here ... */
  338. - if (time(NULL) - gifstat.st_mtime >
  339. + if ((TIME_INT) time(NULL) - gifstat.st_mtime >
  340. (im->end - im->start) / im->xsize)
  341. return 0;
  342. if ((fd = fopen(im->graphfile,"rb")) == NULL)
  343. @@ -2881,7 +2889,7 @@ rrd_graph(int argc, char **argv, char **
  344. image_desc_t im;
  345. int i;
  346. long long_tmp;
  347. - time_t start_tmp=0,end_tmp=0;
  348. + TIME_INT start_tmp=0,end_tmp=0;
  349. char scan_gtm[12],scan_mtm[12],scan_ltm[12],col_nam[12];
  350. char symname[100];
  351. unsigned int col_red,col_green,col_blue;
  352. --- a/src/rrd_graph.h
  353. +++ b/src/rrd_graph.h
  354. @@ -90,11 +90,11 @@ typedef struct graph_desc_t {
  355. char legend[FMT_LEG_LEN+5]; /* legend*/
  356. gdPoint legloc; /* location of legend */
  357. double yrule; /* value for y rule line */
  358. - time_t xrule; /* value for x rule line */
  359. + TIME_INT xrule; /* value for x rule line */
  360. rpnp_t *rpnp; /* instructions for CDEF function */
  361. /* description of data fetched for the graph element */
  362. - time_t start,end; /* timestaps for first and last data element */
  363. + TIME_INT start,end; /* timestaps for first and last data element */
  364. unsigned long step; /* time between samples */
  365. unsigned long ds_cnt; /* how many data sources are there in the fetch */
  366. long data_first; /* first pointer to this data */
  367. @@ -121,7 +121,7 @@ typedef struct image_desc_t {
  368. double ygridstep; /* user defined step for y grid */
  369. int ylabfact; /* every how many y grid shall a label be written ? */
  370. - time_t start,end; /* what time does the graph cover */
  371. + TIME_INT start,end; /* what time does the graph cover */
  372. unsigned long step; /* any preference for the default step ? */
  373. rrd_value_t minval,maxval; /* extreme values in the data */
  374. int rigid; /* do not expand range even with
  375. @@ -160,7 +160,7 @@ typedef struct image_desc_t {
  376. } image_desc_t;
  377. /* Prototypes */
  378. -int xtr(image_desc_t *,time_t);
  379. +int xtr(image_desc_t *,TIME_INT);
  380. int ytr(image_desc_t *, double);
  381. enum gf_en gf_conv(char *);
  382. enum if_en if_conv(char *);
  383. @@ -170,16 +170,16 @@ int im_free(image_desc_t *);
  384. void auto_scale( image_desc_t *, double *, char **, double *);
  385. void si_unit( image_desc_t *);
  386. void expand_range(image_desc_t *);
  387. -void reduce_data( enum cf_en, unsigned long, time_t *, time_t *, unsigned long *, unsigned long *, rrd_value_t **);
  388. +void reduce_data( enum cf_en, unsigned long, TIME_INT *, TIME_INT *, unsigned long *, unsigned long *, rrd_value_t **);
  389. int data_fetch( image_desc_t *);
  390. long find_var(image_desc_t *, char *);
  391. long lcd(long *);
  392. int data_calc( image_desc_t *);
  393. int data_proc( image_desc_t *);
  394. -time_t find_first_time( time_t, enum tmt_en, long);
  395. -time_t find_next_time( time_t, enum tmt_en, long);
  396. +TIME_INT find_first_time( TIME_INT, enum tmt_en, long);
  397. +TIME_INT find_next_time( TIME_INT, enum tmt_en, long);
  398. void gator( gdImagePtr, int, int);
  399. -int tzoffset(time_t);
  400. +int tzoffset(TIME_INT);
  401. int print_calc(image_desc_t *, char ***);
  402. int leg_place(image_desc_t *);
  403. int horizontal_grid(gdImagePtr, image_desc_t *);
  404. --- a/src/rrd.h
  405. +++ b/src/rrd.h
  406. @@ -17,6 +17,9 @@ extern "C" {
  407. #define _RRDLIB_H
  408. #include <time.h>
  409. +#include <stdint.h>
  410. +
  411. +#define TIME_INT long
  412. /* Transplanted from rrd_format.h */
  413. typedef double rrd_value_t; /* the data storage type is
  414. @@ -27,15 +30,15 @@ typedef double rrd_value_t;
  415. int rrd_create(int, char **);
  416. int rrd_update(int, char **);
  417. int rrd_graph(int, char **, char ***, int *, int *);
  418. -int rrd_fetch(int, char **, time_t *, time_t *, unsigned long *,
  419. +int rrd_fetch(int, char **, TIME_INT *, TIME_INT *, unsigned long *,
  420. unsigned long *, char ***, rrd_value_t **);
  421. int rrd_restore(int, char **);
  422. int rrd_dump(int, char **);
  423. int rrd_tune(int, char **);
  424. -time_t rrd_last(int, char **);
  425. -time_t rrd_first(int, char **);
  426. +TIME_INT rrd_last(int, char **);
  427. +TIME_INT rrd_first(int, char **);
  428. int rrd_resize(int, char **);
  429. -int rrd_xport(int, char **, int *, time_t *, time_t *,
  430. +int rrd_xport(int, char **, int *, TIME_INT *, TIME_INT *,
  431. unsigned long *, unsigned long *,
  432. char ***, rrd_value_t **);
  433. @@ -57,7 +60,7 @@ struct rrd_time_value {
  434. char *parsetime(char *spec, struct rrd_time_value *ptv);
  435. /* END parsetime.h */
  436. -int proc_start_end (struct rrd_time_value *, struct rrd_time_value *, time_t *, time_t *);
  437. +int proc_start_end (struct rrd_time_value *, struct rrd_time_value *, TIME_INT *, TIME_INT *);
  438. /* HELPER FUNCTIONS */
  439. void rrd_set_error(char *,...);
  440. --- a/src/rrd_last.c
  441. +++ b/src/rrd_last.c
  442. @@ -8,11 +8,11 @@
  443. #include "rrd_tool.h"
  444. -time_t
  445. +TIME_INT
  446. rrd_last(int argc, char **argv)
  447. {
  448. FILE *in_file;
  449. - time_t lastup;
  450. + TIME_INT lastup;
  451. rrd_t rrd;
  452. --- a/src/rrd_tool.c
  453. +++ b/src/rrd_tool.c
  454. @@ -343,7 +343,7 @@ int HandleInputLine(int argc, char **arg
  455. else if (strcmp("update", argv[1]) == 0)
  456. rrd_update(argc-1, &argv[1]);
  457. else if (strcmp("fetch", argv[1]) == 0) {
  458. - time_t start,end;
  459. + TIME_INT start,end;
  460. unsigned long step, ds_cnt,i,ii;
  461. rrd_value_t *data,*datai;
  462. char **ds_namv;
  463. @@ -367,7 +367,7 @@ int HandleInputLine(int argc, char **arg
  464. } else if (strcmp("xport", argv[1]) == 0) {
  465. int xxsize;
  466. int j;
  467. - time_t i,start,end;
  468. + TIME_INT i,start,end;
  469. unsigned long step, col_cnt,row_cnt;
  470. rrd_value_t *data,*ptr;
  471. char **legend_v;
  472. --- a/src/rrd_tool.h
  473. +++ b/src/rrd_tool.h
  474. @@ -134,7 +134,7 @@ void gdImagePng(gdImagePtr im, FILE *out
  475. int rrd_create_fn(char *file_name, rrd_t *rrd);
  476. int rrd_fetch_fn(char *filename, enum cf_en cf_idx,
  477. - time_t *start,time_t *end,
  478. + TIME_INT *start,TIME_INT *end,
  479. unsigned long *step,
  480. unsigned long *ds_cnt,
  481. char ***ds_namv,
  482. --- a/src/rrd_update.c
  483. +++ b/src/rrd_update.c
  484. @@ -91,7 +91,7 @@ rrd_update(int argc, char **argv)
  485. FILE *rrd_file;
  486. rrd_t rrd;
  487. - time_t current_time = time(NULL);
  488. + TIME_INT current_time = (TIME_INT) time(NULL);
  489. char **updvals;
  490. int wrote_to_file = 0;
  491. char *template = NULL;
  492. @@ -273,7 +273,7 @@ rrd_update(int argc, char **argv)
  493. /* get the time from the reading ... handle N */
  494. if (strcmp(updvals[0],"N")==0){
  495. - current_time = time(NULL);
  496. + current_time = (TIME_INT) time(NULL);
  497. } else {
  498. errno = 0;
  499. current_time = strtol(updvals[0],&endptr,10);
  500. --- a/src/rrd_xport.c
  501. +++ b/src/rrd_xport.c
  502. @@ -15,12 +15,12 @@
  503. int rrd_xport(int, char **, int *,
  504. - time_t *, time_t *,
  505. + TIME_INT *, TIME_INT *,
  506. unsigned long *, unsigned long *,
  507. char ***, rrd_value_t **);
  508. int rrd_xport_fn(image_desc_t *,
  509. - time_t *, time_t *,
  510. + TIME_INT *, TIME_INT *,
  511. unsigned long *, unsigned long *,
  512. char ***, rrd_value_t **);
  513. @@ -29,8 +29,8 @@ int rrd_xport_fn(image_desc_t *,
  514. /* mostly rrd_graph(), just pushed a bit here and stretched a bit there */
  515. int
  516. rrd_xport(int argc, char **argv, int *xsize,
  517. - time_t *start,
  518. - time_t *end, /* which time frame do you want ?
  519. + TIME_INT *start,
  520. + TIME_INT *end, /* which time frame do you want ?
  521. * will be changed to represent reality */
  522. unsigned long *step, /* which stepsize do you want?
  523. * will be changed to represent reality */
  524. @@ -42,7 +42,7 @@ rrd_xport(int argc, char **argv, int *xs
  525. image_desc_t im;
  526. int i;
  527. long long_tmp;
  528. - time_t start_tmp=0,end_tmp=0;
  529. + TIME_INT start_tmp=0,end_tmp=0;
  530. char symname[100];
  531. long scancount;
  532. struct rrd_time_value start_tv, end_tv;
  533. @@ -286,8 +286,8 @@ rrd_xport(int argc, char **argv, int *xs
  534. int
  535. rrd_xport_fn(image_desc_t *im,
  536. - time_t *start,
  537. - time_t *end, /* which time frame do you want ?
  538. + TIME_INT *start,
  539. + TIME_INT *end, /* which time frame do you want ?
  540. * will be changed to represent reality */
  541. unsigned long *step, /* which stepsize do you want?
  542. * will be changed to represent reality */
  543. @@ -307,9 +307,9 @@ rrd_xport_fn(image_desc_t *im,
  544. char **legend_list;
  545. int ii = 0;
  546. - time_t start_tmp = 0;
  547. - time_t end_tmp = 0;
  548. - time_t curr_ts;
  549. + TIME_INT start_tmp = 0;
  550. + TIME_INT end_tmp = 0;
  551. + TIME_INT curr_ts;
  552. unsigned long step_tmp = 1;
  553. int dataIndex;
  554. --- a/contrib/trytime/trytime.c
  555. +++ b/contrib/trytime/trytime.c
  556. @@ -24,7 +24,8 @@ int main ( int ac, char **av )
  557. int option_index = 0;
  558. int opt;
  559. - time_t start_tmp, end_tmp, Now = time(NULL);
  560. + time_t start_time, end_time, Now = time(NULL);
  561. + TIME_INT start_tmp, end_tmp;
  562. char tim_b[200];
  563. struct rrd_time_value start_tv, end_tv;
  564. @@ -80,7 +81,8 @@ int main ( int ac, char **av )
  565. exit(1);
  566. }
  567. - strftime(tim_b,100,"%c %Z",localtime(&start_tmp));
  568. + start_time = (time_t) start_tmp;
  569. + strftime(tim_b,100,"%c %Z",localtime(&start_time));
  570. if( *soption )
  571. printf( "Start time was specified as: '%s',\n"
  572. "for me this means: %s (or %ld sec since epoch)\n\n",
  573. @@ -90,7 +92,8 @@ int main ( int ac, char **av )
  574. "for me this means: %s (or %ld sec since epoch)\n\n",
  575. tim_b, start_tmp );
  576. - strftime(tim_b,100,"%c %Z",localtime(&end_tmp));
  577. + end_time = (time_t) end_tmp;
  578. + strftime(tim_b,100,"%c %Z",localtime(&end_time));
  579. if( *eoption )
  580. printf( "End time was specified as: '%s',\n"
  581. "for me this means: %s (or %ld sec since epoch)\n",