change log for rtems (2010-05-26)

rtems-vc at rtems.org rtems-vc at rtems.org
Wed May 26 07:12:28 UTC 2010


 *ralf*:
2010-05-26	Ralf Corsépius <ralf.corsepius at rtems.org>

	* librpc/src/rpc/clnt_udp.c: Cosmetics from freebsd.

M 1.2306  cpukit/ChangeLog
M   1.10  cpukit/librpc/src/rpc/clnt_udp.c

diff -u rtems/cpukit/ChangeLog:1.2305 rtems/cpukit/ChangeLog:1.2306
--- rtems/cpukit/ChangeLog:1.2305	Tue May 25 23:15:02 2010
+++ rtems/cpukit/ChangeLog	Wed May 26 01:23:58 2010
@@ -1,5 +1,9 @@
 2010-05-26	Ralf Corsépius <ralf.corsepius at rtems.org>
 
+	* librpc/src/rpc/clnt_udp.c: Cosmetics from freebsd.
+
+2010-05-26	Ralf Corsépius <ralf.corsepius at rtems.org>
+
 	* librpc/src/rpc/clnt_tcp.c: Partial merger from freebsd
 	(Fix strict-aliasing).
 

diff -u rtems/cpukit/librpc/src/rpc/clnt_udp.c:1.9 rtems/cpukit/librpc/src/rpc/clnt_udp.c:1.10
--- rtems/cpukit/librpc/src/rpc/clnt_udp.c:1.9	Thu Apr 29 04:42:52 2010
+++ rtems/cpukit/librpc/src/rpc/clnt_udp.c	Wed May 26 01:23:58 2010
@@ -79,17 +79,17 @@
  */
 struct cu_data {
 	int		   cu_sock;
-	bool_t		   cu_closeit;
+	bool_t			cu_closeit;	/* opened by library */
 	struct sockaddr_in cu_raddr;
 	int		   cu_rlen;
-	struct timeval	   cu_wait;
-	struct timeval     cu_total;
+	struct timeval		cu_wait;	/* retransmit interval */
+	struct timeval		cu_total;	/* total time for the call */
 	struct rpc_err	   cu_error;
 	XDR		   cu_outxdrs;
 	u_int		   cu_xdrpos;
-	u_int		   cu_sendsz;
+	u_int			cu_sendsz;	/* send size */
 	char		   *cu_outbuf;
-	u_int		   cu_recvsz;
+	u_int			cu_recvsz;	/* recv size */
 	char		   cu_inbuf[1];
 };
 
@@ -119,8 +119,8 @@
 	u_int sendsz,
 	u_int recvsz)
 {
-	CLIENT *cl;
-	register struct cu_data *cu = NULL;
+	CLIENT *cl = NULL;		/* client handle */
+	struct cu_data *cu = NULL;	/* private data */
 	struct timeval now;
 	struct rpc_msg call_msg;
 	static uintptr_t disrupt;
@@ -137,7 +137,7 @@
 	}
 	sendsz = ((sendsz + 3) / 4) * 4;
 	recvsz = ((recvsz + 3) / 4) * 4;
-	cu = (struct cu_data *)mem_alloc(sizeof(*cu) + sendsz + recvsz);
+	cu = mem_alloc(sizeof (*cu) + sendsz + recvsz);
 	if (cu == NULL) {
 		(void) fprintf(stderr, "clntudp_create: out of memory\n");
 		rpc_createerr.cf_stat = RPC_SYSTEMERROR;
@@ -226,10 +226,10 @@
 	caddr_t		resultsp,	/* pointer to results */
 	struct timeval	utimeout )	/* seconds to wait before giving up */
 {
-	register struct cu_data *cu = (struct cu_data *)cl->cl_private;
-	register XDR *xdrs;
-	register int outlen;
-	register int inlen;
+	struct cu_data *cu = (struct cu_data *)cl->cl_private;
+	XDR *xdrs;
+	size_t outlen = 0;
+	int inlen;
 	socklen_t fromlen;
 	fd_set *fds, readfds;
 	struct sockaddr_in from;
@@ -273,7 +273,7 @@
 			free(fds);
 		return (cu->cu_error.re_status = RPC_CANTENCODEARGS);
 	}
-	outlen = (int)XDR_GETPOS(xdrs);
+	outlen = (size_t)XDR_GETPOS(xdrs);
 
 send_again:
 	if (sendto(cu->cu_sock, cu->cu_outbuf, outlen, 0,
@@ -413,7 +413,7 @@
 	CLIENT *cl,
 	struct rpc_err *errp)
 {
-	register struct cu_data *cu = (struct cu_data *)cl->cl_private;
+	struct cu_data *cu = (struct cu_data *)cl->cl_private;
 
 	*errp = cu->cu_error;
 }
@@ -425,8 +425,8 @@
 	xdrproc_t xdr_res,
 	caddr_t res_ptr)
 {
-	register struct cu_data *cu = (struct cu_data *)cl->cl_private;
-	register XDR *xdrs = &(cu->cu_outxdrs);
+	struct cu_data *cu = (struct cu_data *)cl->cl_private;
+	XDR *xdrs = &(cu->cu_outxdrs);
 
 	xdrs->x_op = XDR_FREE;
 	return ((*xdr_res)(xdrs, res_ptr));
@@ -444,8 +444,8 @@
 	int request,
 	char *info)
 {
-	register struct cu_data *cu = (struct cu_data *)cl->cl_private;
-	register struct timeval *tv;
+	struct cu_data *cu = (struct cu_data *)cl->cl_private;
+	struct timeval *tv;
 	socklen_t len;
 
 	switch (request) {
@@ -526,7 +526,7 @@
 	case CLGET_PROG:
 		/*
 		 * This RELIES on the information that, in the call body,
-		 * the program number field is the  field from the
+		 * the program number field is the fourth field from the
 		 * begining of the RPC header. MUST be changed if the
 		 * call_struct is changed
 		 */
@@ -560,12 +560,12 @@
 clntudp_destroy(
 	CLIENT *cl)
 {
-	register struct cu_data *cu = (struct cu_data *)cl->cl_private;
+	struct cu_data *cu = (struct cu_data *)cl->cl_private;
 
 	if (cu->cu_closeit) {
 		(void)_RPC_close(cu->cu_sock);
 	}
 	XDR_DESTROY(&(cu->cu_outxdrs));
-	mem_free((caddr_t)cu, (sizeof(*cu) + cu->cu_sendsz + cu->cu_recvsz));
-	mem_free((caddr_t)cl, sizeof(CLIENT));
+	mem_free(cu, (sizeof (*cu) + cu->cu_sendsz + cu->cu_recvsz));
+	mem_free(cl, sizeof (CLIENT));
 }



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20100526/f9c7c5b1/attachment-0001.html>


More information about the vc mailing list