svn commit: samba r15191 - in branches/SAMBA_4_0/source: . client lib/crypto lib/registry lib/util libcli/raw libcli/smb2 scripting/swig smb_server/smb smb_server/smb2

jelmer at samba.org jelmer at samba.org
Mon Apr 24 09:36:13 GMT 2006


Author: jelmer
Date: 2006-04-24 09:36:09 +0000 (Mon, 24 Apr 2006)
New Revision: 15191

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15191

Log:
Avoid uint_t as it's not standard.

Modified:
   branches/SAMBA_4_0/source/client/client.c
   branches/SAMBA_4_0/source/lib/crypto/md5.c
   branches/SAMBA_4_0/source/lib/registry/reg_backend_w95.c
   branches/SAMBA_4_0/source/lib/util/debug.c
   branches/SAMBA_4_0/source/lib/util/pidfile.c
   branches/SAMBA_4_0/source/lib/util/util.c
   branches/SAMBA_4_0/source/libcli/raw/raweas.c
   branches/SAMBA_4_0/source/libcli/raw/rawnotify.c
   branches/SAMBA_4_0/source/libcli/raw/rawrequest.c
   branches/SAMBA_4_0/source/libcli/raw/request.h
   branches/SAMBA_4_0/source/libcli/raw/smb_signing.c
   branches/SAMBA_4_0/source/libcli/smb2/request.c
   branches/SAMBA_4_0/source/libcli/smb2/smb2.h
   branches/SAMBA_4_0/source/main.mk
   branches/SAMBA_4_0/source/scripting/swig/config.mk
   branches/SAMBA_4_0/source/smb_server/smb/request.c
   branches/SAMBA_4_0/source/smb_server/smb2/receive.c


Changeset:
Modified: branches/SAMBA_4_0/source/client/client.c
===================================================================
--- branches/SAMBA_4_0/source/client/client.c	2006-04-24 09:34:22 UTC (rev 15190)
+++ branches/SAMBA_4_0/source/client/client.c	2006-04-24 09:36:09 UTC (rev 15191)
@@ -2186,7 +2186,7 @@
 
 	if (NT_STATUS_IS_ERR(smbcli_unix_chmod(ctx->cli->tree, src, mode))) {
 		d_printf("%s chmod file %s 0%o\n",
-			smbcli_errstr(ctx->cli->tree), src, (uint_t)mode);
+			smbcli_errstr(ctx->cli->tree), src, (mode_t)mode);
 		return 1;
 	} 
 

Modified: branches/SAMBA_4_0/source/lib/crypto/md5.c
===================================================================
--- branches/SAMBA_4_0/source/lib/crypto/md5.c	2006-04-24 09:34:22 UTC (rev 15190)
+++ branches/SAMBA_4_0/source/lib/crypto/md5.c	2006-04-24 09:36:09 UTC (rev 15191)
@@ -58,7 +58,7 @@
  * Update context to reflect the concatenation of another buffer full
  * of bytes.
  */
-_PUBLIC_ void MD5Update(struct MD5Context *ctx, const uint8_t *buf, uint_t len)
+_PUBLIC_ void MD5Update(struct MD5Context *ctx, const uint8_t *buf, size_t len)
 {
     register uint32_t t;
 

Modified: branches/SAMBA_4_0/source/lib/registry/reg_backend_w95.c
===================================================================
--- branches/SAMBA_4_0/source/lib/registry/reg_backend_w95.c	2006-04-24 09:34:22 UTC (rev 15190)
+++ branches/SAMBA_4_0/source/lib/registry/reg_backend_w95.c	2006-04-24 09:36:09 UTC (rev 15191)
@@ -42,7 +42,7 @@
  * the keys and the RGDB contains the actual data.
  */
 
-typedef uint_t DWORD;
+typedef uint32_t DWORD;
 typedef unsigned short WORD;
 
 typedef struct creg_block {

Modified: branches/SAMBA_4_0/source/lib/util/debug.c
===================================================================
--- branches/SAMBA_4_0/source/lib/util/debug.c	2006-04-24 09:34:22 UTC (rev 15190)
+++ branches/SAMBA_4_0/source/lib/util/debug.c	2006-04-24 09:36:09 UTC (rev 15191)
@@ -182,7 +182,7 @@
   return a string constant containing n tabs
   no more than 10 tabs are returned
 */
-_PUBLIC_ const char *do_debug_tab(uint_t n)
+_PUBLIC_ const char *do_debug_tab(int n)
 {
 	const char *tabs[] = {"", "\t", "\t\t", "\t\t\t", "\t\t\t\t", "\t\t\t\t\t", 
 			      "\t\t\t\t\t\t", "\t\t\t\t\t\t\t", "\t\t\t\t\t\t\t\t", 

Modified: branches/SAMBA_4_0/source/lib/util/pidfile.c
===================================================================
--- branches/SAMBA_4_0/source/lib/util/pidfile.c	2006-04-24 09:34:22 UTC (rev 15190)
+++ branches/SAMBA_4_0/source/lib/util/pidfile.c	2006-04-24 09:36:09 UTC (rev 15191)
@@ -40,7 +40,7 @@
 {
 	int fd;
 	char pidstr[20];
-	uint_t ret;
+	pid_t ret;
 	char *pidFile;
 
 	asprintf(&pidFile, "%s/%s.pid", lp_piddir(), name);
@@ -58,9 +58,9 @@
 		goto noproc;
 	}
 
-	ret = atoi(pidstr);
+	ret = (pid_t)atoi(pidstr);
 	
-	if (!process_exists((pid_t)ret)) {
+	if (!process_exists(ret)) {
 		goto noproc;
 	}
 
@@ -71,7 +71,7 @@
 
 	close(fd);
 	SAFE_FREE(pidFile);
-	return (pid_t)ret;
+	return ret;
 
  noproc:
 	close(fd);
@@ -113,7 +113,7 @@
 	}
 
 	memset(buf, 0, sizeof(buf));
-	slprintf(buf, sizeof(buf) - 1, "%u\n", (uint_t) getpid());
+	slprintf(buf, sizeof(buf) - 1, "%u\n", (unsigned int) getpid());
 	if (write(fd, buf, strlen(buf)) != (ssize_t)strlen(buf)) {
 		DEBUG(0,("ERROR: can't write to file %s: %s\n", 
 			 pidFile, strerror(errno)));

Modified: branches/SAMBA_4_0/source/lib/util/util.c
===================================================================
--- branches/SAMBA_4_0/source/lib/util/util.c	2006-04-24 09:34:22 UTC (rev 15190)
+++ branches/SAMBA_4_0/source/lib/util/util.c	2006-04-24 09:36:09 UTC (rev 15191)
@@ -212,7 +212,7 @@
  Sleep for a specified number of milliseconds.
 **/
 
-_PUBLIC_ void msleep(uint_t t)
+_PUBLIC_ void msleep(unsigned int t)
 {
 	struct timeval tval;  
 
@@ -581,7 +581,7 @@
  * see if a range of memory is all zero. A NULL pointer is considered
  * to be all zero 
  */
-_PUBLIC_ BOOL all_zero(const uint8_t *ptr, uint_t size)
+_PUBLIC_ BOOL all_zero(const uint8_t *ptr, size_t size)
 {
 	int i;
 	if (!ptr) return True;

Modified: branches/SAMBA_4_0/source/libcli/raw/raweas.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/raw/raweas.c	2006-04-24 09:34:22 UTC (rev 15190)
+++ branches/SAMBA_4_0/source/libcli/raw/raweas.c	2006-04-24 09:36:09 UTC (rev 15191)
@@ -26,7 +26,7 @@
   This assumes the names are strict ascii, which should be a
   reasonable assumption
 */
-uint_t ea_list_size(uint_t num_eas, struct ea_struct *eas)
+size_t ea_list_size(uint_t num_eas, struct ea_struct *eas)
 {
 	uint_t total = 4;
 	int i;
@@ -54,7 +54,7 @@
   This assumes the names are strict ascii, which should be a
   reasonable assumption
 */
-uint_t ea_list_size_chained(uint_t num_eas, struct ea_struct *eas)
+size_t ea_list_size_chained(uint_t num_eas, struct ea_struct *eas)
 {
 	uint_t total = 0;
 	int i;

Modified: branches/SAMBA_4_0/source/libcli/raw/rawnotify.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/raw/rawnotify.c	2006-04-24 09:34:22 UTC (rev 15190)
+++ branches/SAMBA_4_0/source/libcli/raw/rawnotify.c	2006-04-24 09:36:09 UTC (rev 15191)
@@ -96,7 +96,7 @@
   we need to do find out to what request the reply belongs
 ****************************************************************************/
 struct smbcli_request *smbcli_handle_ntcancel_reply(struct smbcli_request *req,
-						    uint_t len, const uint8_t *hdr)
+						    size_t len, const uint8_t *hdr)
 {
 	struct smbcli_request *ntcancel;
 

Modified: branches/SAMBA_4_0/source/libcli/raw/rawrequest.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/raw/rawrequest.c	2006-04-24 09:34:22 UTC (rev 15190)
+++ branches/SAMBA_4_0/source/libcli/raw/rawrequest.c	2006-04-24 09:36:09 UTC (rev 15191)
@@ -64,7 +64,7 @@
   low-level function to setup a request buffer for a non-SMB packet 
   at the transport level
 */
-struct smbcli_request *smbcli_request_setup_nonsmb(struct smbcli_transport *transport, uint_t size)
+struct smbcli_request *smbcli_request_setup_nonsmb(struct smbcli_transport *transport, size_t size)
 {
 	struct smbcli_request *req;
 
@@ -147,7 +147,7 @@
   way. This interface is used before a session is setup.
 */
 struct smbcli_request *smbcli_request_setup_session(struct smbcli_session *session,
-						    uint8_t command, uint_t wct, uint_t buflen)
+						    uint8_t command, uint_t wct, size_t buflen)
 {
 	struct smbcli_request *req;
 
@@ -254,7 +254,7 @@
 */
 NTSTATUS smbcli_chained_request_setup(struct smbcli_request *req,
 				      uint8_t command, 
-				      uint_t wct, uint_t buflen)
+				      uint_t wct, size_t buflen)
 {
 	uint_t new_size = 1 + (wct*2) + 2 + buflen;
 

Modified: branches/SAMBA_4_0/source/libcli/raw/request.h
===================================================================
--- branches/SAMBA_4_0/source/libcli/raw/request.h	2006-04-24 09:34:22 UTC (rev 15190)
+++ branches/SAMBA_4_0/source/libcli/raw/request.h	2006-04-24 09:36:09 UTC (rev 15191)
@@ -32,12 +32,12 @@
 	uint8_t *buffer;
 	
 	/* the size of the raw buffer, including 4 byte header */
-	uint_t size;
+	size_t size;
 	
 	/* how much has been allocated - on reply the buffer is over-allocated to 
 	   prevent too many realloc() calls 
 	*/
-	uint_t allocated;
+	size_t allocated;
 	
 	/* the start of the SMB header - this is always buffer+4 */
 	uint8_t *hdr;
@@ -45,11 +45,11 @@
 	/* the command words and command word count. vwv points
 	   into the raw buffer */
 	uint8_t *vwv;
-	uint_t wct;
+	size_t wct;
 	
 	/* the data buffer and size. data points into the raw buffer */
 	uint8_t *data;
-	uint_t data_size;
+	size_t data_size;
 	
 	/* ptr is used as a moving pointer into the data area
 	 * of the packet. The reason its here and not a local

Modified: branches/SAMBA_4_0/source/libcli/raw/smb_signing.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/raw/smb_signing.c	2006-04-24 09:34:22 UTC (rev 15190)
+++ branches/SAMBA_4_0/source/libcli/raw/smb_signing.c	2006-04-24 09:36:09 UTC (rev 15191)
@@ -101,7 +101,7 @@
 	return True;
 }
 
-void sign_outgoing_message(struct request_buffer *out, DATA_BLOB *mac_key, uint_t seq_num) 
+void sign_outgoing_message(struct request_buffer *out, DATA_BLOB *mac_key, unsigned int seq_num) 
 {
 	uint8_t calc_md5_mac[16];
 	struct MD5Context md5_ctx;

Modified: branches/SAMBA_4_0/source/libcli/smb2/request.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/smb2/request.c	2006-04-24 09:34:22 UTC (rev 15190)
+++ branches/SAMBA_4_0/source/libcli/smb2/request.c	2006-04-24 09:36:09 UTC (rev 15191)
@@ -168,7 +168,7 @@
 /*
   check if a range in the reply body is out of bounds
 */
-BOOL smb2_oob(struct smb2_request_buffer *buf, const uint8_t *ptr, uint_t size)
+BOOL smb2_oob(struct smb2_request_buffer *buf, const uint8_t *ptr, size_t size)
 {
 	/* be careful with wraparound! */
 	if (ptr < buf->body ||

Modified: branches/SAMBA_4_0/source/libcli/smb2/smb2.h
===================================================================
--- branches/SAMBA_4_0/source/libcli/smb2/smb2.h	2006-04-24 09:34:22 UTC (rev 15190)
+++ branches/SAMBA_4_0/source/libcli/smb2/smb2.h	2006-04-24 09:36:09 UTC (rev 15191)
@@ -75,19 +75,19 @@
 	uint8_t *buffer;
 	
 	/* the size of the raw buffer, including 4 byte header */
-	uint_t size;
+	size_t size;
 	
 	/* how much has been allocated - on reply the buffer is over-allocated to 
 	   prevent too many realloc() calls 
 	*/
-	uint_t allocated;
+	size_t allocated;
 	
 	/* the start of the SMB2 header - this is always buffer+4 */
 	uint8_t *hdr;
 	
 	/* the packet body */
 	uint8_t *body;
-	uint_t body_size;
+	size_t body_size;
 
 	/* this point to the next dynamic byte that can be used
 	 * this will be moved when some dynamic data is pushed
@@ -183,7 +183,7 @@
   check that a body has the expected size
 */
 #define SMB2_CHECK_PACKET_RECV(req, size, dynamic) do { \
-	uint_t is_size = req->in.body_size; \
+	size_t is_size = req->in.body_size; \
 	uint16_t field_size = SVAL(req->in.body, 0); \
 	uint16_t want_size = ((dynamic)?(size)+1:(size)); \
 	if (is_size < (size)) { \

Modified: branches/SAMBA_4_0/source/main.mk
===================================================================
--- branches/SAMBA_4_0/source/main.mk	2006-04-24 09:34:22 UTC (rev 15190)
+++ branches/SAMBA_4_0/source/main.mk	2006-04-24 09:36:09 UTC (rev 15191)
@@ -224,8 +224,9 @@
 	@echo "You need to rerun ./autogen.sh and ./configure"
 	@/bin/false
 
-clean_pch: 
-	-rm -f include/includes.h.gch
+clean_pch:
+	@echo "Removing precompiled headers"
+	@-rm -f include/includes.h.gch
 
 pch: clean_pch include/includes.h.gch
 

Modified: branches/SAMBA_4_0/source/scripting/swig/config.mk
===================================================================
--- branches/SAMBA_4_0/source/scripting/swig/config.mk	2006-04-24 09:34:22 UTC (rev 15190)
+++ branches/SAMBA_4_0/source/scripting/swig/config.mk	2006-04-24 09:36:09 UTC (rev 15191)
@@ -20,7 +20,8 @@
 scripting/swig/dcerpc_wrap.c: scripting/swig/dcerpc.i scripting/swig/samba.i scripting/swig/status_codes.i $(SWIG_INCLUDES)
 
 clean::
-	-rm -f scripting/swig/tdb.pyc scripting/swig/tdb.py
+	@echo "Removing SWIG output files"
+	@-rm -f scripting/swig/tdb.pyc scripting/swig/tdb.py
 
 # Swig testing
 

Modified: branches/SAMBA_4_0/source/smb_server/smb/request.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/smb/request.c	2006-04-24 09:34:22 UTC (rev 15190)
+++ branches/SAMBA_4_0/source/smb_server/smb/request.c	2006-04-24 09:36:09 UTC (rev 15191)
@@ -89,7 +89,7 @@
   the caller will then fill in the command words and data before calling req_send_reply() to 
   send the reply on its way
 */
-void smbsrv_setup_reply(struct smbsrv_request *req, uint_t wct, uint_t buflen)
+void smbsrv_setup_reply(struct smbsrv_request *req, uint_t wct, size_t buflen)
 {
 	uint16_t flags2;
 
@@ -248,7 +248,7 @@
   To cope with this req->out.ptr is supplied. This will be updated to
   point at the same offset into the packet as before this call
 */
-void req_grow_data(struct smbsrv_request *req, uint_t new_size)
+void req_grow_data(struct smbsrv_request *req, size_t new_size)
 {
 	int delta;
 
@@ -364,7 +364,7 @@
 
   if dest_len is -1 then no limit applies
 */
-size_t req_push_str(struct smbsrv_request *req, uint8_t *dest, const char *str, int dest_len, uint_t flags)
+size_t req_push_str(struct smbsrv_request *req, uint8_t *dest, const char *str, int dest_len, size_t flags)
 {
 	size_t len;
 	uint_t grow_size;

Modified: branches/SAMBA_4_0/source/smb_server/smb2/receive.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/smb2/receive.c	2006-04-24 09:34:22 UTC (rev 15190)
+++ branches/SAMBA_4_0/source/smb_server/smb2/receive.c	2006-04-24 09:36:09 UTC (rev 15191)
@@ -40,7 +40,7 @@
 	return req;
 }
 
-NTSTATUS smb2srv_setup_reply(struct smb2srv_request *req, uint_t body_fixed_size, uint_t body_dynamic_size)
+NTSTATUS smb2srv_setup_reply(struct smb2srv_request *req, uint_t body_fixed_size, size_t body_dynamic_size)
 {
 	req->out.size		= SMB2_HDR_BODY+NBT_HDR_SIZE+body_fixed_size;
 



More information about the samba-cvs mailing list