[2730] in BarnOwl Developers
Pile of random cleanup patches
daemon@ATHENA.MIT.EDU (Anders Kaseorg)
Thu Oct 28 23:05:45 2010
Date: Thu, 28 Oct 2010 23:05:41 -0400 (EDT)
From: Anders Kaseorg <andersk@MIT.EDU>
To: barnowl-dev@mit.edu
The following changes since commit 2afae56006f17f45580be5b2a8b88b5231168a64=
:
Don't leak partial history entries when replacing them (2010-10-23 21:17:=
39 -0400)
are available in the git repository at:
git://andersk.mit.edu/barnowl.git cleanup
Anders Kaseorg (12):
Use AM_{CPP,C,LD}FLAGS instead of overriding {CPP,C,LD}FLAGS
Silence some clang warnings for libfaim
Don=E2=80=99t use AX_CFLAGS_STRICT_PROTOTYPES
owl_function_zephyr_buddy_check: Remove unused variable zbl
owl_perlconfig_hashref2message: Remove unused variable count
owl_select_aim_hack: Remove redundant assignment of max_fd
owl_zephyr_loadbarnowldefaultsub: Remove redundant assignment of ret
zcrypt: Make strings const
owl_function_loopwrite_setup: Remove unused callback argument
owl_text_expand_tabs: Make q const
Only add missing Zephyr prototypes for the versions where they=E2=80=
=99re missing
_owl_function_timer_append_fmtext: Cast time_t to int for sprintf("%d=
")
David Benjamin (1):
Avoid stripping parameters for function calls in window.c
Makefile.am | 5 +-
configure.ac | 27 ++++---
functions.c | 6 +-
m4/ax_cflags_strict_prototypes.m4 | 166 ---------------------------------=
----
owl.h | 4 +-
perlconfig.c | 4 +-
select.c | 2 +-
text.c | 4 +-
window.c | 25 +++++-
zcrypt.c | 6 +-
zephyr.c | 1 -
11 files changed, 49 insertions(+), 201 deletions(-)
delete mode 100644 m4/ax_cflags_strict_prototypes.m4
-- 8< --
From=20c6bbe4cf5762530fb78bc71db35de6a559417ff3 Mon Sep 17 00:00:00 2001
From: David Benjamin <davidben@mit.edu>
Date: Sat, 7 Aug 2010 18:07:19 -0700
Subject: [PATCH 01/13] Avoid stripping parameters for function calls in win=
dow.c
Although glib depends on this cast to work, clang tries to inline
owl_window_children_foreach and emits a warning. Unfortunately, we still
depend on this trick to work in general, by depending on glib.
Reported-By: Anders Kaseorg <andersk@mit.edu>
---
window.c | 25 ++++++++++++++++++++-----
1 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/window.c b/window.c
index 03ab211..ae19815 100644
--- a/window.c
+++ b/window.c
@@ -44,6 +44,16 @@ static void _owl_window_unrealize(owl_window *w);
static owl_window *cursor_owner;
static owl_window *default_cursor;
=20
+/* clang gets upset about the glib argument chopping hack because it manag=
es to
+ * inline owl_window_children_foreach. user_data should be a pointer to a
+ * FuncOneArg. */
+typedef void (*FuncOneArg)(void *);
+static void first_arg_only(gpointer data, gpointer user_data)
+{
+ FuncOneArg *func =3D user_data;
+ (*func)(data);
+}
+
G_DEFINE_TYPE (OwlWindow, owl_window, G_TYPE_OBJECT)
=20
static void owl_window_class_init (OwlWindowClass *klass)
@@ -287,7 +297,8 @@ void owl_window_show(owl_window *w)
void owl_window_show_all(owl_window *w)
{
owl_window_show(w);
- owl_window_children_foreach(w, (GFunc)owl_window_show, 0);
+ FuncOneArg ptr =3D (FuncOneArg)owl_window_show;
+ owl_window_children_foreach(w, first_arg_only, &ptr);
}
=20
void owl_window_hide(owl_window *w)
@@ -347,7 +358,8 @@ static void _owl_window_realize(owl_window *w)
/* schedule a repaint */
owl_window_dirty(w);
/* map the children */
- owl_window_children_foreach(w, (GFunc)_owl_window_realize_later, 0);
+ FuncOneArg ptr =3D (FuncOneArg)_owl_window_realize_later;
+ owl_window_children_foreach(w, first_arg_only, &ptr);
}
=20
static void _owl_window_unrealize(owl_window *w)
@@ -355,7 +367,8 @@ static void _owl_window_unrealize(owl_window *w)
if (w->win =3D=3D NULL)
return;
/* unmap all the children */
- owl_window_children_foreach(w, (GFunc)_owl_window_unrealize, 0);
+ FuncOneArg ptr =3D (FuncOneArg)_owl_window_unrealize;
+ owl_window_children_foreach(w, first_arg_only, &ptr);
_owl_window_destroy_curses(w);
w->dirty =3D w->dirty_subtree =3D 0;
/* subwins leave a mess in the parent; dirty it */
@@ -409,7 +422,8 @@ void owl_window_dirty(owl_window *w)
=20
void owl_window_dirty_children(owl_window *w)
{
- owl_window_children_foreach(w, (GFunc)owl_window_dirty, 0);
+ FuncOneArg ptr =3D (FuncOneArg)owl_window_dirty;
+ owl_window_children_foreach(w, first_arg_only, &ptr);
}
=20
static void _owl_window_redraw(owl_window *w)
@@ -433,7 +447,8 @@ static void _owl_window_redraw_subtree(owl_window *w)
if (!w->dirty_subtree)
return;
_owl_window_redraw(w);
- owl_window_children_foreach(w, (GFunc)_owl_window_redraw_subtree, 0);
+ FuncOneArg ptr =3D (FuncOneArg)_owl_window_redraw_subtree;
+ owl_window_children_foreach(w, first_arg_only, &ptr);
w->dirty_subtree =3D 0;
}
=20
--=20
1.7.3.2
From=20da5504c63e7460eddfa862de83519f0b711f86e4 Mon Sep 17 00:00:00 2001
From: Anders Kaseorg <andersk@mit.edu>
Date: Mon, 9 Aug 2010 01:49:07 -0400
Subject: [PATCH 02/13] Use AM_{CPP,C,LD}FLAGS instead of overriding {CPP,C,=
LD}FLAGS
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
Makefile.am | 5 ++---
configure.ac | 22 ++++++++++++----------
2 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index c70ec13..6541bdd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,4 @@
ACLOCAL_AMFLAGS =3D -I m4
-CFLAGS +=3D $(EXTRA_CFLAGS)
=20
GIT_DESCRIPTION :=3D $(if $(wildcard .git),$(shell git describe --match=3D=
'barnowl-*' HEAD 2>/dev/null))
GIT_FLAGS :=3D $(if $(GIT_DESCRIPTION),-DGIT_VERSION=3D$(GIT_DESCRIPTION:b=
arnowl-%=3D%))
@@ -32,7 +31,7 @@ tester_bin_LDADD =3D compat/libcompat.a libfaim/libfaim.a
=20
TESTS=3Druntests.sh
=20
-CPPFLAGS =3D -I$(top_srcdir)/ \
+AM_CPPFLAGS =3D -I$(top_srcdir)/ \
-I$(top_srcdir)/libfaim/ \
-DDATADIR=3D'"$(pkgdatadir)"' \
-DBINDIR=3D'"$(bindir)"' \
@@ -76,7 +75,7 @@ owl_prototypes.h.new: codelist.pl varstubs.c $(CODELIST_S=
RCS)
=20
# For emacs flymake-mode
check-syntax: proto
-=09$(CC) $(CFLAGS) -Wall -Wextra -pedantic -fsyntax-only $(CHK_SOURCES)
+=09$(COMPILE) -Wall -Wextra -pedantic -fsyntax-only $(CHK_SOURCES)
=20
install-data-local:
=09$(mkinstalldirs) ${DESTDIR}${pkgdatadir}/lib
diff --git a/configure.ac b/configure.ac
index fae17ec..6dd5f44 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,7 @@ AC_ARG_WITH([stack-protector],
=20
AS_IF([test "x$with_stack_protector" !=3D xno],
[AX_C_CHECK_FLAG([-fstack-protector],[],[],
- [CFLAGS=3D"$CFLAGS -fstack-protector"],
+ [AM_CFLAGS=3D"$AM_CFLAGS -fstack-protector"],
[if test "x$with_stack_protector" !=3D xcheck; then
AC_MSG_FAILURE([--with-stack-protector selected, but gcc does suppo=
rt it.])
fi
@@ -44,14 +44,14 @@ AS_IF([test "x$with_zephyr" !=3D xno],
AS_IF([krb5-config krb4 --libs >/dev/null 2>&1],
[AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_KERBEROS_IV], [1], [Define if you have kerberos IV]=
)
- CFLAGS=3D"${CFLAGS} `krb5-config krb4 --cflags`"
+ AM_CFLAGS=3D"${AM_CFLAGS} `krb5-config krb4 --cflags`"
LIBS=3D"${LIBS} `krb5-config krb4 --libs`"
],
[AC_MSG_RESULT([no])
AS_IF([test "x$with_krb4" =3D "xyes"],
[AC_MSG_ERROR([Kerberos IV requested but not found])])
PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto])
- CFLAGS=3D"${CFLAGS} ${LIBCRYPTO_CFLAGS}"
+ AM_CFLAGS=3D"${AM_CFLAGS} ${LIBCRYPTO_CFLAGS}"
LIBS=3D"${LIBS} ${LIBCRYPTO_LIBS}"
])])
AC_CHECK_LIB([zephyr], [ZGetSender],
@@ -85,7 +85,7 @@ AC_CHECK_HEADERS(strings.h sys/ioctl.h sys/filio.h unistd=
=2Eh)
dnl Add CFLAGS for embeded perl
PERL_CFLAGS=3D`perl -MExtUtils::Embed -e ccopts`
AC_MSG_NOTICE([Adding perl CFLAGS ${PERL_CFLAGS}])
-CFLAGS=3D"${CFLAGS} ${PERL_CFLAGS}"
+AM_CFLAGS=3D"${AM_CFLAGS} ${PERL_CFLAGS}"
=20
dnl Find the location of perl XSUBPP
AC_MSG_CHECKING(for the perl xsubpp precompiler)
@@ -117,9 +117,9 @@ dnl Add CFLAGS and LDFLAGS for glib-2.0
PKG_CHECK_MODULES(GLIB,[glib-2.0 gobject-2.0])
=20
AC_MSG_NOTICE([Adding glib-2.0 CFLAGS ${GLIB_CFLAGS}])
-CFLAGS=3D"${GLIB_CFLAGS} ${CFLAGS}"
+AM_CFLAGS=3D"${GLIB_CFLAGS} ${AM_CFLAGS}"
AC_MSG_NOTICE([Adding glib-2.0 LDFLAGS ${GLIB_LIBS}])
-LDFLAGS=3D"${GLIB_LIBS} ${LDFLAGS}"
+AM_LDFLAGS=3D"${GLIB_LIBS} ${AM_LDFLAGS}"
=20
if test "x${prefix}" =3D "xNONE"; then
prefix=3D"${ac_default_prefix}"
@@ -127,8 +127,8 @@ fi
=20
dnl Checks for typedefs, structures, and compiler characteristics.
=20
-AX_CFLAGS_WARN_ALL
-AX_CFLAGS_STRICT_PROTOTYPES
+AX_CFLAGS_WARN_ALL([AM_CFLAGS])
+AX_CFLAGS_STRICT_PROTOTYPES([AM_CFLAGS])
=20
AX_C_CHECK_FLAG([-Wno-pointer-sign],[],[],
[LIBFAIM_CFLAGS=3D"$LIBFAIM_CFLAGS -Wno-pointer-sign"])
@@ -137,11 +137,13 @@ AM_CONDITIONAL([ENABLE_ZCRYPT], [test "$HAVE_DES_STRI=
NG_TO_KEY" && dnl
test "$HAVE_DES_KEY_SCHED" && dnl
test "$HAVE_DES_ECB_ENCRYPT"])
=20
-CFLAGS=3D"$CFLAGS -D_XOPEN_SOURCE"
+AM_CFLAGS=3D"$AM_CFLAGS -D_XOPEN_SOURCE"
dnl __EXTENSIONS__ is needed for struct timeval on Solaris when
dnl _XOPEN_SOURCE is defined.
-CFLAGS=3D"$CFLAGS -D__EXTENSIONS__"
+AM_CFLAGS=3D"$AM_CFLAGS -D__EXTENSIONS__"
=20
+AC_SUBST([AM_CFLAGS])
+AC_SUBST([AM_LDFLAGS])
AC_SUBST([LIBFAIM_CFLAGS])
=20
AC_SUBST(XSUBPPDIR)
--=20
1.7.3.2
From=203b2c2a991e80060a5177421a31f2a5cfc75b046c Mon Sep 17 00:00:00 2001
From: Anders Kaseorg <andersk@mit.edu>
Date: Mon, 9 Aug 2010 01:49:36 -0400
Subject: [PATCH 03/13] Silence some clang warnings for libfaim
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
configure.ac | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 6dd5f44..c76fb33 100644
--- a/configure.ac
+++ b/configure.ac
@@ -130,8 +130,9 @@ dnl Checks for typedefs, structures, and compiler chara=
cteristics.
AX_CFLAGS_WARN_ALL([AM_CFLAGS])
AX_CFLAGS_STRICT_PROTOTYPES([AM_CFLAGS])
=20
-AX_C_CHECK_FLAG([-Wno-pointer-sign],[],[],
- [LIBFAIM_CFLAGS=3D"$LIBFAIM_CFLAGS -Wno-pointer-sign"])
+m4_foreach([myflag],
+ [[-Wno-pointer-sign],[-Wno-empty-body],[-Wno-unused-value]],
+ [AX_C_CHECK_FLAG([myflag],[],[],[LIBFAIM_CFLAGS=3D"$LIBFAIM_CFLAGS myfla=
g"])])
=20
AM_CONDITIONAL([ENABLE_ZCRYPT], [test "$HAVE_DES_STRING_TO_KEY" && dnl
test "$HAVE_DES_KEY_SCHED" && dnl
--=20
1.7.3.2
From=20afe35ef43eeb4eb5ab9c828684082c904476b9bc Mon Sep 17 00:00:00 2001
From: Anders Kaseorg <andersk@mit.edu>
Date: Mon, 13 Sep 2010 14:40:42 -0400
Subject: [PATCH 04/13] =3D?UTF-8?q?Don=3DE2=3D80=3D99t=3D20use=3D20AX=3D5FC=
FLAGS=3D5FSTRICT=3D5FPROTOTYPES?=3D
MIME-Version: 1.0
Content-Type: text/plain; charset=3DUTF-8
Content-Transfer-Encoding: 8bit
gcc errors on the obsolete -fstrict-prototypes option, but clang just
warns, so AX_CFLAGS_STRICT_PROTOTYPES decides to use it and we got a
warning with every compilation unit.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
configure.ac | 2 +-
m4/ax_cflags_strict_prototypes.m4 | 166 ---------------------------------=
----
2 files changed, 1 insertions(+), 167 deletions(-)
delete mode 100644 m4/ax_cflags_strict_prototypes.m4
diff --git a/configure.ac b/configure.ac
index c76fb33..12f70d3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -128,7 +128,7 @@ fi
dnl Checks for typedefs, structures, and compiler characteristics.
=20
AX_CFLAGS_WARN_ALL([AM_CFLAGS])
-AX_CFLAGS_STRICT_PROTOTYPES([AM_CFLAGS])
+AX_C_CHECK_FLAG([-Wstrict-prototypes],[],[],[AM_CFLAGS=3D"$AM_CFLAGS -Wstr=
ict-prototypes"])
=20
m4_foreach([myflag],
[[-Wno-pointer-sign],[-Wno-empty-body],[-Wno-unused-value]],
diff --git a/m4/ax_cflags_strict_prototypes.m4 b/m4/ax_cflags_strict_protot=
ypes.m4
deleted file mode 100644
index de89677..0000000
--- a/m4/ax_cflags_strict_prototypes.m4
+++ /dev/null
@@ -1,166 +0,0 @@
-# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
-# http://autoconf-archive.cryp.to/ax_cflags_strict_prototypes.html
-# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
-#
-# SYNOPSIS
-#
-# AX_CFLAGS_STRICT_PROTOTYPES [(shellvar [,default, [A/NA]]
-#
-# DESCRIPTION
-#
-# Try to find a compiler option that requires strict prototypes.
-#
-# The sanity check is done by looking at sys/signal.h which has a set of
-# macro-definitions SIG_DFL and SIG_IGN that are cast to the local
-# signal-handler type. If that signal-handler type is not fully qualifie=
d
-# then the system headers are not seen as strictly prototype clean.
-#
-# For the GNU CC compiler it will be -fstrict-prototypes
-# -Wstrict-prototypes The result is added to the shellvar being CFLAGS b=
y
-# default.
-#
-# DEFAULTS:
-#
-# - $1 shell-variable-to-add-to : CFLAGS
-# - $2 add-value-if-not-found : nothing
-# - $3 action-if-found : add value to shellvariable
-# - $4 action-if-not-found : nothing
-#
-# LICENSE
-#
-# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
-#
-# This program is free software; you can redistribute it and/or modify i=
t
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2 of the License, or (at your
-# option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Gener=
al
-# Public License for more details.
-#
-# You should have received a copy of the GNU General Public License alon=
g
-# with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owne=
r
-# gives unlimited permission to copy, distribute and modify the configur=
e
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-AC_DEFUN([AX_CFLAGS_STRICT_PROTOTYPES],[dnl
-AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
-AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_strict_prototypes])dnl
-AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for strict prototypes],
-VAR,[VAR=3D"no, unknown"
- AC_LANG_SAVE
- AC_LANG_C
- ac_save_[]FLAGS=3D"$[]FLAGS"
-for ac_arg dnl
-in "-pedantic % -fstrict-prototypes -Wstrict-prototypes" dnl GCC
- "-pedantic % -Wstrict-prototypes" dnl try to warn atleast
- "-pedantic % -Wmissing-prototypes" dnl or another warning
- "-pedantic % -Werror-implicit-function-declaration" dnl
- "-pedantic % -Wimplicit-function-declaration" dnl
- #
-do FLAGS=3D"$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'=
`
- AC_TRY_COMPILE([],[return 0;],
- [VAR=3D`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
-done
-case ".$VAR" in
- .|.no|.no,*) ;;
- *) # sanity check with signal() from sys/signal.h
- cp config.log config.tmp
- AC_TRY_COMPILE([#include <signal.h>],[
- if (signal (SIGINT, SIG_IGN) =3D=3D SIG_DFL) return 1;
- if (signal (SIGINT, SIG_IGN) !=3D SIG_DFL) return 2;],
- dnl the original did use test -n `$CC testprogram.c`
- [if test `diff config.log config.tmp | grep -i warning | wc -l` !=3D 0
-then if test `diff config.log config.tmp | grep -i warning | wc -l` !=3D 1
-then VAR=3D"no, suppressed, signal.h," ; fi ; fi],
- [VAR=3D"no, suppressed, signal.h"])
- rm config.tmp
- ;;
-esac
- FLAGS=3D"$ac_save_[]FLAGS"
- AC_LANG_RESTORE
-])
-case ".$VAR" in
- .ok|.ok,*) m4_ifvaln($3,$3) ;;
- .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
- AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)=3D"$m4_ifval($1,$1,FLAGS) $2"]=
)
- m4_ifval($1,$1,FLAGS)=3D"$m4_ifval($1,$1,FLAGS) $2"]=
)]) ;;
- *) m4_ifvaln($3,$3,[
- if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
- then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
- else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)=3D"$m4_ifval($1,$1,FLAGS) $VAR=
"])
- m4_ifval($1,$1,FLAGS)=3D"$m4_ifval($1,$1,FLAGS) $VAR=
"
- fi ]) ;;
-esac
-AS_VAR_POPDEF([VAR])dnl
-AS_VAR_POPDEF([FLAGS])dnl
-])
-
-dnl the only difference - the LANG selection... and the default FLAGS
-
-AC_DEFUN([AX_CXXFLAGS_STRICT_PROTOTYPES],[dnl
-AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
-AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_strict_prototypes])dnl
-AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for strict prototypes],
-VAR,[VAR=3D"no, unknown"
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- ac_save_[]FLAGS=3D"$[]FLAGS"
-for ac_arg dnl
-in "-pedantic -Werror % -fstrict-prototypes -Wstrict-prototypes" dnl GCC
- "-pedantic -Werror % -Wstrict-prototypes" dnl try to warn atleast
- "-pedantic -Werror % -Wmissing-prototypes" dnl try to warn atleast
- "-pedantic -Werror % -Werror-implicit-function-declaration" dnl
- "-pedantic -Werror % -Wimplicit-function-declaration" dnl
- "-pedantic % -Wstrict-prototypes %% no, unsupported in C++" dnl oops
- #
-do FLAGS=3D"$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'=
`
- AC_TRY_COMPILE([],[return 0;],
- [VAR=3D`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
-done
-case ".$VAR" in
- .|.no|.no,*) ;;
- *) # sanity check with signal() from sys/signal.h
- cp config.log config.tmp
- AC_TRY_COMPILE([#include <signal.h>],[
- if (signal (SIGINT, SIG_IGN) =3D=3D SIG_DFL) return 1;
- if (signal (SIGINT, SIG_IGN) !=3D SIG_DFL) return 2;],
- dnl the original did use test -n `$CC testprogram.c`
- [if test `diff config.log config.tmp | grep -i warning | wc -l` !=3D 0
-then if test `diff config.log config.tmp | grep -i warning | wc -l` !=3D 1
-then VAR=3D"no, suppressed, signal.h," ; fi ; fi],
- [VAR=3D"no, suppressed, signal.h"])
- rm config.tmp
- ;;
-esac
- FLAGS=3D"$ac_save_[]FLAGS"
- AC_LANG_RESTORE
-])
-case ".$VAR" in
- .ok|.ok,*) m4_ifvaln($3,$3) ;;
- .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
- AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)=3D"$m4_ifval($1,$1,FLAGS) $2"]=
)
- m4_ifval($1,$1,FLAGS)=3D"$m4_ifval($1,$1,FLAGS) $2"]=
)]) ;;
- *) m4_ifvaln($3,$3,[
- if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
- then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
- else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)=3D"$m4_ifval($1,$1,FLAGS) $VAR=
"])
- m4_ifval($1,$1,FLAGS)=3D"$m4_ifval($1,$1,FLAGS) $VAR=
"
- fi ]) ;;
-esac
-AS_VAR_POPDEF([VAR])dnl
-AS_VAR_POPDEF([FLAGS])dnl
-])
--=20
1.7.3.2
From=208494eed456d3a737381bbf0bb7e19d3f0af5c5e4 Mon Sep 17 00:00:00 2001
From: Anders Kaseorg <andersk@mit.edu>
Date: Wed, 6 Oct 2010 14:25:22 -0400
Subject: [PATCH 05/13] owl_function_zephyr_buddy_check: Remove unused varia=
ble zbl
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
functions.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/functions.c b/functions.c
index 3e5b170..96494a8 100644
--- a/functions.c
+++ b/functions.c
@@ -3419,7 +3419,6 @@ void owl_function_zephyr_buddy_check(int notify)
#ifdef HAVE_LIBZEPHYR
int i, j;
owl_list anyone;
- owl_zbuddylist *zbl;
GList **zaldlist;
GList *zaldptr;
ZAsyncLocateData_t *zald;
@@ -3427,7 +3426,6 @@ void owl_function_zephyr_buddy_check(int notify)
=20
if (!owl_global_is_havezephyr(&g)) return;
owl_global_set_pseudologin_notify(&g, notify);
- zbl =3D owl_global_get_zephyr_buddylist(&g);
zaldlist =3D owl_global_get_zaldlist(&g);
=20
/* Clear the existing ZALDs first. */
--=20
1.7.3.2
From=20eebf16a7874202fdd6f635b84ef561d4f9bd9420 Mon Sep 17 00:00:00 2001
From: Anders Kaseorg <andersk@mit.edu>
Date: Wed, 6 Oct 2010 14:30:21 -0400
Subject: [PATCH 06/13] owl_perlconfig_hashref2message: Remove unused variab=
le count
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
perlconfig.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/perlconfig.c b/perlconfig.c
index 5451bf2..cb2a851 100644
--- a/perlconfig.c
+++ b/perlconfig.c
@@ -185,7 +185,7 @@ owl_message * owl_perlconfig_hashref2message(SV *msg)
{
owl_message * m;
HE * ent;
- I32 count, len;
+ I32 len;
const char *key,*val;
HV * hash;
struct tm tm;
@@ -195,7 +195,7 @@ owl_message * owl_perlconfig_hashref2message(SV *msg)
m =3D owl_malloc(sizeof(owl_message));
owl_message_init(m);
=20
- count =3D hv_iterinit(hash);
+ hv_iterinit(hash);
while((ent =3D hv_iternext(hash))) {
key =3D hv_iterkey(ent, &len);
val =3D SvPV_nolen(hv_iterval(hash, ent));
--=20
1.7.3.2
From=20d9538780d4920183d89ea58740c56e913ff250ed Mon Sep 17 00:00:00 2001
From: Anders Kaseorg <andersk@mit.edu>
Date: Wed, 6 Oct 2010 14:32:27 -0400
Subject: [PATCH 07/13] owl_select_aim_hack: Remove redundant assignment of =
max_fd
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
select.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/select.c b/select.c
index cecc6b0..2a3ff0b 100644
--- a/select.c
+++ b/select.c
@@ -244,7 +244,7 @@ int owl_select_aim_hack(fd_set *rfds, fd_set *wfds)
=20
max_fd =3D 0;
sess =3D owl_global_get_aimsess(&g);
- for (cur =3D sess->connlist, max_fd =3D 0; cur; cur =3D cur->next) {
+ for (cur =3D sess->connlist; cur; cur =3D cur->next) {
if (cur->fd !=3D -1) {
FD_SET(cur->fd, rfds);
if (cur->status & AIM_CONN_STATUS_INPROGRESS) {
--=20
1.7.3.2
From=20e0aac0e85b1a9a33f611144d91b16d39f854130e Mon Sep 17 00:00:00 2001
From: Anders Kaseorg <andersk@mit.edu>
Date: Wed, 6 Oct 2010 14:33:18 -0400
Subject: [PATCH 08/13] owl_zephyr_loadbarnowldefaultsub: Remove redundant a=
ssignment of ret
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
zephyr.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/zephyr.c b/zephyr.c
index 1121caf..cc3487f 100644
--- a/zephyr.c
+++ b/zephyr.c
@@ -333,7 +333,6 @@ int owl_zephyr_loadbarnowldefaultsubs(void)
int count, ret;
=20
subs =3D owl_malloc(sizeof(ZSubscription_t) * subSize);
- ret =3D 0;
ZResetAuthentication();
count=3D0;
=20
--=20
1.7.3.2
From=208efb8eba35f02855e705409e2e651d3161b1feb1 Mon Sep 17 00:00:00 2001
From: Anders Kaseorg <andersk@mit.edu>
Date: Tue, 26 Oct 2010 00:33:17 -0400
Subject: [PATCH 09/13] zcrypt: Make strings const
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
zcrypt.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/zcrypt.c b/zcrypt.c
index f488a69..9a6eceb 100644
--- a/zcrypt.c
+++ b/zcrypt.c
@@ -49,8 +49,8 @@
typedef struct
{
int flags;
- char *signature;
- char *message;
+ const char *signature;
+ const char *message;
} ZWRITEOPTIONS;
=20
char *GetZephyrVarKeyFile(const char *whoami, const char *class, const cha=
r *instance);
@@ -109,7 +109,7 @@ int main(int argc, char *argv[])
int cipher;
int error =3D FALSE;
int zephyr =3D FALSE;
- char *class =3D NULL, *instance =3D NULL;
+ const char *class =3D NULL, *instance =3D NULL;
int mode =3D M_NONE;
=20
char c;
--=20
1.7.3.2
From=20857eb3d39430d74b06b522949b8f58b2438551e2 Mon Sep 17 00:00:00 2001
From: Anders Kaseorg <andersk@mit.edu>
Date: Tue, 26 Oct 2010 00:46:18 -0400
Subject: [PATCH 10/13] owl_function_loopwrite_setup: Remove unused callback=
argument
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
functions.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/functions.c b/functions.c
index 96494a8..d6ff94b 100644
--- a/functions.c
+++ b/functions.c
@@ -364,7 +364,7 @@ void owl_function_loopwrite_setup(void)
owl_function_write_setup("message");
owl_function_start_edit_win("loopwrite",
&owl_callback_loopwrite,
- "loopwrite", NULL);
+ NULL, NULL);
}
=20
void owl_callback_zwrite(owl_editwin *e) {
--=20
1.7.3.2
From=20d7b30ce18c6ec63e31f0d689a757e9030c5eaea9 Mon Sep 17 00:00:00 2001
From: Anders Kaseorg <andersk@mit.edu>
Date: Tue, 26 Oct 2010 01:26:28 -0400
Subject: [PATCH 11/13] owl_text_expand_tabs: Make q const
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
text.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/text.c b/text.c
index 97f858b..0c31a2e 100644
--- a/text.c
+++ b/text.c
@@ -136,7 +136,7 @@ char *owl_text_expand_tabs(const char *in)
col =3D 0;
while(*p) {
gunichar c =3D g_utf8_get_char(p);
- char *q =3D g_utf8_next_char(p);
+ const char *q =3D g_utf8_next_char(p);
switch (c) {
case '\t':
do { len++; col++; } while (col % OWL_TAB_WIDTH);
@@ -161,7 +161,7 @@ char *owl_text_expand_tabs(const char *in)
col =3D 0;
while(*p) {
gunichar c =3D g_utf8_get_char(p);
- char *q =3D g_utf8_next_char(p);
+ const char *q =3D g_utf8_next_char(p);
switch (c) {
case '\t':
do {*(out++) =3D ' '; col++; } while (col % OWL_TAB_WIDTH);
--=20
1.7.3.2
From=20e229316f6ba00bb3e916fd49e70c0f7edc2d5683 Mon Sep 17 00:00:00 2001
From: Anders Kaseorg <andersk@mit.edu>
Date: Tue, 26 Oct 2010 01:58:24 -0400
Subject: [PATCH 12/13] =3D?UTF-8?q?Only=3D20add=3D20missing=3D20Zephyr=3D20=
prototypes=3D20for=3D20the=3D20versions=3D20where=3D20they=3DE2=3D80=3D99re=
=3D20missing?=3D
MIME-Version: 1.0
Content-Type: text/plain; charset=3DUTF-8
Content-Transfer-Encoding: 8bit
zephyr.h stopped defining ZCONST on the same day it added prototypes
for ZGetSubscriptions and ZGetLocations.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
owl.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/owl.h b/owl.h
index 3685a79..881931f 100644
--- a/owl.h
+++ b/owl.h
@@ -655,8 +655,8 @@ extern owl_global g;
=20
#include "owl_prototypes.h"
=20
-/* these are missing from the zephyr includes for some reason */
-#ifdef HAVE_LIBZEPHYR
+/* These were missing from the Zephyr includes before Zephyr 3. */
+#if defined HAVE_LIBZEPHYR && defined ZCONST
int ZGetSubscriptions(ZSubscription_t *, int *);
int ZGetLocations(ZLocations_t *,int *);
#endif
--=20
1.7.3.2
From=205a4069d2d1133697835495dbe20aea079e300942 Mon Sep 17 00:00:00 2001
From: Anders Kaseorg <andersk@mit.edu>
Date: Tue, 26 Oct 2010 02:03:13 -0400
Subject: [PATCH 13/13] _owl_function_timer_append_fmtext: Cast time_t to in=
t for sprintf("%d")
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
functions.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/functions.c b/functions.c
index d6ff94b..8da8762 100644
--- a/functions.c
+++ b/functions.c
@@ -97,7 +97,7 @@ static void _owl_function_timer_append_fmtext(gpointer da=
ta, gpointer user_data)
owl_timer *timer =3D data;
char *str =3D owl_sprintf("- %s: in %d seconds",
timer->name ? timer->name : "(unnamed)",
- timer->time - time(NULL));
+ (int)(timer->time - time(NULL)));
owl_fmtext_append_normal(fm, str);
owl_free(str);
if (timer->interval) {
--=20
1.7.3.2