Project

General

Profile

Cosmetic #254 » 0003-Fix-GCC-warnings.patch

Patch against HEAD - Arnaud Fontaine, 2011-10-04 04:25

View differences:

configure.ac
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
AX_C___ATTRIBUTE__
AH_BOTTOM([
/* Unused attributes such as function parameters (GCC extension) */
#ifdef HAVE___ATTRIBUTE__
# define UNUSED(ATTRIBUTE) ATTRIBUTE __attribute__((unused))
#else
# define UNUSED(ATTRIBUTE) ATTRIBUTE
#endif])
# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_MALLOC
src/bip.c
hash_iterator_t it;
hash_iterator_t lit;
char buf[RET_STR_LEN + 1];
connection_t *c;
c = CONN(ic);
bip_notify(ic, "-- User list");
for (hash_it_init(&_bip->users, &it); hash_it_item(&it);
......
{
hash_iterator_t it;
char buf[RET_STR_LEN + 1];
connection_t *c;
c = CONN(ic);
bip_notify(ic, "-- Network list (* means SSL):");
for (hash_it_init(&_bip->networks, &it); hash_it_item(&it);
......
void adm_list_connections(struct link_client *ic, struct bipuser *bu)
{
hash_iterator_t it;
connection_t *c;
c = CONN(ic);
if (!bu) {
bip_notify(ic, "-- Your connections:");
bu = LINK(ic)->user;
src/config.h.in
/* Define to 1 if `vfork' works. */
#undef HAVE_WORKING_VFORK
/* define if your compiler has __attribute__ */
#undef HAVE___ATTRIBUTE__
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O
......
/* Define as `fork' if `vfork' does not work. */
#undef vfork
/* Unused attributes such as function parameters (GCC extension) */
#ifdef HAVE___ATTRIBUTE__
# define UNUSED(ATTRIBUTE) ATTRIBUTE __attribute__((unused))
#else
# define UNUSED(ATTRIBUTE) ATTRIBUTE
#endif
src/connection.c
}
/* ripped from postfix's tls_dh.c */
static DH *tmp_dh_cb(SSL *ssl_unused, int export, int keylength)
static DH *tmp_dh_cb(UNUSED(SSL *ssl_unused), int export, int keylength)
{
DH *ret;
......
ERR_print_errors(errbio);
if (err2 == SSL_ERROR_NONE) {
SSL_CIPHER *cipher;
const SSL_CIPHER *cipher;
char buf[128];
int len;
src/irc.c
return OK_COPY_WHO;
}
static int irc_315(struct link_server *server, struct line *l)
static int irc_315(struct link_server *server, UNUSED(struct line *l))
{
struct link *link = LINK(server);
if (link->who_client) {
......
link->who_client, link->who_client->who_count);
}
}
l = NULL; /* keep gcc happy */
return OK_COPY_WHO;
}
......
}
/* same as irc_315 */
static int irc_368(struct link_server *server, struct line *l)
static int irc_368(struct link_server *server, UNUSED(struct line *l))
{
struct link *link = LINK(server);
if (link->who_client) {
......
link->who_client, link->who_client->who_count);
}
}
l = NULL; /* keep gcc happy */
return OK_COPY_WHO;
}
src/lex.l
%option nounput noinput
%{
/*
* $Id: lex.l,v 1.23 2005/04/12 19:34:35 nohar Exp $
src/log.c
void log_connected(log_t *logdata)
{
logstore_t *store;
hash_iterator_t hi;
snprintf(logdata->buffer, LOGLINE_MAXLEN, "%s -!- Connected to"
" server...", timestamp());
for (hash_it_init(&logdata->logfgs, &hi); hash_it_item(&hi);
hash_it_next(&hi)) {
store = hash_it_item(&hi);
log_write(logdata, hash_it_key(&hi), logdata->buffer);
}
}
(1-1/2)