Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Dec 2005 16:38:42 +0000
From:      Dieter <freebsd@sopwith.solgatos.com>
To:        scott@mail.dsab.rresearch.com, freebsd-ports@freebsd.org, nmh-workers@nongnu.org
Subject:   Some fixes for nmh-1.2
Message-ID:  <200512250038.AAA23152@sopwith.solgatos.com>

next in thread | raw e-mail | index | archive | help
Here are some fixes for IPL32 vs LP64 portability issues
in nmh-1.2.  They make gcc happy (well, less unhappy, there are
still plenty of warnings to be fixed), but someone should
code review them, *especially* the ones with "code review"
or "code inspect" in the comment.

The diffs also include a couple of quick-and-dirty hacks to get nmh-1.2
to build on FreeBSD 6.0 on AMD64.  I just threw in a #include <ndbm.h>
which might break things on other platforms.  I leave a proper fix
to the autoconf/configure wizards.



Diffs for file: h/msh.h

===================================================================
RCS file: RCS/msh.h,v
retrieving revision 1.1
diff -u -c -r1.1 msh.h
*** msh.h	2005/12/24 02:23:54	1.1
--- msh.h	2005/12/24 02:24:14
***************
*** 55,61 ****
  extern struct msgs *mp;		/* used a lot              */
  extern struct Msg *Msgs;	/* Msgs[0] not used        */
  
! FILE *msh_ready ();
  
  /*
   * COMMAND
--- 55,61 ----
  extern struct msgs *mp;		/* used a lot              */
  extern struct Msg *Msgs;	/* Msgs[0] not used        */
  
! FILE *msh_ready (int, int);
  
  /*
   * COMMAND



Diffs for file: h/prototypes.h

===================================================================
RCS file: RCS/prototypes.h,v
retrieving revision 1.1
diff -u -c -r1.1 prototypes.h
*** prototypes.h	2005/12/24 02:16:25	1.1
--- prototypes.h	2005/12/24 17:32:30
***************
*** 61,67 ****
  char **getans (char *, struct swit *);
  int getanswer (char *);
  char **getarguments (char *, int, char **, int);
! char *get_charset();
  char *getcpy (char *);
  char *getfolder(int);
  int lkclose(int, char*);
--- 61,67 ----
  char **getans (char *, struct swit *);
  int getanswer (char *);
  char **getarguments (char *, int, char **, int);
! char *get_charset(void);
  char *getcpy (char *);
  char *getfolder(int);
  int lkclose(int, char*);
***************
*** 72,78 ****
  char *m_backup (char *);
  int m_convert (struct msgs *, char *);
  char *m_draft (char *, char *, int, int *);
! void m_eomsbr (int (*)());
  int m_getfld (int, unsigned char *, unsigned char *, int, FILE *);
  int m_gmprot (void);
  char *m_maildir (char *);
--- 72,78 ----
  char *m_backup (char *);
  int m_convert (struct msgs *, char *);
  char *m_draft (char *, char *, int, int *);
! void m_eomsbr (int (*)(int));    /* code review */
  int m_getfld (int, unsigned char *, unsigned char *, int, FILE *);
  int m_gmprot (void);
  char *m_maildir (char *);
***************
*** 167,169 ****
--- 167,179 ----
  int what_now (char *, int, int, char *, char *,
  	int, struct msgs *, char *, int, char *);
  
+ /* ----- */
+ int client (char *, char *, char *, int, char *, int);
+ char * formataddr (char *, char *);
+ int WhatNow (int, char **);
+ struct hostent * gethostbystring (char *);
+ int sc_width (void);
+ int sc_length (void);
+ void clear_screen (void);
+ int SOprintf (char *fmt, ...);
+ int sc_hardcopy(void);



Diffs for file: uip/annosbr.c

===================================================================
RCS file: RCS/annosbr.c,v
retrieving revision 1.1
diff -u -c -r1.1 annosbr.c
*** annosbr.c	2005/12/24 03:19:36	1.1
--- annosbr.c	2005/12/24 03:20:16
***************
*** 384,390 ****
  		while (*cp && *cp++ != '\n')
  		    continue;
  		if (cp - sp)
! 		    fprintf (tmp, "%s: %*.*s", comp, cp - sp, cp - sp, sp);
  	    } while (*cp);
  	    if (cp[-1] != '\n' && cp != text)
  		putc ('\n', tmp);
--- 384,390 ----
  		while (*cp && *cp++ != '\n')
  		    continue;
  		if (cp - sp)
! 		    fprintf (tmp, "%s: %*.*s", comp, (int)(cp - sp), (int)(cp - sp), sp);
  	    } while (*cp);
  	    if (cp[-1] != '\n' && cp != text)
  		putc ('\n', tmp);



Diffs for file: uip/dropsbr.c

===================================================================
RCS file: RCS/dropsbr.c,v
retrieving revision 1.1
diff -u -c -r1.1 dropsbr.c
*** dropsbr.c	2005/12/24 06:37:58	1.1
--- dropsbr.c	2005/12/24 06:39:28
***************
*** 387,393 ****
  			    fp = strchr(ep + 1, '\n');
  			tp = dctime(dlocaltimenow());
  			snprintf (buffer, sizeof(buffer), "From %.*s  %s",
! 				fp - ep, ep, tp);
  		    } else if (!strncmp (buffer, "X-Envelope-From:", 16)) {
  			/*
  			 * Change the "X-Envelope-From:" field
--- 387,393 ----
  			    fp = strchr(ep + 1, '\n');
  			tp = dctime(dlocaltimenow());
  			snprintf (buffer, sizeof(buffer), "From %.*s  %s",
! 				(int)(fp - ep), ep, tp);
  		    } else if (!strncmp (buffer, "X-Envelope-From:", 16)) {
  			/*
  			 * Change the "X-Envelope-From:" field
***************
*** 499,508 ****
      if ((dp = strchr(cp = r1bindex (file, '/'), '.')) == NULL)
  	dp = cp + strlen (cp);
      if (cp == file)
! 	snprintf (buffer, sizeof(buffer), ".%.*s%s", dp - cp, cp, ".map");
      else
  	snprintf (buffer, sizeof(buffer), "%.*s.%.*s%s",
! 		cp - file, file, dp - cp, cp, ".map");
  
      return buffer;
  }
--- 499,508 ----
      if ((dp = strchr(cp = r1bindex (file, '/'), '.')) == NULL)
  	dp = cp + strlen (cp);
      if (cp == file)
! 	snprintf (buffer, sizeof(buffer), ".%.*s%s", (int)(dp - cp), cp, ".map");
      else
  	snprintf (buffer, sizeof(buffer), "%.*s.%.*s%s",
! 		(int)(cp - file), file, (int)(dp - cp), cp, ".map");
  
      return buffer;
  }



Diffs for file: uip/ftpsbr.c

===================================================================
RCS file: RCS/ftpsbr.c,v
retrieving revision 1.1
diff -u -c -r1.1 ftpsbr.c
*** ftpsbr.c	2005/12/24 03:29:34	1.1
--- ftpsbr.c	2005/12/24 17:35:00
***************
*** 49,55 ****
  /*
   * prototypes
   */
! struct hostent *gethostbystring ();
  int ftp_get (char *, char *, char *, char *, char *, char *, int, int);
  int ftp_trans (char *, char *, char *, char *, char *, char *, char *, int, int);
  
--- 49,55 ----
  /*
   * prototypes
   */
! /*struct hostent *gethostbystring ();*/  /* now in h/prototypes.h */
  int ftp_get (char *, char *, char *, char *, char *, char *, int, int);
  int ftp_trans (char *, char *, char *, char *, char *, char *, char *, int, int);
  



Diffs for file: uip/mhbuildsbr.c

===================================================================
RCS file: RCS/mhbuildsbr.c,v
retrieving revision 1.1
diff -u -c -r1.1 mhbuildsbr.c
*** mhbuildsbr.c	2005/12/24 03:23:14	1.1
--- mhbuildsbr.c	2005/12/24 17:37:40
***************
*** 4212,4219 ****
  	if (debugsw) {
  	    while (*cp)
  		cp++;
! 	    fprintf (stderr, "invalid MD5 digest (got %d octets)\n",
! 		     cp - bp);
  	}
  
  	return NOTOK;
--- 4212,4219 ----
  	if (debugsw) {
  	    while (*cp)
  		cp++;
! 	    fprintf (stderr, "invalid MD5 digest (got %ld octets)\n",
! 		     (unsigned long)(cp - bp));
  	}
  
  	return NOTOK;



Diffs for file: uip/mhlistsbr.c

===================================================================
RCS file: RCS/mhlistsbr.c,v
retrieving revision 1.1
diff -u -c -r1.1 mhlistsbr.c
*** mhlistsbr.c	2005/12/24 03:24:18	1.1
--- mhlistsbr.c	2005/12/24 03:26:53
***************
*** 261,268 ****
  	fprintf (stderr, "      %s=\"%s\"\n", *ap, *ep);
  
      /* print internal flags for type/subtype */
!     fprintf (stderr, "    type 0x%x subtype 0x%x params 0x%x\n",
! 	     ct->c_type, ct->c_subtype, (unsigned int) ct->c_ctparams);
  
      fprintf (stderr, "    showproc  \"%s\"\n", empty (ct->c_showproc));
      fprintf (stderr, "    termproc  \"%s\"\n", empty (ct->c_termproc));
--- 261,268 ----
  	fprintf (stderr, "      %s=\"%s\"\n", *ap, *ep);
  
      /* print internal flags for type/subtype */
!     fprintf (stderr, "    type 0x%x subtype 0x%x params 0x%lx\n",
! 	     ct->c_type, ct->c_subtype, (unsigned long) ct->c_ctparams);
  
      fprintf (stderr, "    showproc  \"%s\"\n", empty (ct->c_showproc));
      fprintf (stderr, "    termproc  \"%s\"\n", empty (ct->c_termproc));
***************
*** 273,280 ****
  	fprintf (stderr, "  %s:%s", ENCODING_FIELD, ct->c_celine);
  
      /* print internal flags for transfer encoding */
!     fprintf (stderr, "    transfer encoding 0x%x params 0x%x\n",
! 	     ct->c_encoding, (unsigned int) ct->c_cefile);
  
      /* print Content-ID */
      if (ct->c_id)
--- 273,280 ----
  	fprintf (stderr, "  %s:%s", ENCODING_FIELD, ct->c_celine);
  
      /* print internal flags for transfer encoding */
!     fprintf (stderr, "    transfer encoding 0x%x params 0x%lx\n",
! 	     ct->c_encoding, (unsigned long) ct->c_cefile);
  
      /* print Content-ID */
      if (ct->c_id)
***************
*** 284,291 ****
      if (ct->c_descr)
  	fprintf (stderr, "  %s:%s", DESCR_FIELD, ct->c_descr);
  
!     fprintf (stderr, "    read fp 0x%x file \"%s\" begin %ld end %ld\n",
! 	     (unsigned int) ct->c_fp, empty (ct->c_file),
  	     ct->c_begin, ct->c_end);
  
      /* print more information about transfer encoding */
--- 284,291 ----
      if (ct->c_descr)
  	fprintf (stderr, "  %s:%s", DESCR_FIELD, ct->c_descr);
  
!     fprintf (stderr, "    read fp 0x%lx file \"%s\" begin %ld end %ld\n",
! 	     (unsigned long) ct->c_fp, empty (ct->c_file),
  	     ct->c_begin, ct->c_end);
  
      /* print more information about transfer encoding */
***************
*** 423,430 ****
      CE ce;
  
      if ((ce = ct->c_cefile))
! 	fprintf (stderr, "    decoded fp 0x%x file \"%s\"\n",
! 		 (unsigned int) ce->ce_fp, ce->ce_file ? ce->ce_file : "");
  
      return OK;
  }
--- 423,430 ----
      CE ce;
  
      if ((ce = ct->c_cefile))
! 	fprintf (stderr, "    decoded fp 0x%lx file \"%s\"\n",
! 		 (unsigned long) ce->ce_fp, ce->ce_file ? ce->ce_file : "");
  
      return OK;
  }



Diffs for file: uip/mhlsbr.c

===================================================================
RCS file: RCS/mhlsbr.c,v
retrieving revision 1.1
diff -u -c -r1.1 mhlsbr.c
*** mhlsbr.c	2005/12/24 06:40:20	1.1
--- mhlsbr.c	2005/12/24 17:41:07
***************
*** 243,249 ****
      "\n----------------------------------------------------------------------\n\n";
  static char delim4[] = "\n------------------------------\n\n";
  
! static FILE *(*mhl_action) () = (FILE *(*) ()) 0;
  
  
  /*
--- 243,249 ----
      "\n----------------------------------------------------------------------\n\n";
  static char delim4[] = "\n------------------------------\n\n";
  
! static FILE *(*mhl_action) (char *) = (FILE *(*) (char *)) 0;  /* code review */
  
  
  /*
***************
*** 282,288 ****
  static void m_popen (char *);
  
  int mhl (int, char **);
! int mhlsbr (int, char **, FILE *(*)());
  void m_pclose (void);
  
  void clear_screen (void);             /* from termsbr.c */
--- 282,288 ----
  static void m_popen (char *);
  
  int mhl (int, char **);
! int mhlsbr (int, char **, FILE *(*)(char *));  /* code review */
  void m_pclose (void);
  
  void clear_screen (void);             /* from termsbr.c */
***************
*** 290,296 ****
  int sc_width (void);                  /* from termsbr.c */
  int sc_length (void);                 /* from termsbr.c */
  int sc_hardcopy (void);               /* from termsbr.c */
! struct hostent *gethostbystring ();
  
  
  int
--- 290,296 ----
  int sc_width (void);                  /* from termsbr.c */
  int sc_length (void);                 /* from termsbr.c */
  int sc_hardcopy (void);               /* from termsbr.c */
! /*struct hostent *gethostbystring (); */   /* in prototypes.h */
  
  
  int
***************
*** 618,625 ****
  	for (c1 = fmthd; c1; c1 = c1->c_next) {
  	    fprintf (stderr, "c1: name=\"%s\" text=\"%s\" ovtxt=\"%s\"\n",
  		    c1->c_name, c1->c_text, c1->c_ovtxt);
! 	    fprintf (stderr, "\tnfs=0x%x fmt=0x%x\n",
! 		    (unsigned int) c1->c_nfs, (unsigned int) c1->c_fmt);
  	    fprintf (stderr, "\toffset=%d ovoff=%d width=%d cwidth=%d length=%d\n",
  		    c1->c_offset, c1->c_ovoff, c1->c_width,
  		    c1->c_cwidth, c1->c_length);
--- 618,625 ----
  	for (c1 = fmthd; c1; c1 = c1->c_next) {
  	    fprintf (stderr, "c1: name=\"%s\" text=\"%s\" ovtxt=\"%s\"\n",
  		    c1->c_name, c1->c_text, c1->c_ovtxt);
! 	    fprintf (stderr, "\tnfs=0x%lx fmt=0x%lx\n",
! 		    (unsigned long) c1->c_nfs, (unsigned long) c1->c_fmt);
  	    fprintf (stderr, "\toffset=%d ovoff=%d width=%d cwidth=%d length=%d\n",
  		    c1->c_offset, c1->c_ovoff, c1->c_width,
  		    c1->c_cwidth, c1->c_length);
***************
*** 1683,1689 ****
  
  
  int
! mhlsbr (int argc, char **argv, FILE *(*action)())
  {
      SIGNAL_HANDLER istat, pstat, qstat;
      char *cp;
--- 1683,1689 ----
  
  
  int
! mhlsbr (int argc, char **argv, FILE *(*action)(char *))  /* code review */
  {
      SIGNAL_HANDLER istat, pstat, qstat;
      char *cp;



Diffs for file: uip/mhparse.c

===================================================================
RCS file: RCS/mhparse.c,v
retrieving revision 1.1
diff -u -c -r1.1 mhparse.c
*** mhparse.c	2005/12/24 03:46:01	1.1
--- mhparse.c	2005/12/24 17:43:04
***************
*** 2675,2682 ****
  	if (debugsw) {
  	    while (*cp)
  		cp++;
! 	    fprintf (stderr, "invalid MD5 digest (got %d octets)\n",
! 		     cp - bp);
  	}
  
  	return NOTOK;
--- 2675,2682 ----
  	if (debugsw) {
  	    while (*cp)
  		cp++;
! 	    fprintf (stderr, "invalid MD5 digest (got %ld octets)\n",
! 		     (unsigned long)(cp - bp));
  	}
  
  	return NOTOK;



Diffs for file: uip/msgchk.c

===================================================================
RCS file: RCS/msgchk.c,v
retrieving revision 1.1
diff -u -c -r1.1 msgchk.c
*** msgchk.c	2005/12/24 17:22:53	1.1
--- msgchk.c	2005/12/24 17:23:20
***************
*** 307,313 ****
      if (vecp == 0) {
  	char *home;
  
! 	home = (uid = geteuid()) ? home = getenv ("HOME") : NULL;
  	if (home == NULL) {
  	    pw = getpwnam (user);
  	    if (pw == NULL)
--- 307,313 ----
      if (vecp == 0) {
  	char *home;
  
! 	home = (uid = geteuid()) ? getenv ("HOME") : NULL;  /* code review */
  	if (home == NULL) {
  	    pw = getpwnam (user);
  	    if (pw == NULL)



Diffs for file: uip/mshcmds.c

===================================================================
RCS file: RCS/mshcmds.c,v
retrieving revision 1.1
diff -u -c -r1.1 mshcmds.c
*** mshcmds.c	2005/12/24 17:02:00	1.1
--- mshcmds.c	2005/12/24 17:02:17
***************
*** 72,78 ****
  static void copy_digest (int, FILE *);
  
  /* from mhlsbr.c */
! int mhlsbr (int, char **, FILE *(*)());
  
  void
  forkcmd (char **args, char *pgm)
--- 72,78 ----
  static void copy_digest (int, FILE *);
  
  /* from mhlsbr.c */
! int mhlsbr (int, char **, FILE *(*)(char *));  /* code review */
  
  void
  forkcmd (char **args, char *pgm)



Diffs for file: uip/picksbr.c

===================================================================
RCS file: RCS/picksbr.c,v
retrieving revision 1.1
diff -u -c -r1.1 picksbr.c
*** picksbr.c	2005/12/24 03:48:39	1.1
--- picksbr.c	2005/12/24 17:20:04
***************
*** 116,122 ****
  #define	padvise		if (!talked++) advise
  
  struct nexus {
!     int (*n_action)();
  
      union {
  	/* for {OR,AND,NOT}action */
--- 116,122 ----
  #define	padvise		if (!talked++) advise
  
  struct nexus {
!   int (*n_action)(register struct nexus  *, register FILE *, int, long, long);  /* code review */
  
      union {
  	/* for {OR,AND,NOT}action */
***************
*** 165,193 ****
  /*
   * prototypes for date routines
   */
! static struct tws *tws_parse();
! static struct tws *tws_special();
  
  /*
   * static prototypes
   */
! static void PRaction();
! static int gcompile();
! static int advance();
! static int cclass();
! static int tcompile();
! 
! static struct nexus *parse();
! static struct nexus *exp1();
! static struct nexus *exp2();
! static struct nexus *exp3();
! static struct nexus *newnexus();
! 
! static int ORaction();
! static int ANDaction();
! static int NOTaction();
! static int GREPaction();
! static int TWSaction();
  
  
  int
--- 165,193 ----
  /*
   * prototypes for date routines
   */
! static struct tws *tws_parse(char *, int);
! static struct tws *tws_special(char *);
  
  /*
   * static prototypes
   */
! static void PRaction(struct nexus *, int);
! static int gcompile(struct nexus *, char *);
! static int advance(char *, char *);
! static int cclass(char *, int, int);
! static int tcompile(char *, struct tws *, int);
! 
! static struct nexus *parse(void);
! static struct nexus *exp1(void);
! static struct nexus *exp_2(void);  /* avoid conflict with builtin exp2 (math) */
! static struct nexus *exp3(void);
! static struct nexus *newnexus(int (*)(register struct nexus  *, register FILE *, int, long, long));  /* code review */
! 
! static int ORaction(register struct nexus  *, register FILE *, int, long, long);
! static int ANDaction(register struct nexus  *, register FILE *, int, long, long);
! static int NOTaction(register struct nexus  *, register FILE *, int, long, long);
! static int GREPaction(register struct nexus  *, register FILE *, int, long, long);
! static int TWSaction(register struct nexus  *, register FILE *, int, long, long);
  
  
  int
***************
*** 262,268 ****
      register char *cp;
      register struct nexus *n, *o;
  
!     if ((n = exp2 ()) == NULL || (cp = nxtarg ()) == NULL)
  	return n;
  
      if (*cp != '-') {
--- 262,268 ----
      register char *cp;
      register struct nexus *n, *o;
  
!     if ((n = exp_2 ()) == NULL || (cp = nxtarg ()) == NULL)
  	return n;
  
      if (*cp != '-') {
***************
*** 299,305 ****
  
  
  static struct nexus *
! exp2 (void)
  {
      register char *cp;
      register struct nexus *n;
--- 299,305 ----
  
  
  static struct nexus *
! exp_2 (void)
  {
      register char *cp;
      register struct nexus *n;
***************
*** 450,456 ****
  
  
  static struct nexus *
! newnexus (int (*action)())
  {
      register struct nexus *p;
  
--- 450,456 ----
  
  
  static struct nexus *
! newnexus (int (*action)(register struct nexus  *, register FILE *, int, long, long))  /* code review */
  {
      register struct nexus *p;
  
***************
*** 520,526 ****
  		dasctime (&n->n_tws, TW_NULL));
  	return;
      }
!     fprintf (stderr, "UNKNOWN(0x%x)\n", (unsigned int) (*n->n_action));
  }
  
  
--- 520,526 ----
  		dasctime (&n->n_tws, TW_NULL));
  	return;
      }
!     fprintf (stderr, "UNKNOWN(0x%lx)\n", (unsigned long) (*n->n_action));
  }
  
  



Diffs for file: uip/slocal.c

===================================================================
RCS file: RCS/slocal.c,v
retrieving revision 1.1
diff -u -c -r1.1 slocal.c
*** slocal.c	2005/12/23 18:55:11	1.1
--- slocal.c	2005/12/24 17:47:14
***************
*** 64,69 ****
--- 64,73 ----
  #endif
  #endif
  
+ /* Kludge, needed for FreeBSD 6.0 (perhaps others?) */
+ /* Need a autoconf/configure person to do this right. */
+ #include <ndbm.h>
+ 
  #include <utmp.h>
  
  #ifndef HAVE_GETUTENT
***************
*** 1371,1382 ****
  		if (hp) {
  		    /* return path for UUCP style addressing */
  		    ep = strchr(++hp, '\n');
  		    snprintf (buffer, sizeof(buffer), "Return-Path: %.*s!%.*s\n",
! 			ep - hp, hp, cp - fp, fp);
  		} else {
  		    /* return path for standard domain addressing */
  		    snprintf (buffer, sizeof(buffer), "Return-Path: %.*s\n",
! 			cp - fp, fp);
  		}
  
  		/* Add Return-Path header to message */
--- 1375,1391 ----
  		if (hp) {
  		    /* return path for UUCP style addressing */
  		    ep = strchr(++hp, '\n');
+ 		    /* The pointer differences ought to be cast to long rather
+ 		     * than int, but gcc complains.  If the difference doesn't
+ 		     * fit in an int (32 bits on both ILP32 and LP64) we have
+ 		     * an absurdly large Return-Path.
+ 		     */
  		    snprintf (buffer, sizeof(buffer), "Return-Path: %.*s!%.*s\n",
! 			(int)(ep - hp), hp, (int)(cp - fp), fp);
  		} else {
  		    /* return path for standard domain addressing */
  		    snprintf (buffer, sizeof(buffer), "Return-Path: %.*s\n",
! 			(int)(cp - fp), fp);
  		}
  
  		/* Add Return-Path header to message */



Diffs for file: sbr/Makefile.in

===================================================================
RCS file: RCS/Makefile.in,v
retrieving revision 1.1
diff -u -c -r1.1 Makefile.in
*** Makefile.in	2005/12/24 23:35:05	1.1
--- Makefile.in	2005/12/24 23:37:36
***************
*** 101,108 ****
  
  # Note that some lexes (for example flex 2.5.4) require that there
  # be no space between -o and the output filename.
  dtimep.c: dtimep.lex
! 	$(LEX) -o$@ $<
  
  client.o: client.c
  	$(COMPILE2) $<
--- 101,116 ----
  
  # Note that some lexes (for example flex 2.5.4) require that there
  # be no space between -o and the output filename.
+ #
+ # The $< does not work (at least on FreeBSD 6.0)
+ # It expands to nothing, so flex just hangs.
+ # (probably waiting for something to show up on stdin)
+ # Maybe $< only works with .c not .lex ?
+ # Quick & dirty kludge fix: just put in dtimep.lex
+ # (Like someone did with sigmsg.awk above.)
+ #
  dtimep.c: dtimep.lex
! 	$(LEX) -o$@ dtimep.lex
  
  client.o: client.c
  	$(COMPILE2) $<



Diffs for file: sbr/check_charset.c

===================================================================
RCS file: RCS/check_charset.c,v
retrieving revision 1.1
diff -u -c -r1.1 check_charset.c
*** check_charset.c	2005/12/24 02:15:23	1.1
--- check_charset.c	2005/12/24 02:15:39
***************
*** 19,25 ****
   * Get the current character set
   */
  char *
! get_charset ()
  {
      char *charset = getenv ("MM_CHARSET");
  #if defined(HAVE_NL_LANGINFO) && defined(CODESET)
--- 19,25 ----
   * Get the current character set
   */
  char *
! get_charset (void)
  {
      char *charset = getenv ("MM_CHARSET");
  #if defined(HAVE_NL_LANGINFO) && defined(CODESET)



Diffs for file: sbr/fmt_scan.c

===================================================================
RCS file: RCS/fmt_scan.c,v
retrieving revision 1.1
diff -u -c -r1.1 fmt_scan.c
*** fmt_scan.c	2005/12/24 03:04:01	1.1
--- fmt_scan.c	2005/12/24 03:06:26
***************
*** 28,34 ****
  
  #define	NFMTS MAXARGS
  
! extern char *formataddr ();	/* hook for custom address formatting */
  
  #ifdef LBL
  struct msgs *fmt_current_folder; /* current folder (set by main program) */
--- 28,34 ----
  
  #define	NFMTS MAXARGS
  
! extern char *formataddr (char *, char *);	/* hook for custom address formatting */
  
  #ifdef LBL
  struct msgs *fmt_current_folder; /* current folder (set by main program) */
***************
*** 255,261 ****
  	    || !(cp = strchr(mbox += idx + strlen (key), '/')))
  	return 0;
  
!     snprintf (buffer, buffer_len, "%*.*s", cp - mbox, cp - mbox, mbox);
      return 1;
  }
  
--- 255,261 ----
  	    || !(cp = strchr(mbox += idx + strlen (key), '/')))
  	return 0;
  
!     snprintf (buffer, buffer_len, "%*.*s", (int)(cp - mbox), (int)(cp - mbox), mbox);
      return 1;
  }
  



Diffs for file: sbr/lock_file.c

===================================================================
RCS file: RCS/lock_file.c,v
retrieving revision 1.1
diff -u -c -r1.1 lock_file.c
*** lock_file.c	2005/12/24 03:07:39	1.1
--- lock_file.c	2005/12/24 03:09:05
***************
*** 493,499 ****
      bplen += tmplen;
  #else
      if (cp != file) {
! 	snprintf (bp, sizeof(li->curlock), "%.*s", cp - file, file);
  	tmplen = strlen (bp);
  	bp    += tmplen;
  	bplen += tmplen;
--- 493,499 ----
      bplen += tmplen;
  #else
      if (cp != file) {
! 	snprintf (bp, sizeof(li->curlock), "%.*s", (int)(cp - file), file);
  	tmplen = strlen (bp);
  	bp    += tmplen;
  	bplen += tmplen;
***************
*** 525,531 ****
  	    strncpy (li->tmplock, ",LCK.XXXXXX", sizeof(li->tmplock));
  	else
  	    snprintf (li->tmplock, sizeof(li->tmplock), "%.*s,LCK.XXXXXX",
! 		     cp - li->curlock, li->curlock);
      }
  #endif
  }
--- 525,531 ----
  	    strncpy (li->tmplock, ",LCK.XXXXXX", sizeof(li->tmplock));
  	else
  	    snprintf (li->tmplock, sizeof(li->tmplock), "%.*s,LCK.XXXXXX",
! 		     (int)(cp - li->curlock), li->curlock);
      }
  #endif
  }



Diffs for file: sbr/m_backup.c

===================================================================
RCS file: RCS/m_backup.c,v
retrieving revision 1.1
diff -u -c -r1.1 m_backup.c
*** m_backup.c	2005/12/24 03:09:37	1.1
--- m_backup.c	2005/12/24 03:10:13
***************
*** 22,28 ****
  	snprintf(buffer, sizeof(buffer), "%s%s",
  		BACKUP_PREFIX, cp);
      else
! 	snprintf(buffer, sizeof(buffer), "%.*s%s%s", cp - file, file,
  		BACKUP_PREFIX, cp);
  
      unlink(buffer);
--- 22,28 ----
  	snprintf(buffer, sizeof(buffer), "%s%s",
  		BACKUP_PREFIX, cp);
      else
! 	snprintf(buffer, sizeof(buffer), "%.*s%s%s", (int)(cp - file), file,
  		BACKUP_PREFIX, cp);
  
      unlink(buffer);



Diffs for file: sbr/m_getfld.c

===================================================================
RCS file: RCS/m_getfld.c,v
retrieving revision 1.1
diff -u -c -r1.1 m_getfld.c
*** m_getfld.c	2005/12/24 03:10:54	1.1
--- m_getfld.c	2005/12/24 03:37:29
***************
*** 182,188 ****
  static unsigned char *edelim;
  static int edelimlen;
  
! static int (*eom_action)() = NULL;
  
  #ifdef _FSTDIO
  # define _ptr    _p		/* Gag   */
--- 182,188 ----
  static unsigned char *edelim;
  static int edelimlen;
  
! static int (*eom_action)(int) = NULL;    /* code review */
  
  #ifdef _FSTDIO
  # define _ptr    _p		/* Gag   */
***************
*** 595,601 ****
  
  
  void
! m_eomsbr (int (*action)())
  {
      if ((eom_action = action)) {
  	msg_style = MS_MSH;
--- 595,601 ----
  
  
  void
!   m_eomsbr (int (*action)(int))  /* code inspect */
  {
      if ((eom_action = action)) {
  	msg_style = MS_MSH;
***************
*** 699,708 ****
      if (cp) {
  	/* return path for UUCP style addressing */
  	dp = strchr (++cp, '\n');
! 	snprintf (rp, rplen, "%.*s!%.*s\n", dp - cp, cp, bp - ap, ap);
      } else {
  	/* return path for standard domain addressing */
! 	snprintf (rp, rplen, "%.*s\n", bp - ap, ap);
      }
  
      /*
--- 699,708 ----
      if (cp) {
  	/* return path for UUCP style addressing */
  	dp = strchr (++cp, '\n');
! 	snprintf (rp, rplen, "%.*s!%.*s\n", (int)(dp - cp), cp, (int)(bp - ap), ap);
      } else {
  	/* return path for standard domain addressing */
! 	snprintf (rp, rplen, "%.*s\n", (int)(bp - ap), ap);
      }
  
      /*



Diffs for file: sbr/m_scratch.c

===================================================================
RCS file: RCS/m_scratch.c,v
retrieving revision 1.1
diff -u -c -r1.1 m_scratch.c
*** m_scratch.c	2005/12/24 03:15:24	1.1
--- m_scratch.c	2005/12/24 03:15:52
***************
*** 33,39 ****
      if ((cp = r1bindex (file, '/')) == file)
  	strncpy (buffer, tmpfil, sizeof(buffer));
      else
! 	snprintf (buffer, sizeof(buffer), "%.*s%s", cp - file, file, tmpfil);
      unlink (buffer);
  
      return buffer;
--- 33,39 ----
      if ((cp = r1bindex (file, '/')) == file)
  	strncpy (buffer, tmpfil, sizeof(buffer));
      else
! 	snprintf (buffer, sizeof(buffer), "%.*s%s", (int)(cp - file), file, tmpfil);
      unlink (buffer);
  
      return buffer;



Diffs for file: sbr/mf.c

===================================================================
RCS file: RCS/mf.c,v
retrieving revision 1.1
diff -u -c -r1.1 mf.c
*** mf.c	2005/12/24 03:18:49	1.1
--- mf.c	2005/12/24 03:19:13
***************
*** 433,439 ****
      while (isspace (*ap))
  	ap++;
      if (cp)
! 	sprintf (adr, "%.*s", cp - ap, ap);
      else
  	strcpy (adr, ap);
      bp = adr + strlen (adr) - 1;
--- 433,439 ----
      while (isspace (*ap))
  	ap++;
      if (cp)
! 	sprintf (adr, "%.*s", (int)(cp - ap), ap);
      else
  	strcpy (adr, ap);
      bp = adr + strlen (adr) - 1;



Diffs for file: sbr/norm_charmap.c

===================================================================
RCS file: RCS/norm_charmap.c,v
retrieving revision 1.1
diff -u -c -r1.1 norm_charmap.c
*** norm_charmap.c	2005/12/24 03:39:23	1.1
--- norm_charmap.c	2005/12/24 17:53:50
***************
*** 25,30 ****
--- 25,31 ----
   */
  
  #include <string.h>
+ #include "h/mh.h"    /* for prototypes in h/prototypes.h */
  
  #define digit(x) ((x) >= '0' && (x) <= '9')
  



Diffs for file: sbr/path.c

===================================================================
RCS file: RCS/path.c,v
retrieving revision 1.1
diff -u -c -r1.1 path.c
*** path.c	2005/12/24 03:17:25	1.1
--- path.c	2005/12/24 03:18:04
***************
*** 85,91 ****
  	name += NCWD;
  
      if (strcmp (name, DOTDOT) == 0 || strcmp (name, PWD) == 0) {
! 	snprintf (buffer, sizeof(buffer), "%.*s", cp - pwds, pwds);
  	return getcpy (buffer);
      }
  
--- 85,91 ----
  	name += NCWD;
  
      if (strcmp (name, DOTDOT) == 0 || strcmp (name, PWD) == 0) {
! 	snprintf (buffer, sizeof(buffer), "%.*s", (int)(cp - pwds), pwds);
  	return getcpy (buffer);
      }
  
***************
*** 94,100 ****
      else
  	cp = ep;
  
!     snprintf (buffer, sizeof(buffer), "%.*s/%s", cp - pwds, pwds, name);
      return getcpy (buffer);
  }
  
--- 94,100 ----
      else
  	cp = ep;
  
!     snprintf (buffer, sizeof(buffer), "%.*s/%s", (int)(cp - pwds), pwds, name);
      return getcpy (buffer);
  }
  



Diffs for file: /rw/src/nmh-1.2/configure.in

===================================================================
RCS file: RCS/configure.in,v
retrieving revision 1.1
diff -u -c -r1.1 configure.in
*** configure.in	2005/12/24 18:10:48	1.1
--- configure.in	2005/12/24 23:46:19
***************
*** 223,232 ****
  dnl   if compiler is gcc, then
  dnl     use -O2 and some warning flags
  dnl   else use -O
  if test -n "$auto_cflags"; then
    if test x"$enable_debug" = x"yes"; then
      if test -n "$GCC"; then
!       test -z "$CFLAGS" && CFLAGS="-Wall -g" || CFLAGS="$CFLAGS -Wall -g"
      else
        test -z "$CFLAGS" && CFLAGS=-g || CFLAGS="$CFLAGS -g"
      fi
--- 223,236 ----
  dnl   if compiler is gcc, then
  dnl     use -O2 and some warning flags
  dnl   else use -O
+ dnl
+ dnl -Wall is not sufficient for portability between ILP32 and LP64
+ GCC_WARNINGS="-Wall -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith"
+ 
  if test -n "$auto_cflags"; then
    if test x"$enable_debug" = x"yes"; then
      if test -n "$GCC"; then
!       test -z "$CFLAGS" && CFLAGS="$GCC_WARNINGS -g" || CFLAGS="$CFLAGS $GCC_WARNINGS -g"
      else
        test -z "$CFLAGS" && CFLAGS=-g || CFLAGS="$CFLAGS -g"
      fi
***************
*** 242,248 ****
        esac
      fi
      if test -n "$GCC"; then
!       test -z "$CFLAGS" && CFLAGS="-Wall -O2" || CFLAGS="$CFLAGS -Wall -O2"
      else
        test -z "$CFLAGS" && CFLAGS=-O  || CFLAGS="$CFLAGS -O"
      fi
--- 246,252 ----
        esac
      fi
      if test -n "$GCC"; then
!       test -z "$CFLAGS" && CFLAGS="$GCC_WARNINGS -O2" || CFLAGS="$CFLAGS $GCC_WARNINGS -O2"
      else
        test -z "$CFLAGS" && CFLAGS=-O  || CFLAGS="$CFLAGS -O"
      fi






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200512250038.AAA23152>