Index: bitlbee.c
===================================================================
--- bitlbee.c	(revision 13857c648210a16448619c65e33f9918bfe27cbe)
+++ bitlbee.c	(revision 52744f8f65a278a59a8903d5c594e057d63c7006)
@@ -279,5 +279,5 @@
 			child_list = g_slist_append( child_list, child );
 			
-			log_message( LOGLVL_INFO, "Creating new subprocess with pid %d.", client_pid );
+			log_message( LOGLVL_INFO, "Creating new subprocess with pid %d.", (int) client_pid );
 			
 			/* Close some things we don't need in the parent process. */
Index: ipc.c
===================================================================
--- ipc.c	(revision 13857c648210a16448619c65e33f9918bfe27cbe)
+++ ipc.c	(revision 52744f8f65a278a59a8903d5c594e057d63c7006)
@@ -52,5 +52,5 @@
 	if( g_strcasecmp( cmd[0], "CLIENT" ) == 0 )
 		ipc_to_children_str( "OPERMSG :Client connecting (PID=%d): %s@%s (%s)\r\n",
-		                     child ? child->pid : -1, cmd[2], cmd[1], cmd[3] );
+		                     (int) ( child ? child->pid : -1 ), cmd[2], cmd[1], cmd[3] );
 }
 
@@ -446,5 +446,5 @@
 	
 	for( l = child_list; l; l = l->next )
-		fprintf( fp, "%d %d\n", ((struct bitlbee_child*)l->data)->pid,
+		fprintf( fp, "%d %d\n", (int) ((struct bitlbee_child*)l->data)->pid,
 		                        ((struct bitlbee_child*)l->data)->ipc_fd );
 	
@@ -551,5 +551,5 @@
 		child = g_new0( struct bitlbee_child, 1 );
 		
-		if( fscanf( fp, "%d %d", &child->pid, &child->ipc_fd ) != 2 )
+		if( fscanf( fp, "%d %d", (int *) &child->pid, &child->ipc_fd ) != 2 )
 		{
 			log_message( LOGLVL_WARNING, "Unexpected end of file: Only processed %d clients.", i );
Index: lib/md5.c
===================================================================
--- lib/md5.c	(revision 13857c648210a16448619c65e33f9918bfe27cbe)
+++ lib/md5.c	(revision 52744f8f65a278a59a8903d5c594e057d63c7006)
@@ -26,5 +26,5 @@
 #include "md5.h"
 
-static void md5_transform(u_int32_t buf[4], u_int32_t const in[16]);
+static void md5_transform(uint32_t buf[4], uint32_t const in[16]);
 
 /*
@@ -53,10 +53,10 @@
 		unsigned int len)
 {
-	u_int32_t t;
+	uint32_t t;
 
 	/* Update bitcount */
 
 	t = ctx->bits[0];
-	if ((ctx->bits[0] = t + ((u_int32_t) len << 3)) < t)
+	if ((ctx->bits[0] = t + ((uint32_t) len << 3)) < t)
 		ctx->bits[1]++;	/* Carry from low to high */
 	ctx->bits[1] += len >> 29;
@@ -75,5 +75,5 @@
 		}
 		memcpy(p, buf, t);
-		md5_transform(ctx->buf, (u_int32_t *) ctx->in);
+		md5_transform(ctx->buf, (uint32_t *) ctx->in);
 		buf += t;
 		len -= t;
@@ -83,5 +83,5 @@
 	while (len >= 64) {
 		memcpy(ctx->in, buf, 64);
-		md5_transform(ctx->buf, (u_int32_t *) ctx->in);
+		md5_transform(ctx->buf, (uint32_t *) ctx->in);
 		buf += 64;
 		len -= 64;
@@ -117,5 +117,5 @@
 		/* Two lots of padding:  Pad the first block to 64 bytes */
 		memset(p, 0, count);
-		md5_transform(ctx->buf, (u_int32_t *) ctx->in);
+		md5_transform(ctx->buf, (uint32_t *) ctx->in);
 
 		/* Now fill the next block with 56 bytes */
@@ -127,8 +127,8 @@
 
 	/* Append length in bits and transform */
-	((u_int32_t *) ctx->in)[14] = ctx->bits[0];
-	((u_int32_t *) ctx->in)[15] = ctx->bits[1];
-
-	md5_transform(ctx->buf, (u_int32_t *) ctx->in);
+	((uint32_t *) ctx->in)[14] = ctx->bits[0];
+	((uint32_t *) ctx->in)[15] = ctx->bits[1];
+
+	md5_transform(ctx->buf, (uint32_t *) ctx->in);
 	memcpy(digest, ctx->buf, 16);
 	memset(ctx, 0, sizeof(ctx));	/* In case it's sensitive */
@@ -152,7 +152,7 @@
  * the data and converts bytes into longwords for this routine.
  */
-static void md5_transform(u_int32_t buf[4], u_int32_t const in[16])
-{
-	register u_int32_t a, b, c, d;
+static void md5_transform(uint32_t buf[4], uint32_t const in[16])
+{
+	register uint32_t a, b, c, d;
 
 	a = buf[0];
Index: lib/md5.h
===================================================================
--- lib/md5.h	(revision 13857c648210a16448619c65e33f9918bfe27cbe)
+++ lib/md5.h	(revision 52744f8f65a278a59a8903d5c594e057d63c7006)
@@ -27,9 +27,10 @@
 #include <sys/types.h>
 #include <gmodule.h>
+#include <stdint.h>
 
-typedef u_int8_t md5_byte_t;
+typedef uint8_t md5_byte_t;
 typedef struct MD5Context {
-	u_int32_t buf[4];
-	u_int32_t bits[2];
+	uint32_t buf[4];
+	uint32_t bits[2];
 	unsigned char in[64];
 } md5_state_t;
Index: protocols/nogaim.c
===================================================================
--- protocols/nogaim.c	(revision 13857c648210a16448619c65e33f9918bfe27cbe)
+++ protocols/nogaim.c	(revision 52744f8f65a278a59a8903d5c594e057d63c7006)
@@ -625,5 +625,5 @@
 }
 
-void imcb_buddy_msg( struct im_connection *ic, char *handle, char *msg, u_int32_t flags, time_t sent_at )
+void imcb_buddy_msg( struct im_connection *ic, char *handle, char *msg, uint32_t flags, time_t sent_at )
 {
 	irc_t *irc = ic->irc;
@@ -676,5 +676,5 @@
 }
 
-void imcb_buddy_typing( struct im_connection *ic, char *handle, u_int32_t flags )
+void imcb_buddy_typing( struct im_connection *ic, char *handle, uint32_t flags )
 {
 	user_t *u;
@@ -732,5 +732,5 @@
 }
 
-void imcb_chat_msg( struct groupchat *c, char *who, char *msg, u_int32_t flags, time_t sent_at )
+void imcb_chat_msg( struct groupchat *c, char *who, char *msg, uint32_t flags, time_t sent_at )
 {
 	struct im_connection *ic = c->ic;
Index: protocols/nogaim.h
===================================================================
--- protocols/nogaim.h	(revision 13857c648210a16448619c65e33f9918bfe27cbe)
+++ protocols/nogaim.h	(revision 52744f8f65a278a59a8903d5c594e057d63c7006)
@@ -68,5 +68,5 @@
 {
 	account_t *acc;
-	u_int32_t flags;
+	uint32_t flags;
 	
 	/* each connection then can have its own protocol-specific data */
@@ -282,6 +282,6 @@
 /* Not implemented yet! */ G_MODULE_EXPORT void imcb_buddy_times( struct im_connection *ic, const char *handle, time_t login, time_t idle );
 /* Call when a handle says something. 'flags' and 'sent_at may be just 0. */
-G_MODULE_EXPORT void imcb_buddy_msg( struct im_connection *ic, char *handle, char *msg, u_int32_t flags, time_t sent_at );
-G_MODULE_EXPORT void imcb_buddy_typing( struct im_connection *ic, char *handle, u_int32_t flags );
+G_MODULE_EXPORT void imcb_buddy_msg( struct im_connection *ic, char *handle, char *msg, uint32_t flags, time_t sent_at );
+G_MODULE_EXPORT void imcb_buddy_typing( struct im_connection *ic, char *handle, uint32_t flags );
 G_MODULE_EXPORT void imcb_clean_handle( struct im_connection *ic, char *handle );
 
@@ -299,5 +299,5 @@
 G_MODULE_EXPORT void imcb_chat_remove_buddy( struct groupchat *b, char *handle, char *reason );
 /* To tell BitlBee 'who' said 'msg' in 'c'. 'flags' and 'sent_at' can be 0. */
-G_MODULE_EXPORT void imcb_chat_msg( struct groupchat *c, char *who, char *msg, u_int32_t flags, time_t sent_at );
+G_MODULE_EXPORT void imcb_chat_msg( struct groupchat *c, char *who, char *msg, uint32_t flags, time_t sent_at );
 /* To tell BitlBee 'who' changed the topic of 'c' to 'topic'. */
 G_MODULE_EXPORT void imcb_chat_topic( struct groupchat *c, char *who, char *topic, time_t set_at );
Index: unix.c
===================================================================
--- unix.c	(revision 13857c648210a16448619c65e33f9918bfe27cbe)
+++ unix.c	(revision 52744f8f65a278a59a8903d5c594e057d63c7006)
@@ -197,7 +197,7 @@
 		{
 			if( WIFSIGNALED( st ) )
-				log_message( LOGLVL_INFO, "Client %d terminated normally. (status = %d)", pid, WEXITSTATUS( st ) );
+				log_message( LOGLVL_INFO, "Client %d terminated normally. (status = %d)", (int) pid, WEXITSTATUS( st ) );
 			else if( WIFEXITED( st ) )
-				log_message( LOGLVL_INFO, "Client %d killed by signal %d.", pid, WTERMSIG( st ) );
+				log_message( LOGLVL_INFO, "Client %d killed by signal %d.", (int) pid, WTERMSIG( st ) );
 		}
 	}
