+1998-11-05 Nathan Bryant <bryant@cs.usm.maine.edu>
+ * configure.in: different GCC warning flags for OSF/1; remove
+ AM_PATH_GLIB to hopefully fix build problems; check for snprintf
+ * libcli_cit/Makefile.am: link in snprintf.c where needed
+ * gtk/gcit.c, libcli_cit/citadel_api.c, libcli_cit/citadel_util.c,
+ libcli_cit/client_api.c, libcli_cit/tcp_trans.c:
+ portability/warning/ANSI compliance fixes
+
1998-11-04 Nathan Bryant <bryant@cs.usm.maine.edu>
* bootstrap, gtk/Makefile.am: fix 'make dist'
dnl Checks for programs.
AM_PROG_LIBTOOL
-test "$GCC" = yes && XTRA_CFLAGS='-Wall -Wstrict-prototypes'
+if test "$GCC" = yes; then
+ case "$host" in
+ alpha*-dec-osf*)
+ XTRA_CFLAGS='-Wall -Wstrict-prototypes -Wno-implicit-int'
+ ;;
+ *)
+ XTRA_CFLAGS='-Wall -Wstrict-prototypes'
+ ;;
+ esac
+fi
AC_SUBST(XTRA_CFLAGS)
dnl Checks for libraries.
AM_PATH_GDK_IMLIB
-AM_PATH_GLIB
AM_PATH_GTK
dnl Checks for header files.
dnl Checks for library functions.
dnl AC_FUNC_VPRINTF
dnl AC_CHECK_FUNCS(socket strdup strtol uname)
+AC_REPLACE_FUNCS(snprintf)
AM_CONFIG_HEADER(config.h)
+LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.o/.lo/g'`
+AC_SUBST(LTLIBOBJS)
AC_OUTPUT(libcli_cit/Makefile gtk/Makefile Makefile)
#include "gui.h"
#include "gtk_misc.h"
+#ifndef HAVE_SNPRINTF
+int snprintf (char *buf, size_t max, const char *fmt, ...);
+#endif
+
client_context our_context;
extern GtkWidget *page_user, *page_msg, *user_e, *pass_e, *host_e;
extern GtkWidget *user_info_window;
path[sizeof(path)-1] = '\0';
gtk_rc_parse(path);
- bzero(&our_context, sizeof(our_context));
+ memset(&our_context, 0, sizeof(our_context));
create_main_window();
libcli_cit_la_SOURCES = tcp_trans.c citadel_util.c citadel_api.c client_api.c \
citadel_api.h transport.h
+libcli_cit_la_LIBADD = @LTLIBOBJS@
+
pkginclude_HEADERS = citadel_util.h client_api.h
*/
+#include "config.h"
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <sys/types.h>
#include "client_api.h"
#include "transport.h"
#include "citadel_util.h"
#include "citadel_api.h"
+#ifndef HAVE_SNPRINTF
+int snprintf (char *buf, size_t max, const char *fmt, ...);
+#endif
+
int failnum(int i)
{
if (i == OK)
#include "transport.h"
#include "citadel_util.h"
+#ifndef HAVE_SNPRINTF
+int snprintf (char *buf, size_t max, const char *fmt, ...);
+#endif
+
int get_num_args(char *line)
{
int nargs;
exit(1);
}
- bzero(parms, sizeof(citadel_parms));
+ memset(parms, 0, sizeof(citadel_parms));
parms->argc = 0;
return(parms);
*/
+#include "config.h"
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <sys/types.h>
#include "client_api.h"
#include "citadel_util.h"
#include "citadel_api.h"
#include "transport.h"
+#ifndef HAVE_SNPRINTF
+int snprintf (char *buf, size_t max, const char *fmt, ...);
+#endif
+
/*
get_form takes a formname, and returns the citadel form (MESG) in list
return vfprintf(sink, fmt, argp);
}
-int
-snprintf (char *buf, size_t max, const char *fmt, ...)
-{
- va_list argp;
- int bytes;
-
- va_start(argp, fmt);
- bytes = vsnprintf(buf, max, fmt, argp);
- va_end(argp);
-
- return bytes;
-}
-
int
vsnprintf (char *buf, size_t max, const char *fmt, va_list argp)
{
free(p);
return size;
}
+
+int
+snprintf (char *buf, size_t max, const char *fmt, ...)
+{
+ va_list argp;
+ int bytes;
+
+ va_start(argp, fmt);
+ bytes = vsnprintf(buf, max, fmt, argp);
+ va_end(argp);
+
+ return bytes;
+}
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#include <string.h>
#include "client_api.h"
#include "transport.h"
sin.sin_port = htons(port);
memcpy(&sin.sin_addr, he->h_addr, he->h_length);
- ret = connect(sock, &sin, sizeof(sin));
+ ret = connect(sock, (struct sockaddr*)&sin, sizeof(sin));
if (ret < 0)
{