mirror of
https://github.com/irssi/irssi.git
synced 2024-09-01 04:14:16 -04:00
Make configure checks able to build with -Werror
Also fix a few compiler warnings, this combined with pull #82 allows me to build with CFLAGS="-Werror -Wall".
This commit is contained in:
parent
1bf4753914
commit
beec29c305
@ -221,7 +221,7 @@ AC_CACHE_VAL(irssi_cv_type_socklen_t,
|
||||
[AC_TRY_COMPILE([
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>],
|
||||
[socklen_t t;],
|
||||
[socklen_t t = 0; return((int)t); ],
|
||||
irssi_cv_type_socklen_t=yes,
|
||||
irssi_cv_type_socklen_t=no,
|
||||
)])
|
||||
@ -455,8 +455,10 @@ if test "$want_perl" != "no"; then
|
||||
esac
|
||||
|
||||
dnl * check that perl's ldflags actually work
|
||||
echo "main(){perl_alloc(); return 0;}" > conftest.c
|
||||
$CC $CFLAGS conftest.c -o conftest $LDFLAGS $PERL_LDFLAGS 2> perl.error.tmp > /dev/null
|
||||
echo "#include <EXTERN.h>" > conftest.c
|
||||
echo "#include <perl.h>" >> conftest.c
|
||||
echo "int main(){perl_alloc(); return 0;}" >> conftest.c
|
||||
$CC $CFLAGS $PERL_CFLAGS conftest.c -o conftest $LDFLAGS $PERL_LDFLAGS 2> perl.error.tmp > /dev/null
|
||||
if test ! -s conftest -a "x$ignore_perl_errors" = "x"; then
|
||||
perl_check_error="Error linking with perl libraries: $PERL_LDFLAGS: `cat perl.error.tmp`"
|
||||
AC_MSG_RESULT([error linking with perl libraries, building without Perl])
|
||||
|
@ -60,7 +60,7 @@ GIOChannel *g_io_channel_new(int handle)
|
||||
|
||||
IPADDR ip4_any = {
|
||||
AF_INET,
|
||||
{ { { INADDR_ANY } } }
|
||||
{ INADDR_ANY }
|
||||
};
|
||||
|
||||
int net_ip_compare(IPADDR *ip1, IPADDR *ip2)
|
||||
|
@ -452,7 +452,7 @@ void gui_entry_insert_text(GUI_ENTRY_REC *entry, const char *str)
|
||||
g_utf8_validate(str, -1, &ptr);
|
||||
len = g_utf8_pointer_to_offset(str, ptr);
|
||||
} else if (term_type == TERM_TYPE_BIG5)
|
||||
len = strlen_big5(str);
|
||||
len = strlen_big5((const unsigned char *)str);
|
||||
else
|
||||
len = strlen(str);
|
||||
entry_text_grow(entry, len);
|
||||
|
@ -140,7 +140,7 @@ int term_init(void)
|
||||
|
||||
term_set_input_type(TERM_TYPE_8BIT);
|
||||
term_common_init();
|
||||
g_atexit(term_deinit);
|
||||
atexit(term_deinit);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -568,7 +568,7 @@ void term_stop(void)
|
||||
|
||||
static int input_utf8(const unsigned char *buffer, int size, unichar *result)
|
||||
{
|
||||
unichar c = g_utf8_get_char_validated(buffer, size);
|
||||
unichar c = g_utf8_get_char_validated((char *)buffer, size);
|
||||
|
||||
switch (c) {
|
||||
case (unichar)-1:
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include "module.h"
|
||||
#include "textbuffer-view.h"
|
||||
#include "signals.h"
|
||||
#include "utf8.h"
|
||||
|
||||
typedef struct {
|
||||
@ -178,14 +179,14 @@ static void unformat_24bit_line_color(const unsigned char **ptr, int off, int *f
|
||||
|
||||
static inline unichar read_unichar(const unsigned char *data, const unsigned char **next, int *width)
|
||||
{
|
||||
unichar chr = g_utf8_get_char_validated(data, -1);
|
||||
unichar chr = g_utf8_get_char_validated((const char *) data, -1);
|
||||
|
||||
if (chr & 0x80000000) {
|
||||
chr = 0xfffd;
|
||||
*next = data + 1;
|
||||
*width = 1;
|
||||
} else {
|
||||
*next = g_utf8_next_char(data);
|
||||
*next = (unsigned char *)g_utf8_next_char(data);
|
||||
*width = unichar_isprint(chr) ? mk_wcwidth(chr) : 1;
|
||||
}
|
||||
return chr;
|
||||
|
@ -50,7 +50,6 @@ static void perl_statusbar_event(char *function, SBAR_ITEM_REC *item,
|
||||
int get_size_only)
|
||||
{
|
||||
dSP;
|
||||
int retcount;
|
||||
SV *item_sv, **sv;
|
||||
HV *hv;
|
||||
|
||||
@ -63,7 +62,7 @@ static void perl_statusbar_event(char *function, SBAR_ITEM_REC *item,
|
||||
XPUSHs(sv_2mortal(newSViv(get_size_only)));
|
||||
PUTBACK;
|
||||
|
||||
retcount = perl_call_pv(function, G_EVAL|G_DISCARD);
|
||||
perl_call_pv(function, G_EVAL|G_DISCARD);
|
||||
SPAGAIN;
|
||||
|
||||
if (SvTRUE(ERRSV)) {
|
||||
|
Loading…
Reference in New Issue
Block a user