aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitlbee.c2
-rw-r--r--ipc.c6
-rw-r--r--lib/md5.c22
-rw-r--r--lib/md5.h7
-rw-r--r--protocols/nogaim.c6
-rw-r--r--protocols/nogaim.h8
-rw-r--r--unix.c4
7 files changed, 28 insertions, 27 deletions
diff --git a/bitlbee.c b/bitlbee.c
index 3f488b46..c4b5abb3 100644
--- a/bitlbee.c
+++ b/bitlbee.c
@@ -278,7 +278,7 @@ static gboolean bitlbee_io_new_client( gpointer data, gint fd, b_input_condition
child->ipc_inpa = b_input_add( child->ipc_fd, GAIM_INPUT_READ, ipc_master_read, child );
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. */
close( new_socket );
diff --git a/ipc.c b/ipc.c
index d0d2dff3..384a9c33 100644
--- a/ipc.c
+++ b/ipc.c
@@ -51,7 +51,7 @@ static void ipc_master_cmd_client( irc_t *data, char **cmd )
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] );
}
static void ipc_master_cmd_die( irc_t *data, char **cmd )
@@ -445,7 +445,7 @@ char *ipc_master_save_state()
fprintf( fp, "%d\n", i );
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 );
if( fclose( fp ) == 0 )
@@ -550,7 +550,7 @@ int ipc_master_load_state()
{
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 );
g_free( child );
diff --git a/lib/md5.c b/lib/md5.c
index 08c298a2..f1779794 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -25,7 +25,7 @@
#include <string.h> /* for memcpy() */
#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]);
/*
* Wrapper function for all-in-one MD5
@@ -52,12 +52,12 @@ void md5_init(struct MD5Context *ctx)
void md5_append(struct MD5Context *ctx, const md5_byte_t *buf,
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;
@@ -74,7 +74,7 @@ void md5_append(struct MD5Context *ctx, const md5_byte_t *buf,
return;
}
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;
}
@@ -82,7 +82,7 @@ void md5_append(struct MD5Context *ctx, const md5_byte_t *buf,
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;
}
@@ -116,7 +116,7 @@ void md5_finish(struct MD5Context *ctx, md5_byte_t digest[16])
if (count < 8) {
/* 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 */
memset(ctx->in, 0, 56);
@@ -126,10 +126,10 @@ void md5_finish(struct MD5Context *ctx, md5_byte_t digest[16])
}
/* Append length in bits and transform */
- ((u_int32_t *) ctx->in)[14] = ctx->bits[0];
- ((u_int32_t *) ctx->in)[15] = ctx->bits[1];
+ ((uint32_t *) ctx->in)[14] = ctx->bits[0];
+ ((uint32_t *) ctx->in)[15] = ctx->bits[1];
- md5_transform(ctx->buf, (u_int32_t *) ctx->in);
+ md5_transform(ctx->buf, (uint32_t *) ctx->in);
memcpy(digest, ctx->buf, 16);
memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
}
@@ -151,9 +151,9 @@ void md5_finish(struct MD5Context *ctx, md5_byte_t digest[16])
* reflect the addition of 16 longwords of new data. MD5Update blocks
* 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])
+static void md5_transform(uint32_t buf[4], uint32_t const in[16])
{
- register u_int32_t a, b, c, d;
+ register uint32_t a, b, c, d;
a = buf[0];
b = buf[1];
diff --git a/lib/md5.h b/lib/md5.h
index 86568b7a..094507b2 100644
--- a/lib/md5.h
+++ b/lib/md5.h
@@ -26,11 +26,12 @@
#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;
diff --git a/protocols/nogaim.c b/protocols/nogaim.c
index 5e698902..b9008af1 100644
--- a/protocols/nogaim.c
+++ b/protocols/nogaim.c
@@ -624,7 +624,7 @@ void imcb_buddy_status( struct im_connection *ic, const char *handle, int flags,
}
}
-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;
char *wrapped;
@@ -675,7 +675,7 @@ void imcb_buddy_msg( struct im_connection *ic, char *handle, char *msg, u_int32_
g_free( wrapped );
}
-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;
@@ -731,7 +731,7 @@ void imcb_chat_free( struct groupchat *c )
}
}
-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;
char *wrapped;
diff --git a/protocols/nogaim.h b/protocols/nogaim.h
index 0e890464..8ba8fd9e 100644
--- a/protocols/nogaim.h
+++ b/protocols/nogaim.h
@@ -67,7 +67,7 @@
struct im_connection
{
account_t *acc;
- u_int32_t flags;
+ uint32_t flags;
/* each connection then can have its own protocol-specific data */
void *proto_data;
@@ -281,8 +281,8 @@ G_MODULE_EXPORT void imcb_buddy_nick_hint( struct im_connection *ic, char *handl
G_MODULE_EXPORT void imcb_buddy_status( struct im_connection *ic, const char *handle, int flags, const char *state, const char *message );
/* 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 );
/* Groupchats */
@@ -298,7 +298,7 @@ G_MODULE_EXPORT void imcb_chat_add_buddy( struct groupchat *b, char *handle );
/* To remove a handle from a group chat. Reason can be NULL. */
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 );
G_MODULE_EXPORT void imcb_chat_free( struct groupchat *c );
diff --git a/unix.c b/unix.c
index 75ffcf95..0aaf505a 100644
--- a/unix.c
+++ b/unix.c
@@ -196,9 +196,9 @@ static void sighandler( int signal )
while( ( pid = waitpid( 0, &st, WNOHANG ) ) > 0 )
{
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 ) );
}
}
else if( signal != SIGPIPE )