[SCM] Samba Shared Repository - branch master updated

Björn Jacke bjacke at samba.org
Thu Jul 5 15:51:02 MDT 2012


The branch, master has been updated
       via  7abe51f talloc: remove unused variables
       via  a79496d lib/addns: remove defines we don't need or have for sure via libreplace
       via  4b83d61 lib/addns: remove use of uint8 uint16 and uint32 in favour of C99 types
       via  f9fb1ef s3: evaluate MNT_QUOTA and MNT_RDONLY in statvfs also on darwin
      from  5ba91ff s3:registry: untangle assignment from check in reg_enumkey()

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 7abe51f8404f1788d4ed497d26b83b3097073229
Author: Björn Jacke <bj at sernet.de>
Date:   Wed Jun 13 18:10:34 2012 +0200

    talloc: remove unused variables
    
    found by the IRIX compiler
    
    Autobuild-User(master): Björn Jacke <bj at sernet.de>
    Autobuild-Date(master): Thu Jul  5 23:50:54 CEST 2012 on sn-devel-104

commit a79496d90cad1695c7b79244337984faa8630c2b
Author: Björn Jacke <bj at sernet.de>
Date:   Thu Jul 5 21:48:29 2012 +0200

    lib/addns: remove defines we don't need or have for sure via libreplace

commit 4b83d61e7da7b417c3486f61b9f5e65b9df3fa88
Author: Björn Jacke <bj at sernet.de>
Date:   Thu Jul 5 20:47:58 2012 +0200

    lib/addns: remove use of uint8 uint16 and uint32 in favour of C99 types

commit f9fb1ef85c8bc584e6d0f3e520f56bf0f3f3bf9f
Author: Björn Jacke <bj at sernet.de>
Date:   Thu Jul 5 11:43:16 2012 +0200

    s3: evaluate MNT_QUOTA and MNT_RDONLY in statvfs also on darwin

-----------------------------------------------------------------------

Summary of changes:
 lib/addns/dns.h         |  184 +++++++++++++----------------------------------
 lib/addns/dnserr.h      |    4 +-
 lib/addns/dnsgss.c      |    6 +-
 lib/addns/dnsmarshall.c |   56 +++++++-------
 lib/addns/dnsrecord.c   |   40 +++++-----
 lib/addns/dnssock.c     |   18 +++---
 lib/talloc/pytalloc.c   |    5 --
 source3/smbd/statvfs.c  |    2 +-
 8 files changed, 113 insertions(+), 202 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/addns/dns.h b/lib/addns/dns.h
index c0820fe..bf2ade3 100644
--- a/lib/addns/dns.h
+++ b/lib/addns/dns.h
@@ -44,90 +44,6 @@
 
 #include <talloc.h>
 
-/*******************************************************************
-   Type definitions for int16, int32, uint16 and uint32.  Needed
-   for Samba coding style
-*******************************************************************/
-
-#ifndef uint8
-#  define uint8 unsigned char
-#endif
-
-#if !defined(int16) && !defined(HAVE_INT16_FROM_RPC_RPC_H)
-#  if (SIZEOF_SHORT == 4)
-#    define int16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
-#  else /* SIZEOF_SHORT != 4 */
-#    define int16 short
-#  endif /* SIZEOF_SHORT != 4 */
-   /* needed to work around compile issue on HP-UX 11.x */
-#  define _INT16        1
-#endif
-
-/*
- * Note we duplicate the size tests in the unsigned
- * case as int16 may be a typedef from rpc/rpc.h
- */
-
-#if !defined(uint16) && !defined(HAVE_UINT16_FROM_RPC_RPC_H)
-#  if (SIZEOF_SHORT == 4)
-#    define uint16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
-#  else /* SIZEOF_SHORT != 4 */
-#    define uint16 unsigned short
-#  endif /* SIZEOF_SHORT != 4 */
-#endif
-
-#if !defined(int32) && !defined(HAVE_INT32_FROM_RPC_RPC_H)
-#  if (SIZEOF_INT == 4)
-#    define int32 int
-#  elif (SIZEOF_LONG == 4)
-#    define int32 long
-#  elif (SIZEOF_SHORT == 4)
-#    define int32 short
-#  else
-     /* uggh - no 32 bit type?? probably a CRAY. just hope this works ... */
-#    define int32 int
-#  endif
-#  ifndef _INT32
-     /* needed to work around compile issue on HP-UX 11.x */
-#    define _INT32        1
-#  endif
-#endif
-
-/*
- * Note we duplicate the size tests in the unsigned
- * case as int32 may be a typedef from rpc/rpc.h
- */
-
-#if !defined(uint32) && !defined(HAVE_UINT32_FROM_RPC_RPC_H)
-#  if (SIZEOF_INT == 4)
-#    define uint32 unsigned int
-#  elif (SIZEOF_LONG == 4)
-#    define uint32 unsigned long
-#  elif (SIZEOF_SHORT == 4)
-#    define uint32 unsigned short
-#  else
-      /* uggh - no 32 bit type?? probably a CRAY. just hope this works ... */
-#    define uint32 unsigned
-#  endif
-#endif
-
-/*
- * check for 8 byte long long
- */
-
-#if !defined(uint64)
-#  if (SIZEOF_LONG == 8)
-#    define uint64 unsigned long
-#  elif (SIZEOF_LONG_LONG == 8)
-#    define uint64 unsigned long long
-#  endif /* don't lie.  If we don't have it, then don't use it */
-#endif
-
-/* needed on Sun boxes */
-#ifndef INADDR_NONE
-#define INADDR_NONE          0xFFFFFFFF
-#endif
-
 #include "dnserr.h"
 
 
@@ -236,8 +152,8 @@ struct dns_domain_name {
 
 struct dns_question {
 	struct dns_domain_name *name;
-	uint16 q_type;
-	uint16 q_class;
+	uint16_t q_type;
+	uint16_t q_class;
 };
 
 /*
@@ -248,36 +164,36 @@ struct dns_question {
 
 struct dns_zone {
 	struct dns_domain_name *name;
-	uint16 z_type;
-	uint16 z_class;
+	uint16_t z_type;
+	uint16_t z_class;
 };
 
 struct dns_rrec {
 	struct dns_domain_name *name;
-	uint16 type;
-	uint16 r_class;
-	uint32 ttl;
-	uint16 data_length;
-	uint8 *data;
+	uint16_t type;
+	uint16_t r_class;
+	uint32_t ttl;
+	uint16_t data_length;
+	uint8_t *data;
 };
 
 struct dns_tkey_record {
 	struct dns_domain_name *algorithm;
 	time_t inception;
 	time_t expiration;
-	uint16 mode;
-	uint16 error;
-	uint16 key_length;
-	uint8 *key;
+	uint16_t mode;
+	uint16_t error;
+	uint16_t key_length;
+	uint8_t *key;
 };
 
 struct dns_request {
-	uint16 id;
-	uint16 flags;
-	uint16 num_questions;
-	uint16 num_answers;
-	uint16 num_auths;
-	uint16 num_additionals;
+	uint16_t id;
+	uint16_t flags;
+	uint16_t num_questions;
+	uint16_t num_answers;
+	uint16_t num_auths;
+	uint16_t num_additionals;
 	struct dns_question **questions;
 	struct dns_rrec **answers;
 	struct dns_rrec **auths;
@@ -291,12 +207,12 @@ struct dns_request {
  */
 
 struct dns_update_request {
-	uint16 id;
-	uint16 flags;
-	uint16 num_zones;
-	uint16 num_preqs;
-	uint16 num_updates;
-	uint16 num_additionals;
+	uint16_t id;
+	uint16_t flags;
+	uint16_t num_zones;
+	uint16_t num_preqs;
+	uint16_t num_updates;
+	uint16_t num_additionals;
 	struct dns_zone **zones;
 	struct dns_rrec **preqs;
 	struct dns_rrec **updates;
@@ -304,13 +220,13 @@ struct dns_update_request {
 };
 
 struct dns_connection {
-	int32 hType;
+	int32_t hType;
 	int s;
 	struct sockaddr RecvAddr;
 };
 
 struct dns_buffer {
-	uint8 *data;
+	uint8_t *data;
 	size_t size;
 	size_t offset;
 	DNS_ERROR error;
@@ -326,7 +242,7 @@ char *dns_generate_keyname( TALLOC_CTX *mem_ctx );
 /* from dnsrecord.c */
 
 DNS_ERROR dns_create_query( TALLOC_CTX *mem_ctx, const char *name,
-			    uint16 q_type, uint16 q_class,
+			    uint16_t q_type, uint16_t q_class,
 			    struct dns_request **preq );
 DNS_ERROR dns_create_update( TALLOC_CTX *mem_ctx, const char *name,
 			     struct dns_update_request **preq );
@@ -335,42 +251,42 @@ DNS_ERROR dns_create_probe(TALLOC_CTX *mem_ctx, const char *zone,
 			   const struct sockaddr_storage *sslist,
 			   struct dns_update_request **preq);
 DNS_ERROR dns_create_rrec(TALLOC_CTX *mem_ctx, const char *name,
-			  uint16 type, uint16 r_class, uint32 ttl,
-			  uint16 data_length, uint8 *data,
+			  uint16_t type, uint16_t r_class, uint32_t ttl,
+			  uint16_t data_length, uint8_t *data,
 			  struct dns_rrec **prec);
 DNS_ERROR dns_add_rrec(TALLOC_CTX *mem_ctx, struct dns_rrec *rec,
-		       uint16 *num_records, struct dns_rrec ***records);
+		       uint16_t *num_records, struct dns_rrec ***records);
 DNS_ERROR dns_create_tkey_record(TALLOC_CTX *mem_ctx, const char *keyname,
 				 const char *algorithm_name, time_t inception,
-				 time_t expiration, uint16 mode, uint16 error,
-				 uint16 key_length, const uint8 *key,
+				 time_t expiration, uint16_t mode, uint16_t error,
+				 uint16_t key_length, const uint8_t *key,
 				 struct dns_rrec **prec);
 DNS_ERROR dns_create_name_in_use_record(TALLOC_CTX *mem_ctx,
 					const char *name,
 					const struct sockaddr_storage *ip,
 					struct dns_rrec **prec);
 DNS_ERROR dns_create_delete_record(TALLOC_CTX *mem_ctx, const char *name,
-				   uint16 type, uint16 r_class,
+				   uint16_t type, uint16_t r_class,
 				   struct dns_rrec **prec);
 DNS_ERROR dns_create_name_not_in_use_record(TALLOC_CTX *mem_ctx,
-					    const char *name, uint32 type,
+					    const char *name, uint32_t type,
 					    struct dns_rrec **prec);
 DNS_ERROR dns_create_a_record(TALLOC_CTX *mem_ctx, const char *host,
-			      uint32 ttl, const struct sockaddr_storage *pss,
+			      uint32_t ttl, const struct sockaddr_storage *pss,
 			      struct dns_rrec **prec);
 DNS_ERROR dns_create_aaaa_record(TALLOC_CTX *mem_ctx, const char *host,
-				 uint32 ttl, const struct sockaddr_storage *pss,
+				 uint32_t ttl, const struct sockaddr_storage *pss,
 				 struct dns_rrec **prec);
 DNS_ERROR dns_unmarshall_tkey_record(TALLOC_CTX *mem_ctx, struct dns_rrec *rec,
 				     struct dns_tkey_record **ptkey);
 DNS_ERROR dns_create_tsig_record(TALLOC_CTX *mem_ctx, const char *keyname,
 				 const char *algorithm_name,
-				 time_t time_signed, uint16 fudge,
-				 uint16 mac_length, const uint8 *mac,
-				 uint16 original_id, uint16 error,
+				 time_t time_signed, uint16_t fudge,
+				 uint16_t mac_length, const uint8_t *mac,
+				 uint16_t original_id, uint16_t error,
 				 struct dns_rrec **prec);
 DNS_ERROR dns_add_rrec(TALLOC_CTX *mem_ctx, struct dns_rrec *rec,
-		       uint16 *num_records, struct dns_rrec ***records);
+		       uint16_t *num_records, struct dns_rrec ***records);
 DNS_ERROR dns_create_update_request(TALLOC_CTX *mem_ctx,
 				    const char *domainname,
 				    const char *hostname,
@@ -380,7 +296,7 @@ DNS_ERROR dns_create_update_request(TALLOC_CTX *mem_ctx,
 
 /* from dnssock.c */
 
-DNS_ERROR dns_open_connection( const char *nameserver, int32 dwType,
+DNS_ERROR dns_open_connection( const char *nameserver, int32_t dwType,
 		    TALLOC_CTX *mem_ctx,
 		    struct dns_connection **conn );
 DNS_ERROR dns_send(struct dns_connection *conn, const struct dns_buffer *buf);
@@ -397,14 +313,14 @@ DNS_ERROR dns_update_transaction(TALLOC_CTX *mem_ctx,
 /* from dnsmarshall.c */
 
 struct dns_buffer *dns_create_buffer(TALLOC_CTX *mem_ctx);
-void dns_marshall_buffer(struct dns_buffer *buf, const uint8 *data,
+void dns_marshall_buffer(struct dns_buffer *buf, const uint8_t *data,
 			 size_t len);
-void dns_marshall_uint16(struct dns_buffer *buf, uint16 val);
-void dns_marshall_uint32(struct dns_buffer *buf, uint32 val);
-void dns_unmarshall_buffer(struct dns_buffer *buf, uint8 *data,
+void dns_marshall_uint16(struct dns_buffer *buf, uint16_t val);
+void dns_marshall_uint32(struct dns_buffer *buf, uint32_t val);
+void dns_unmarshall_buffer(struct dns_buffer *buf, uint8_t *data,
 			   size_t len);
-void dns_unmarshall_uint16(struct dns_buffer *buf, uint16 *val);
-void dns_unmarshall_uint32(struct dns_buffer *buf, uint32 *val);
+void dns_unmarshall_uint16(struct dns_buffer *buf, uint16_t *val);
+void dns_unmarshall_uint32(struct dns_buffer *buf, uint32_t *val);
 void dns_unmarshall_domain_name(TALLOC_CTX *mem_ctx,
 				struct dns_buffer *buf,
 				struct dns_domain_name **pname);
@@ -427,7 +343,7 @@ DNS_ERROR dns_unmarshall_update_request(TALLOC_CTX *mem_ctx,
 					struct dns_update_request **pupreq);
 struct dns_request *dns_update2request(struct dns_update_request *update);
 struct dns_update_request *dns_request2update(struct dns_request *request);
-uint16 dns_response_code(uint16 flags);
+uint16_t dns_response_code(uint16_t flags);
 const char *dns_errstr(DNS_ERROR err);
 
 /* from dnsgss.c */
@@ -444,7 +360,7 @@ DNS_ERROR dns_sign_update(struct dns_update_request *req,
 			  gss_ctx_id_t gss_ctx,
 			  const char *keyname,
 			  const char *algorithmname,
-			  time_t time_signed, uint16 fudge);
+			  time_t time_signed, uint16_t fudge);
 
 #endif	/* HAVE_GSSAPI */
 
diff --git a/lib/addns/dnserr.h b/lib/addns/dnserr.h
index 8638a2d..1eedc8f 100644
--- a/lib/addns/dnserr.h
+++ b/lib/addns/dnserr.h
@@ -36,11 +36,11 @@
 /* Setup the DNS_ERROR typedef.  Technique takes from nt_status.h */
 
 #if defined(HAVE_IMMEDIATE_STRUCTURES)
-typedef struct {uint32 v;} DNS_ERROR;
+typedef struct {uint32_t v;} DNS_ERROR;
 #define ERROR_DNS(x) ((DNS_ERROR) { x })
 #define ERROR_DNS_V(x) ((x).v)
 #else
-typedef uint32 DNS_ERROR;
+typedef uint32_t DNS_ERROR;
 #define ERROR_DNS(x) (x)
 #define ERROR_DNS_V(x) (x)
 #endif
diff --git a/lib/addns/dnsgss.c b/lib/addns/dnsgss.c
index 4f7571f..64a7d85 100644
--- a/lib/addns/dnsgss.c
+++ b/lib/addns/dnsgss.c
@@ -125,7 +125,7 @@ static DNS_ERROR dns_negotiate_gss_ctx_int( TALLOC_CTX *mem_ctx,
 			err = dns_create_tkey_record(
 				req, keyname, "gss.microsoft.com", t,
 				t + 86400, DNS_TKEY_MODE_GSSAPI, 0,
-				output_desc.length, (uint8 *)output_desc.value,
+				output_desc.length, (uint8_t *)output_desc.value,
 				&rec );
 			if (!ERR_DNS_IS_OK(err)) goto error;
 
@@ -272,7 +272,7 @@ DNS_ERROR dns_sign_update(struct dns_update_request *req,
 			  gss_ctx_id_t gss_ctx,
 			  const char *keyname,
 			  const char *algorithmname,
-			  time_t time_signed, uint16 fudge)
+			  time_t time_signed, uint16_t fudge)
 {
 	struct dns_buffer *buf;
 	DNS_ERROR err;
@@ -319,7 +319,7 @@ DNS_ERROR dns_sign_update(struct dns_update_request *req,
 	}
 
 	err = dns_create_tsig_record(buf, keyname, algorithmname, time_signed,
-				     fudge, mic.length, (uint8 *)mic.value,
+				     fudge, mic.length, (uint8_t *)mic.value,
 				     req->id, 0, &rec);
 	gss_release_buffer(&minor, &mic);
 	if (!ERR_DNS_IS_OK(err)) goto error;
diff --git a/lib/addns/dnsmarshall.c b/lib/addns/dnsmarshall.c
index 59d6470..b0211c8 100644
--- a/lib/addns/dnsmarshall.c
+++ b/lib/addns/dnsmarshall.c
@@ -39,7 +39,7 @@ struct dns_buffer *dns_create_buffer(TALLOC_CTX *mem_ctx)
 	 */
 	result->size = 2;
 
-	if (!(result->data = talloc_array(result, uint8, result->size))) {
+	if (!(result->data = talloc_array(result, uint8_t, result->size))) {
 		TALLOC_FREE(result);
 		return NULL;
 	}
@@ -47,7 +47,7 @@ struct dns_buffer *dns_create_buffer(TALLOC_CTX *mem_ctx)
 	return result;
 }
 
-void dns_marshall_buffer(struct dns_buffer *buf, const uint8 *data,
+void dns_marshall_buffer(struct dns_buffer *buf, const uint8_t *data,
 			 size_t len)
 {
 	if (!ERR_DNS_IS_OK(buf->error)) return;
@@ -70,7 +70,7 @@ void dns_marshall_buffer(struct dns_buffer *buf, const uint8 *data,
 		
 	if (buf->offset + len > buf->size) {
 		size_t new_size = buf->offset + len;
-		uint8 *new_data;
+		uint8_t *new_data;
 
 		/*
 		 * Don't do too many reallocs, round up to some multiple
@@ -78,7 +78,7 @@ void dns_marshall_buffer(struct dns_buffer *buf, const uint8 *data,
 
 		new_size += (64 - (new_size % 64));
 
-		if (!(new_data = talloc_realloc(buf, buf->data, uint8,
+		if (!(new_data = talloc_realloc(buf, buf->data, uint8_t,
 						      new_size))) {
 			buf->error = ERROR_DNS_NO_MEMORY;
 			return;
@@ -93,19 +93,19 @@ void dns_marshall_buffer(struct dns_buffer *buf, const uint8 *data,
 	return;
 }
 
-void dns_marshall_uint16(struct dns_buffer *buf, uint16 val)
+void dns_marshall_uint16(struct dns_buffer *buf, uint16_t val)
 {
-	uint16 n_val = htons(val);
-	dns_marshall_buffer(buf, (uint8 *)&n_val, sizeof(n_val));
+	uint16_t n_val = htons(val);
+	dns_marshall_buffer(buf, (uint8_t *)&n_val, sizeof(n_val));
 }
 
-void dns_marshall_uint32(struct dns_buffer *buf, uint32 val)
+void dns_marshall_uint32(struct dns_buffer *buf, uint32_t val)
 {
-	uint32 n_val = htonl(val);
-	dns_marshall_buffer(buf, (uint8 *)&n_val, sizeof(n_val));
+	uint32_t n_val = htonl(val);
+	dns_marshall_buffer(buf, (uint8_t *)&n_val, sizeof(n_val));
 }
 
-void dns_unmarshall_buffer(struct dns_buffer *buf, uint8 *data,
+void dns_unmarshall_buffer(struct dns_buffer *buf, uint8_t *data,
 			   size_t len)
 {
 	if (!(ERR_DNS_IS_OK(buf->error))) return;
@@ -121,21 +121,21 @@ void dns_unmarshall_buffer(struct dns_buffer *buf, uint8 *data,
 	return;
 }
 
-void dns_unmarshall_uint16(struct dns_buffer *buf, uint16 *val)
+void dns_unmarshall_uint16(struct dns_buffer *buf, uint16_t *val)
 {
-	uint16 n_val;
+	uint16_t n_val;
 
-	dns_unmarshall_buffer(buf, (uint8 *)&n_val, sizeof(n_val));
+	dns_unmarshall_buffer(buf, (uint8_t *)&n_val, sizeof(n_val));
 	if (!(ERR_DNS_IS_OK(buf->error))) return;
 
 	*val = ntohs(n_val);
 }
 
-void dns_unmarshall_uint32(struct dns_buffer *buf, uint32 *val)
+void dns_unmarshall_uint32(struct dns_buffer *buf, uint32_t *val)
 {
-	uint32 n_val;
+	uint32_t n_val;
 
-	dns_unmarshall_buffer(buf, (uint8 *)&n_val, sizeof(n_val));
+	dns_unmarshall_buffer(buf, (uint8_t *)&n_val, sizeof(n_val));
 	if (!(ERR_DNS_IS_OK(buf->error))) return;
 
 	*val = ntohl(n_val);
@@ -152,16 +152,16 @@ void dns_marshall_domain_name(struct dns_buffer *buf,
 	 */
 
 	for (label = name->pLabelList; label != NULL; label = label->next) {
-		uint8 len = label->len;
+		uint8_t len = label->len;
 
-		dns_marshall_buffer(buf, (uint8 *)&len, sizeof(len));
+		dns_marshall_buffer(buf, (uint8_t *)&len, sizeof(len));
 		if (!ERR_DNS_IS_OK(buf->error)) return;
 
-		dns_marshall_buffer(buf, (uint8 *)label->label, len);
+		dns_marshall_buffer(buf, (uint8_t *)label->label, len);
 		if (!ERR_DNS_IS_OK(buf->error)) return;
 	}
 
-	dns_marshall_buffer(buf, (uint8 *)&end_char, 1);
+	dns_marshall_buffer(buf, (uint8_t *)&end_char, 1);
 }
 
 static void dns_unmarshall_label(TALLOC_CTX *mem_ctx,
@@ -170,7 +170,7 @@ static void dns_unmarshall_label(TALLOC_CTX *mem_ctx,
 				 struct dns_domain_label **plabel)
 {
 	struct dns_domain_label *label;
-	uint8 len;
+	uint8_t len;
 
 	if (!ERR_DNS_IS_OK(buf->error)) return;
 
@@ -196,7 +196,7 @@ static void dns_unmarshall_label(TALLOC_CTX *mem_ctx,
 		 * and using the calculated offset.
 		 */
 		struct dns_buffer new_buf;
-		uint8 low;
+		uint8_t low;
 
 		dns_unmarshall_buffer(buf, &low, sizeof(low));
 		if (!ERR_DNS_IS_OK(buf->error)) return;
@@ -228,7 +228,7 @@ static void dns_unmarshall_label(TALLOC_CTX *mem_ctx,
 		goto error;
 	}
 
-	dns_unmarshall_buffer(buf, (uint8 *)label->label, len);
+	dns_unmarshall_buffer(buf, (uint8_t *)label->label, len);
 	if (!ERR_DNS_IS_OK(buf->error)) goto error;
 
 	dns_unmarshall_label(label, level+1, buf, &label->next);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list