[flow-tools] shadowed variable names

Mark Fullmer maf@eng.oar.net
Thu, 23 Jan 2003 20:13:08 -0500


Done.  sort_64uint64() was removed, I switched to the system qsort() a long
time ago.

mark

On Sun, Dec 29, 2002 at 02:13:44AM -0800, Bill Fumerola wrote:
> 
> please consider the following patch to avoid using local variable names
> already defined globally as functions.
> 
> thanks,
> -- 
> - bill fumerola@yahoo-inc.com / security yahoo
> 
> 
> --- //depot/vendor/flow-tools/lib/ftfile.c	2002/08/28 01:36:27
> +++ //depot/fumerola/flow-tools/lib/ftfile.c	2002/08/28 01:42:46
> @@ -409,7 +409,7 @@
>   * 
>   */
>  void ftfile_pathname(char *buf, int bsize, int nest, struct ftver ftv,
> - int done, u_int32 time)
> + int done, u_int32 fttime)
>  {
>    struct tm *tm;
>    char *prefix, dbuf[64];
> @@ -417,11 +417,11 @@
>    char gmt_sign;
>    int tm_gmtoff;
>    
> -  if (!(tm = localtime ((time_t*)&time))) {
> +  if (!(tm = localtime ((time_t*)&fttime))) {
>      snprintf(buf, bsize, ".");
>    }
>  
> -  tm_gmtoff = get_gmtoff(time);
> +  tm_gmtoff = get_gmtoff(fttime);
>  
>    /* compute GMT offset */
>    if (tm_gmtoff >= 0) {
> @@ -498,7 +498,7 @@
>   * returns -1 on error
>   * 
>   */
> -int ftfile_mkpath(u_int32 time, int nest)
> +int ftfile_mkpath(u_int32 fttime, int nest)
>  {
>    struct tm *tm;
>    char buf[32];
> @@ -511,7 +511,7 @@
>    if ((nest > 3) || (nest < -3))
>      return -1;
>  
> -  if (!(tm = localtime ((time_t*)&time)))
> +  if (!(tm = localtime ((time_t*)&fttime)))
>      return -1;
>  
>    if (nest == -1)
> --- //depot/vendor/flow-tools/lib/ftlib.h	2002/12/29 01:37:45
> +++ //depot/fumerola/flow-tools/lib/ftlib.h	2002/12/29 01:49:19
> @@ -2649,9 +2649,9 @@
>  int ftfile_dump(struct ftfile_entries *fte);
>  struct ftfile_entry *ftfile_entry_new(int len);
>  void ftfile_entry_free(struct ftfile_entry *entry);
> -int ftfile_mkpath(u_int32 time, int nest);
> +int ftfile_mkpath(u_int32 fttime, int nest);
>  void ftfile_pathname(char *buf, int bsize, int nest, struct ftver ftv,
> - int done, u_int32 time);
> + int done, u_int32 fttime);
>  
>  
>  
> @@ -2897,7 +2897,7 @@
>  void print_3float2(float f);
>  int load_lookup(char *s, int size, char *list);
>  u_long scan_ip(char *s);
> -int sort_64uint64(u_int64 *a, u_int *index, u_int elem);
> +int sort_64uint64(u_int64 *a, u_int *sindex, u_int elem);
>  int64 scan_size(char *val);
>  
>  int unlink_pidfile(int pid, char *file, u_int16 port);
> --- //depot/vendor/flow-tools/lib/support.c	2002/12/29 01:37:45
> +++ //depot/fumerola/flow-tools/lib/support.c	2002/12/29 01:49:19
> @@ -389,7 +389,7 @@
>   *  the values the index points to in a.
>   *
>   */
> -int sort_64uint64(u_int64 *a, u_int *index, u_int elem)
> +int sort_64uint64(u_int64 *a, u_int *sindex, u_int elem)
>  {
>    long i, l, r, j;
>    u_int stack[SORT_STACK];
> @@ -406,18 +406,18 @@
>      while (r > l) {
>  
>        /* partition */
> -      v = a[index[r]];
> +      v = a[sindex[r]];
>        i = l-1;
>        j = r;
>  
>        for (;;) {
> -        while ((a[index[++i]] < v) & (i < r));
> -        while ((a[index[--j]] > v) & (j > 0));
> +        while ((a[sindex[++i]] < v) & (i < r));
> +        while ((a[sindex[--j]] > v) & (j > 0));
>          if (i >= j) break;
> -        t = index[i]; index[i] = index[j]; index[j] = t;
> +        t = sindex[i]; sindex[i] = sindex[j]; sindex[j] = t;
>        }
>  
> -      t = index[i]; index[i] = index[r]; index[r] = t;
> +      t = sindex[i]; sindex[i] = sindex[r]; sindex[r] = t;
>  
>        if (i-l > r-i) {
>          stack[--sp] = l;
> 
> 
> _______________________________________________
> flow-tools@splintered.net
> http://www.splintered.net/sw/flow-tools