Index: uspace/app/nettest1/nettest1.c
===================================================================
--- uspace/app/nettest1/nettest1.c	(revision e52b4b59c1061c3dd893ff39ca793858bbafd080)
+++ uspace/app/nettest1/nettest1.c	(revision b5cf742a59181f253244bd8f695f588d137834ed)
@@ -54,8 +54,8 @@
 
 /** Echo module name. */
-#define NAME	"Nettest1"
+#define NAME  "nettest1"
 
 /** Packet data pattern. */
-#define NETTEST1_TEXT	"Networking test 1 - sockets"
+#define NETTEST1_TEXT  "Networking test 1 - sockets"
 
 static int family = PF_INET;
@@ -114,5 +114,5 @@
 	int value;
 	int rc;
-
+	
 	switch (argv[*index][1]) {
 	/*
@@ -120,7 +120,10 @@
 	 */
 	case 'f':
-		rc = arg_parse_name_int(argc, argv, index, &family, 0, socket_parse_protocol_family);
-		if (rc != EOK)
-			return rc;
+		rc = arg_parse_name_int(argc, argv, index, &value, 0,
+		    socket_parse_protocol_family);
+		if (rc != EOK)
+			return rc;
+		
+		family = (uint16_t) value;
 		break;
 	case 'h':
@@ -131,4 +134,5 @@
 		if (rc != EOK)
 			return rc;
+		
 		break;
 	case 'n':
@@ -136,4 +140,5 @@
 		if (rc != EOK)
 			return rc;
+		
 		break;
 	case 'p':
@@ -141,4 +146,5 @@
 		if (rc != EOK)
 			return rc;
+		
 		port = (uint16_t) value;
 		break;
@@ -147,10 +153,13 @@
 		if (rc != EOK)
 			return rc;
+		
 		size = (value >= 0) ? (size_t) value : 0;
 		break;
 	case 't':
-		rc = arg_parse_name_int(argc, argv, index, &value, 0, socket_parse_socket_type);
-		if (rc != EOK)
-			return rc;
+		rc = arg_parse_name_int(argc, argv, index, &value, 0,
+		    socket_parse_socket_type);
+		if (rc != EOK)
+			return rc;
+		
 		type = (sock_type_t) value;
 		break;
@@ -158,4 +167,5 @@
 		verbose = 1;
 		break;
+	
 	/*
 	 * Long options with double dash ('-')
@@ -163,8 +173,10 @@
 	case '-':
 		if (str_lcmp(argv[*index] + 2, "family=", 7) == 0) {
-			rc = arg_parse_name_int(argc, argv, index, &family, 9,
+			rc = arg_parse_name_int(argc, argv, index, &value, 9,
 			    socket_parse_protocol_family);
 			if (rc != EOK)
 				return rc;
+			
+			family = (uint16_t) value;
 		} else if (str_lcmp(argv[*index] + 2, "help", 5) == 0) {
 			nettest1_print_help();
@@ -182,4 +194,5 @@
 			if (rc != EOK)
 				return rc;
+			
 			port = (uint16_t) value;
 		} else if (str_lcmp(argv[*index] + 2, "type=", 5) == 0) {
@@ -188,4 +201,5 @@
 			if (rc != EOK)
 				return rc;
+			
 			type = (sock_type_t) value;
 		} else if (str_lcmp(argv[*index] + 2, "verbose", 8) == 0) {
@@ -200,5 +214,5 @@
 		return EINVAL;
 	}
-
+	
 	return EOK;
 }
@@ -211,7 +225,5 @@
 static void nettest1_fill_buffer(char *buffer, size_t size)
 {
-	size_t length;
-
-	length = 0;
+	size_t length = 0;
 	while (size > length + sizeof(NETTEST1_TEXT) - 1) {
 		memcpy(buffer + length, NETTEST1_TEXT,
@@ -219,5 +231,5 @@
 		length += sizeof(NETTEST1_TEXT) - 1;
 	}
-
+	
 	memcpy(buffer + length, NETTEST1_TEXT, size - length);
 	buffer[size] = '\0';
@@ -226,13 +238,11 @@
 static int nettest1_test(int *socket_ids, int nsockets, int nmessages)
 {
-	int rc;
-
 	if (verbose)
 		printf("%d sockets, %d messages\n", nsockets, nmessages);
-
-	rc = sockets_create(verbose, socket_ids, nsockets, family, type);
-	if (rc != EOK)
-		return rc;
-
+	
+	int rc = sockets_create(verbose, socket_ids, nsockets, family, type);
+	if (rc != EOK)
+		return rc;
+	
 	if (type == SOCK_STREAM) {
 		rc = sockets_connect(verbose, socket_ids, nsockets, address,
@@ -241,23 +251,23 @@
 			return rc;
 	}
-
+	
 	rc = sockets_sendto_recvfrom(verbose, socket_ids, nsockets, address,
 	    &addrlen, data, size, nmessages);
 	if (rc != EOK)
 		return rc;
-
+	
 	rc = sockets_close(verbose, socket_ids, nsockets);
 	if (rc != EOK)
 		return rc;
-
+	
 	if (verbose)
 		printf("\tOK\n");
-
+	
 	/****/
-
+	
 	rc = sockets_create(verbose, socket_ids, nsockets, family, type);
 	if (rc != EOK)
 		return rc;
-
+	
 	if (type == SOCK_STREAM) {
 		rc = sockets_connect(verbose, socket_ids, nsockets, address,
@@ -266,22 +276,22 @@
 			return rc;
 	}
-
+	
 	rc = sockets_sendto(verbose, socket_ids, nsockets, address, addrlen,
 	    data, size, nmessages);
 	if (rc != EOK)
 		return rc;
-
+	
 	rc = sockets_recvfrom(verbose, socket_ids, nsockets, address, &addrlen,
 	    data, size, nmessages);
 	if (rc != EOK)
 		return rc;
-
+	
 	rc = sockets_close(verbose, socket_ids, nsockets);
 	if (rc != EOK)
 		return rc;
-
+	
 	if (verbose)
 		printf("\tOK\n");
-
+	
 	return EOK;
 }
@@ -320,5 +330,5 @@
 		}
 	}
-
+	
 	/* If not before the last argument containing the host */
 	if (index >= argc) {
@@ -366,5 +376,5 @@
 		}
 	}
-
+	
 	/* Check data buffer size */
 	if (size <= 0) {
@@ -373,5 +383,5 @@
 		size = 1024;
 	}
-
+	
 	/*
 	 * Prepare data buffer. Allocate size bytes plus one for the
@@ -384,5 +394,5 @@
 	}
 	nettest1_fill_buffer(data, size);
-
+	
 	/* Check socket count */
 	if (sockets <= 0) {
@@ -391,5 +401,5 @@
 		sockets = 2;
 	}
-
+	
 	/*
 	 * Prepare socket buffer. Allocate count fields plus the terminating
@@ -401,9 +411,10 @@
 		return ENOMEM;
 	}
+	
 	socket_ids[sockets] = 0;
-
+	
 	if (verbose)
 		printf("Starting tests\n");
-
+	
 	rc = gettimeofday(&time_before, NULL);
 	if (rc != EOK) {
@@ -411,10 +422,10 @@
 		return rc;
 	}
-
+	
 	nettest1_test(socket_ids,       1,        1);
 	nettest1_test(socket_ids,       1, messages);
 	nettest1_test(socket_ids, sockets,        1);
 	nettest1_test(socket_ids, sockets, messages);
-
+	
 	rc = gettimeofday(&time_after, NULL);
 	if (rc != EOK) {
@@ -422,15 +433,14 @@
 		return rc;
 	}
-
+	
 	printf("Tested in %ld microseconds\n", tv_sub(&time_after,
 	    &time_before));
-
+	
 	if (verbose)
 		printf("Exiting\n");
-
+	
 	return EOK;
 }
 
-
 /** @}
  */
Index: uspace/app/nettest2/nettest2.c
===================================================================
--- uspace/app/nettest2/nettest2.c	(revision e52b4b59c1061c3dd893ff39ca793858bbafd080)
+++ uspace/app/nettest2/nettest2.c	(revision b5cf742a59181f253244bd8f695f588d137834ed)
@@ -55,8 +55,8 @@
 
 /** Echo module name. */
-#define NAME	"Nettest2"
+#define NAME  "nettest2"
 
 /** Packet data pattern. */
-#define NETTEST2_TEXT	"Networking test 2 - transfer"
+#define NETTEST2_TEXT  "Networking test 2 - transfer"
 
 static size_t size;
@@ -107,7 +107,5 @@
 static void nettest2_fill_buffer(char *buffer, size_t size)
 {
-	size_t length;
-
-	length = 0;
+	size_t length = 0;
 	while (size > length + sizeof(NETTEST2_TEXT) - 1) {
 		memcpy(buffer + length, NETTEST2_TEXT,
@@ -115,5 +113,5 @@
 		length += sizeof(NETTEST2_TEXT) - 1;
 	}
-
+	
 	memcpy(buffer + length, NETTEST2_TEXT, size - length);
 	buffer[size] = '\0';
@@ -130,5 +128,5 @@
 	int value;
 	int rc;
-
+	
 	switch (argv[*index][1]) {
 	/*
@@ -136,17 +134,19 @@
 	 */
 	case 'f':
-		rc = arg_parse_name_int(argc, argv, index, &family, 0,
+		rc = arg_parse_name_int(argc, argv, index, &value, 0,
 		    socket_parse_protocol_family);
 		if (rc != EOK)
 			return rc;
+		
+		family = (uint16_t) value;
 		break;
 	case 'h':
 		nettest2_print_help();
 		return EOK;
-		break;
 	case 'm':
 		rc = arg_parse_int(argc, argv, index, &messages, 0);
 		if (rc != EOK)
 			return rc;
+		
 		break;
 	case 'n':
@@ -154,4 +154,5 @@
 		if (rc != EOK)
 			return rc;
+		
 		break;
 	case 'p':
@@ -159,4 +160,5 @@
 		if (rc != EOK)
 			return rc;
+		
 		port = (uint16_t) value;
 		break;
@@ -165,4 +167,5 @@
 		if (rc != EOK)
 			return rc;
+		
 		size = (value >= 0) ? (size_t) value : 0;
 		break;
@@ -172,4 +175,5 @@
 		if (rc != EOK)
 			return rc;
+		
 		type = (sock_type_t) value;
 		break;
@@ -177,4 +181,5 @@
 		verbose = true;
 		break;
+	
 	/*
 	 * Long options with double dash ('-')
@@ -182,8 +187,10 @@
 	case '-':
 		if (str_lcmp(argv[*index] + 2, "family=", 7) == 0) {
-			rc = arg_parse_name_int(argc, argv, index, &family, 9,
+			rc = arg_parse_name_int(argc, argv, index, &value, 9,
 			    socket_parse_protocol_family);
 			if (rc != EOK)
 				return rc;
+			
+			family = (uint16_t) value;
 		} else if (str_lcmp(argv[*index] + 2, "help", 5) == 0) {
 			nettest2_print_help();
@@ -201,4 +208,5 @@
 			if (rc != EOK)
 				return rc;
+			
 			port = (uint16_t) value;
 		} else if (str_lcmp(argv[*index] + 2, "type=", 5) == 0) {
@@ -207,4 +215,5 @@
 			if (rc != EOK)
 				return rc;
+			
 			type = (sock_type_t) value;
 		} else if (str_lcmp(argv[*index] + 2, "verbose", 8) == 0) {
@@ -219,5 +228,5 @@
 		return EINVAL;
 	}
-
+	
 	return EOK;
 }
@@ -266,5 +275,5 @@
 		}
 	}
-
+	
 	/* If not before the last argument containing the host */
 	if (index >= argc) {
@@ -312,5 +321,5 @@
 		}
 	}
-
+	
 	/* Check data buffer size. */
 	if (size <= 0) {
@@ -319,5 +328,5 @@
 		size = 1024;
 	}
-
+	
 	/*
 	 * Prepare the buffer. Allocate size bytes plus one for terminating
@@ -329,8 +338,8 @@
 		return ENOMEM;
 	}
-
+	
 	/* Fill buffer with a pattern. */
 	nettest2_fill_buffer(data, size);
-
+	
 	/* Check socket count. */
 	if (sockets <= 0) {
@@ -339,5 +348,5 @@
 		sockets = 2;
 	}
-
+	
 	/*
 	 * Prepare the socket buffer.
@@ -350,12 +359,12 @@
 	}
 	socket_ids[sockets] = 0;
-
+	
 	if (verbose)
 		printf("Starting tests\n");
-
+	
 	rc = sockets_create(verbose, socket_ids, sockets, family, type);
 	if (rc != EOK)
 		return rc;
-
+	
 	if (type == SOCK_STREAM) {
 		rc = sockets_connect(verbose, socket_ids, sockets,
@@ -364,8 +373,8 @@
 			return rc;
 	}
-
+	
 	if (verbose)
 		printf("\n");
-
+	
 	rc = gettimeofday(&time_before, NULL);
 	if (rc != EOK) {
@@ -373,10 +382,10 @@
 		return rc;
 	}
-
+	
 	rc = sockets_sendto_recvfrom(verbose, socket_ids, sockets, address,
 	    &addrlen, data, size, messages);
 	if (rc != EOK)
 		return rc;
-
+	
 	rc = gettimeofday(&time_after, NULL);
 	if (rc != EOK) {
@@ -384,11 +393,11 @@
 		return rc;
 	}
-
+	
 	if (verbose)
 		printf("\tOK\n");
-
+	
 	printf("sendto + recvfrom tested in %ld microseconds\n",
 	    tv_sub(&time_after, &time_before));
-
+	
 	rc = gettimeofday(&time_before, NULL);
 	if (rc != EOK) {
@@ -396,15 +405,15 @@
 		return rc;
 	}
-
+	
 	rc = sockets_sendto(verbose, socket_ids, sockets, address, addrlen,
 	    data, size, messages);
 	if (rc != EOK)
 		return rc;
-
+	
 	rc = sockets_recvfrom(verbose, socket_ids, sockets, address, &addrlen,
 	    data, size, messages);
 	if (rc != EOK)
 		return rc;
-
+	
 	rc = gettimeofday(&time_after, NULL);
 	if (rc != EOK) {
@@ -412,18 +421,18 @@
 		return rc;
 	}
-
+	
 	if (verbose)
 		printf("\tOK\n");
-
+	
 	printf("sendto, recvfrom tested in %ld microseconds\n",
 	    tv_sub(&time_after, &time_before));
-
+	
 	rc = sockets_close(verbose, socket_ids, sockets);
 	if (rc != EOK)
 		return rc;
-
+	
 	if (verbose)
 		printf("\nExiting\n");
-
+	
 	return EOK;
 }
Index: uspace/app/nterm/conn.c
===================================================================
--- uspace/app/nterm/conn.c	(revision e52b4b59c1061c3dd893ff39ca793858bbafd080)
+++ uspace/app/nterm/conn.c	(revision b5cf742a59181f253244bd8f695f588d137834ed)
@@ -103,23 +103,23 @@
 		goto error;
 	}
-
+	
 	conn_fd = socket(PF_INET, SOCK_STREAM, 0);
 	if (conn_fd < 0)
 		goto error;
-
+	
 	printf("Connecting to host %s port %u\n", addr_s, ntohs(addr.sin_port));
-
+	
 	rc = connect(conn_fd, (struct sockaddr *)&addr, sizeof(addr));
 	if (rc != EOK)
 		goto error;
-
+	
 	rcv_fid = fibril_create(rcv_fibril, NULL);
 	if (rcv_fid == 0)
 		goto error;
-
+	
 	fibril_add_ready(rcv_fid);
-
+	
 	return EOK;
-
+	
 error:
 	if (conn_fd >= 0) {
@@ -127,5 +127,5 @@
 		conn_fd = -1;
 	}
-
+	
 	return EIO;
 }
@@ -133,10 +133,8 @@
 int conn_send(void *data, size_t size)
 {
-	int rc;
-
-	rc = send(conn_fd, data, size, 0);
+	int rc = send(conn_fd, data, size, 0);
 	if (rc != EOK)
 		return EIO;
-
+	
 	return EOK;
 }
Index: uspace/lib/c/generic/inet.c
===================================================================
--- uspace/lib/c/generic/inet.c	(revision e52b4b59c1061c3dd893ff39ca793858bbafd080)
+++ uspace/lib/c/generic/inet.c	(revision b5cf742a59181f253244bd8f695f588d137834ed)
@@ -169,5 +169,5 @@
 	inet_addr_unpack(IPC_GET_ARG2(*call), &dgram.dest);
 	dgram.tos = IPC_GET_ARG3(*call);
-
+	
 	rc = async_data_write_accept(&dgram.data, false, 0, 0, 0, &dgram.size);
 	if (rc != EOK) {
@@ -175,5 +175,5 @@
 		return;
 	}
-
+	
 	rc = inet_ev_ops->recv(&dgram);
 	async_answer_0(callid, rc);
@@ -185,10 +185,10 @@
 		ipc_call_t call;
 		ipc_callid_t callid = async_get_call(&call);
-
+		
 		if (!IPC_GET_IMETHOD(call)) {
 			/* TODO: Handle hangup */
 			return;
 		}
-
+		
 		switch (IPC_GET_IMETHOD(call)) {
 		case INET_EV_RECV:
Index: uspace/lib/c/generic/inetcfg.c
===================================================================
--- uspace/lib/c/generic/inetcfg.c	(revision e52b4b59c1061c3dd893ff39ca793858bbafd080)
+++ uspace/lib/c/generic/inetcfg.c	(revision b5cf742a59181f253244bd8f695f588d137834ed)
@@ -159,5 +159,5 @@
 	*addr_id = IPC_GET_ARG1(answer);
 	
-	return retval;
+	return (int) retval;
 }
 
@@ -178,27 +178,28 @@
 	size_t act_size;
 	char name_buf[LOC_NAME_MAXLEN + 1];
-
-	async_exch_t *exch = async_exchange_begin(inetcfg_sess);
-
+	
+	async_exch_t *exch = async_exchange_begin(inetcfg_sess);
+	
 	ipc_call_t answer;
 	aid_t req = async_send_1(exch, INETCFG_ADDR_GET, addr_id, &answer);
 	aid_t dreq = async_data_read(exch, name_buf, LOC_NAME_MAXLEN, &dreply);
 	async_wait_for(dreq, &dretval);
-
-	async_exchange_end(exch);
-
+	
+	async_exchange_end(exch);
+	
 	if (dretval != EOK) {
 		async_forget(req);
 		return dretval;
 	}
-
+	
 	sysarg_t retval;
 	async_wait_for(req, &retval);
-
+	
 	if (retval != EOK)
-		return retval;
-
+		return (int) retval;
+	
 	act_size = IPC_GET_ARG2(dreply);
 	assert(act_size <= LOC_NAME_MAXLEN);
+	
 	name_buf[act_size] = '\0';
 	
@@ -207,5 +208,5 @@
 	ainfo->ilink = IPC_GET_ARG3(answer);
 	ainfo->name = str_dup(name_buf);
-
+	
 	return EOK;
 }
@@ -340,23 +341,23 @@
 
 	async_exch_t *exch = async_exchange_begin(inetcfg_sess);
-
+	
 	ipc_call_t answer;
 	aid_t req = async_send_1(exch, INETCFG_SROUTE_GET, sroute_id, &answer);
 	aid_t dreq = async_data_read(exch, name_buf, LOC_NAME_MAXLEN, &dreply);
 	async_wait_for(dreq, &dretval);
-
-	async_exchange_end(exch);
-
+	
+	async_exchange_end(exch);
+	
 	if (dretval != EOK) {
 		async_forget(req);
 		return dretval;
 	}
-
+	
 	sysarg_t retval;
 	async_wait_for(req, &retval);
-
+	
 	if (retval != EOK)
-		return retval;
-
+		return (int) retval;
+	
 	act_size = IPC_GET_ARG2(dreply);
 	assert(act_size <= LOC_NAME_MAXLEN);
@@ -367,5 +368,5 @@
 	inet_addr_unpack(IPC_GET_ARG3(answer), &srinfo->router);
 	srinfo->name = str_dup(name_buf);
-
+	
 	return EOK;
 }
Index: uspace/lib/c/generic/iplink.c
===================================================================
--- uspace/lib/c/generic/iplink.c	(revision e52b4b59c1061c3dd893ff39ca793858bbafd080)
+++ uspace/lib/c/generic/iplink.c	(revision b5cf742a59181f253244bd8f695f588d137834ed)
@@ -99,8 +99,6 @@
 	sysarg_t retval;
 	async_wait_for(req, &retval);
-	if (retval != EOK)
-		return retval;
 	
-	return EOK;
+	return (int) retval;
 }
 
@@ -169,15 +167,15 @@
 static void iplink_cb_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg)
 {
-	iplink_t *iplink = (iplink_t *)arg;
-
+	iplink_t *iplink = (iplink_t *) arg;
+	
 	while (true) {
 		ipc_call_t call;
 		ipc_callid_t callid = async_get_call(&call);
-
+		
 		if (!IPC_GET_IMETHOD(call)) {
 			/* TODO: Handle hangup */
 			return;
 		}
-
+		
 		switch (IPC_GET_IMETHOD(call)) {
 		case IPLINK_EV_RECV:
Index: uspace/lib/c/generic/iplink_srv.c
===================================================================
--- uspace/lib/c/generic/iplink_srv.c	(revision e52b4b59c1061c3dd893ff39ca793858bbafd080)
+++ uspace/lib/c/generic/iplink_srv.c	(revision b5cf742a59181f253244bd8f695f588d137834ed)
@@ -44,8 +44,6 @@
     ipc_call_t *call)
 {
-	int rc;
 	size_t mtu;
-
-	rc = srv->ops->get_mtu(srv, &mtu);
+	int rc = srv->ops->get_mtu(srv, &mtu);
 	async_answer_1(callid, rc, mtu);
 }
@@ -70,8 +68,8 @@
 	iplink_srv_sdu_t sdu;
 	int rc;
-
+	
 	sdu.lsrc = IPC_GET_ARG1(*call);
 	sdu.ldest = IPC_GET_ARG2(*call);
-
+	
 	rc = async_data_write_accept(&sdu.data, false, 0, 0, 0, &sdu.size);
 	if (rc != EOK) {
@@ -79,5 +77,5 @@
 		return;
 	}
-
+	
 	rc = srv->ops->send(srv, &sdu);
 	free(sdu.data);
@@ -98,5 +96,5 @@
 	iplink_srv_t *srv = (iplink_srv_t *)arg;
 	int rc;
-
+	
 	fibril_mutex_lock(&srv->lock);
 	if (srv->connected) {
@@ -105,26 +103,26 @@
 		return EBUSY;
 	}
-
+	
 	srv->connected = true;
 	fibril_mutex_unlock(&srv->lock);
-
+	
 	/* Accept the connection */
 	async_answer_0(iid, EOK);
-
+	
 	async_sess_t *sess = async_callback_receive(EXCHANGE_SERIALIZE);
 	if (sess == NULL)
 		return ENOMEM;
-
+	
 	srv->client_sess = sess;
-
+	
 	rc = srv->ops->open(srv);
 	if (rc != EOK)
 		return rc;
-
+	
 	while (true) {
 		ipc_call_t call;
 		ipc_callid_t callid = async_get_call(&call);
 		sysarg_t method = IPC_GET_IMETHOD(call);
-
+		
 		if (!method) {
 			/* The other side has hung up */
@@ -135,5 +133,5 @@
 			break;
 		}
-
+		
 		switch (method) {
 		case IPLINK_GET_MTU:
@@ -153,5 +151,5 @@
 		}
 	}
-
+	
 	return srv->ops->close(srv);
 }
@@ -161,7 +159,7 @@
 	if (srv->client_sess == NULL)
 		return EIO;
-
+	
 	async_exch_t *exch = async_exchange_begin(srv->client_sess);
-
+	
 	ipc_call_t answer;
 	aid_t req = async_send_2(exch, IPLINK_EV_RECV, (sysarg_t) sdu->lsrc,
@@ -169,15 +167,15 @@
 	int rc = async_data_write_start(exch, sdu->data, sdu->size);
 	async_exchange_end(exch);
-
+	
 	if (rc != EOK) {
 		async_forget(req);
 		return rc;
 	}
-
+	
 	sysarg_t retval;
 	async_wait_for(req, &retval);
 	if (retval != EOK)
 		return retval;
-
+	
 	return EOK;
 }
