* configure.in: different GCC warning flags for OSF/1; remove
authorNathan Bryant <loanshark@uncensored.citadel.org>
Thu, 5 Nov 1998 07:58:01 +0000 (07:58 +0000)
committerNathan Bryant <loanshark@uncensored.citadel.org>
Thu, 5 Nov 1998 07:58:01 +0000 (07:58 +0000)
          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

gcit/ChangeLog
gcit/configure.in
gcit/gtk/gcit.c
gcit/libcli_cit/Makefile.am
gcit/libcli_cit/citadel_api.c
gcit/libcli_cit/citadel_util.c
gcit/libcli_cit/client_api.c
gcit/libcli_cit/snprintf.c
gcit/libcli_cit/tcp_trans.c

index 7eafca7341ae1fbcff2d084bf939c79025a86d57..2768743de5eae89242c12eecab953d108dffc3a7 100644 (file)
@@ -1,3 +1,11 @@
+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'
 
index 00f3e05b11a0009291be342b6eaf628b829b59c1..552d8e01488d7f20ee7acace2bb30d069a986488 100644 (file)
@@ -4,12 +4,20 @@ AM_INIT_AUTOMAKE(gcit, 0.1)
 
 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.
@@ -21,6 +29,9 @@ dnl Checks for typedefs, structures, and compiler characteristics.
 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)
index 6eaf4cf1b1747be1344f0d6a79fd541a7ef3a712..9f4e6b2d85912d46ef8318f3625453b6d8d442dc 100644 (file)
@@ -29,6 +29,10 @@ btx@calyx.net
 #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;
@@ -506,7 +510,7 @@ int main(int argc, char **argv)
    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();
    
index a82d57ef51c9f05fc577cd34d754c8c5dd99862c..265c5f2a8192fdc412fa1112195667bebbd53bf7 100644 (file)
@@ -5,4 +5,6 @@ lib_LTLIBRARIES = libcli_cit.la
 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
index 8d066b95e455b036a601375560fd03c669b2632b..717f5d48711412e92e5604eba17e4f5a3f07542b 100644 (file)
@@ -9,14 +9,20 @@ the Citadel/UX source code.
 
 */
 
+#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)
index a5f09df1b90b9447265231d4753ede46bd83871a..270d3afe8aeacdcb764b4bc6fc2436a97a6ef9b9 100644 (file)
@@ -22,6 +22,10 @@ These routines deal with the two citadel structures, parms and lists.
 #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;
@@ -153,7 +157,7 @@ citadel_parms *newparms(void)
       exit(1);
    }
    
-   bzero(parms, sizeof(citadel_parms));
+   memset(parms, 0, sizeof(citadel_parms));
    parms->argc = 0;
    
    return(parms);
index 6bd589b34b254db5d9b4c9881c9ebd916f1e0b41..98a0154c10153c2dc151fc2af6b9269066f3d64b 100644 (file)
@@ -6,14 +6,20 @@ btx@calyx.net
 
 */
 
+#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
index d4c39ba2fc93eb7e09c7f001cd563e2a02050a1a..89d650d7d8331f1f9a9a62b519c43f532d2e5fc3 100644 (file)
@@ -48,19 +48,6 @@ needed (const char *fmt, va_list argp)
   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)
 {
@@ -81,3 +68,16 @@ 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;
+}
index 87762cc4dc1d21b2fd90f5850047ff4d2b0451c7..d964b2470f7be64cf183f62dfa90d7165aec4cea 100644 (file)
@@ -15,6 +15,7 @@ btx@calyx.net
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
+#include <string.h>
 #include "client_api.h"
 #include "transport.h"
 
@@ -37,7 +38,7 @@ int citadel_connect(char *host, u_short port)
    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)
    {