[PATCH] a few signed/unsigned fixups

Jeremy Allison jra at samba.org
Thu May 19 18:19:08 UTC 2016


On Thu, May 19, 2016 at 06:45:26PM +0200, Volker Lendecke wrote:
> Hi!
> 
> Review appreciated!

LGTM. Pushed !


> -- 
> SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
> phone: +49-551-370000-0, fax: +49-551-370000-9
> AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
> http://www.sernet.de, mailto:kontakt at sernet.de

> From fa802fbff164b92f201f254adda2fc61f83d8c3e Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Thu, 19 May 2016 14:55:10 +0200
> Subject: [PATCH 1/2] vfs_fileid: Fix a signed/unsigned mixup
> 
> Signed-off-by: Volker Lendecke <vl at samba.org>
> ---
>  source3/modules/vfs_fileid.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/source3/modules/vfs_fileid.c b/source3/modules/vfs_fileid.c
> index 7077445..36ffb77 100644
> --- a/source3/modules/vfs_fileid.c
> +++ b/source3/modules/vfs_fileid.c
> @@ -155,7 +155,7 @@ nomem:
>  static struct fileid_mount_entry *fileid_find_mount_entry(struct fileid_handle_data *data,
>  							  SMB_DEV_T dev)
>  {
> -	int i;
> +	unsigned i;
>  
>  	if (data->num_mount_entries == 0) {
>  		fileid_load_mount_entries(data);
> -- 
> 1.9.1
> 
> 
> From 2b4041b398b301abed4041becef351dfb8e0e714 Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Thu, 19 May 2016 18:42:04 +0200
> Subject: [PATCH 2/2] vfs_fruit: Fix a few signed/unsigned mixups
> 
> Signed-off-by: Volker Lendecke <vl at samba.org>
> ---
>  source3/modules/vfs_fruit.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
> index 84c40bd..6d4389f 100644
> --- a/source3/modules/vfs_fruit.c
> +++ b/source3/modules/vfs_fruit.c
> @@ -576,10 +576,11 @@ static bool ad_pack(struct adouble *ad)
>  /**
>   * Unpack an AppleDouble blob into a struct adoble
>   **/
> -static bool ad_unpack(struct adouble *ad, const int nentries, size_t filesize)
> +static bool ad_unpack(struct adouble *ad, const size_t nentries,
> +		      size_t filesize)
>  {
>  	size_t bufsize = talloc_get_size(ad->ad_data);
> -	int adentries, i;
> +	size_t adentries, i;
>  	uint32_t eid, len, off;
>  
>  	/*
> @@ -603,7 +604,8 @@ static bool ad_unpack(struct adouble *ad, const int nentries, size_t filesize)
>  
>  	adentries = RSVAL(ad->ad_data, ADEDOFF_NENTRIES);
>  	if (adentries != nentries) {
> -		DEBUG(1, ("invalid number of entries: %d\n", adentries));
> +		DEBUG(1, ("invalid number of entries: %zu\n",
> +			  adentries));
>  		return false;
>  	}
>  
> @@ -1533,7 +1535,7 @@ static bool del_fruit_stream(TALLOC_CTX *mem_ctx, unsigned int *num_streams,
>  			     const char *name)
>  {
>  	struct stream_struct *tmp = *streams;
> -	int i;
> +	unsigned int i;
>  
>  	if (*num_streams == 0) {
>  		return true;
> @@ -2015,7 +2017,7 @@ static NTSTATUS check_ms_nfs(vfs_handle_struct *handle,
>  			     mode_t *pmode,
>  			     bool *pdo_chmod)
>  {
> -	int i;
> +	uint32_t i;
>  	struct fruit_config_data *config = NULL;
>  
>  	*pdo_chmod = false;
> @@ -3770,7 +3772,7 @@ static void fruit_copy_chunk_done(struct tevent_req *subreq)
>  	NTSTATUS status;
>  	unsigned int num_streams = 0;
>  	struct stream_struct *streams = NULL;
> -	int i;
> +	unsigned int i;
>  	struct smb_filename *src_fname_tmp = NULL;
>  	struct smb_filename *dst_fname_tmp = NULL;
>  
> -- 
> 1.9.1
> 




More information about the samba-technical mailing list