DragonFly bugs List (threaded) for 2008-06
DragonFly BSD
DragonFly bugs List (threaded) for 2008-06
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: [issue1028] cpdup: not 64-bit clean


From: Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxx>
Date: Wed, 11 Jun 2008 22:17:32 +0200
Mail-followup-to: bugs@crater.dragonflybsd.org

On Wed, Jun 11, 2008 at 08:17:38PM -0000, Michel Salim wrote:
> @@ -336,7 +336,7 @@
>      struct HCHead *head;
>      struct HCLeaf *item;
>      struct dirent *den;
> -    int desc = 0;
> +    size_t desc = 0;
>  
>      if (hc == NULL || hc->host == NULL)
>  	return(opendir(path));
> @@ -355,7 +355,7 @@
>  	}
>      }
>      if (hcc_get_descriptor(hc, desc, HC_DESC_DIR)) {
> -	fprintf(stderr, "hc_opendir: remote reused active descriptor %d\n",
> +	fprintf(stderr, "hc_opendir: remote reused active descriptor %zd\n",
>  		desc);
>  	return(NULL);
>      }

%zd or %zu?

> --- cpdup-1.11/fsmid.c.explicit_sizes	2008-05-22 19:05:08.000000000 -0400
> +++ cpdup-1.11/fsmid.c	2008-06-11 15:07:50.000000000 -0400
> @@ -35,8 +35,8 @@
>  
>  	    for (node = FSMIDBase; node; node = node->fid_Next) {
>  		if (node->fid_Accessed && node->fid_Code) {
> -		    fprintf(fo, "%016llx %d %s\n", 
> -			node->fid_Code, 
> +		    fprintf(fo, "%016llx %zd %s\n", 
> +			(long long unsigned)node->fid_Code, 
>  			strlen(node->fid_Name),
>  			node->fid_Name
>  		    );

(u)intmax_t + %jd/%ju is better here.

Joerg



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]