ok

On Thu, Nov 05, 2015 at 05:45:15PM -0500, Ted Unangst wrote:
> time_t is not a long.
> 
> 
> Index: funcs.h
> ===================================================================
> RCS file: /cvs/src/usr.bin/less/funcs.h,v
> retrieving revision 1.9
> diff -u -p -r1.9 funcs.h
> --- funcs.h   5 Nov 2015 22:08:44 -0000       1.9
> +++ funcs.h   5 Nov 2015 22:44:47 -0000
> @@ -227,7 +227,6 @@ extern    void init_option(void);
>  extern       struct loption *findopt(int);
>  extern       struct loption *findopt_name(char **, char **, int *);
>  extern       int iread(int, unsigned char *, unsigned int);
> -extern       long get_time(void);
>  extern       char *errno_message(char *);
>  extern       int percentage(off_t, off_t);
>  extern       off_t percent_pos(off_t, int, long);
> Index: linenum.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/less/linenum.c,v
> retrieving revision 1.8
> diff -u -p -r1.8 linenum.c
> --- linenum.c 5 Nov 2015 22:08:44 -0000       1.8
> +++ linenum.c 5 Nov 2015 22:44:47 -0000
> @@ -210,14 +210,14 @@ longloopmessage(void)
>  }
>  
>  static int loopcount;
> -static long startime;
> +static time_t startime;
>  
>  static void
>  longish(void)
>  {
>       if (loopcount >= 0 && ++loopcount > 100) {
>               loopcount = 0;
> -             if (get_time() >= startime + LONGTIME) {
> +             if (time(NULL) >= startime + LONGTIME) {
>                       longloopmessage();
>                       loopcount = -1;
>               }
> @@ -287,7 +287,7 @@ find_linenum(off_t pos)
>        * The decision is based on which way involves
>        * traversing fewer bytes in the file.
>        */
> -     startime = get_time();
> +     startime = time(NULL);
>       if (p == &anchor || pos - p->prev->pos < p->pos - pos) {
>               /*
>                * Go forward.
> Index: os.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/less/os.c,v
> retrieving revision 1.12
> diff -u -p -r1.12 os.c
> --- os.c      5 Nov 2015 22:08:44 -0000       1.12
> +++ os.c      5 Nov 2015 22:44:47 -0000
> @@ -56,18 +56,6 @@ start:
>  }
>  
>  /*
> - * Return the current time.
> - */
> -long
> -get_time(void)
> -{
> -     time_t t;
> -
> -     (void) time(&t);
> -     return (t);
> -}
> -
> -/*
>   * errno_message: Return an error message based on the value of "errno".
>   */
>  char *
> 

  • less time Ted Unangst
    • Re: less time Nicholas Marriott

Reply via email to