[BACK]Return to main.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/main.c between version 1.103 and 1.106

version 1.103, 2010/08/20 01:02:07 version 1.106, 2010/09/26 20:22:28
Line 139  static const char * const mandocerrs[MANDOCERR_MAX] = 
Line 139  static const char * const mandocerrs[MANDOCERR_MAX] = 
         "section not in conventional manual section",          "section not in conventional manual section",
         "end of line whitespace",          "end of line whitespace",
         "blocks badly nested",          "blocks badly nested",
         "scope open on exit",  
   
         "generic error",          "generic error",
   
Line 165  static const char * const mandocerrs[MANDOCERR_MAX] = 
Line 164  static const char * const mandocerrs[MANDOCERR_MAX] = 
         "argument count wrong",          "argument count wrong",
         "request scope close w/none open",          "request scope close w/none open",
         "scope already open",          "scope already open",
           "scope open on exit",
         "macro requires line argument(s)",          "macro requires line argument(s)",
         "macro requires body argument(s)",          "macro requires body argument(s)",
         "macro requires argument(s)",          "macro requires argument(s)",
Line 182  static const char * const mandocerrs[MANDOCERR_MAX] = 
Line 182  static const char * const mandocerrs[MANDOCERR_MAX] = 
         "unsupported display type",          "unsupported display type",
         "blocks badly nested",          "blocks badly nested",
         "no such block is open",          "no such block is open",
         "scope broken, syntax violated",  
         "line scope broken, syntax violated",          "line scope broken, syntax violated",
         "argument count wrong, violates syntax",          "argument count wrong, violates syntax",
         "child violates parent syntax",          "child violates parent syntax",
Line 231  main(int argc, char *argv[])
Line 230  main(int argc, char *argv[])
                 switch (c) {                  switch (c) {
                 case ('m'):                  case ('m'):
                         if ( ! moptions(&curp.inttype, optarg))                          if ( ! moptions(&curp.inttype, optarg))
                                 return(MANDOCLEVEL_BADARG);                                  return((int)MANDOCLEVEL_BADARG);
                         break;                          break;
                 case ('O'):                  case ('O'):
                         (void)strlcat(curp.outopts, optarg, BUFSIZ);                          (void)strlcat(curp.outopts, optarg, BUFSIZ);
Line 239  main(int argc, char *argv[])
Line 238  main(int argc, char *argv[])
                         break;                          break;
                 case ('T'):                  case ('T'):
                         if ( ! toptions(&curp, optarg))                          if ( ! toptions(&curp, optarg))
                                 return(MANDOCLEVEL_BADARG);                                  return((int)MANDOCLEVEL_BADARG);
                         break;                          break;
                 case ('W'):                  case ('W'):
                         if ( ! woptions(&curp, optarg))                          if ( ! woptions(&curp, optarg))
                                 return(MANDOCLEVEL_BADARG);                                  return((int)MANDOCLEVEL_BADARG);
                         break;                          break;
                 case ('V'):                  case ('V'):
                         version();                          version();
Line 279  main(int argc, char *argv[])
Line 278  main(int argc, char *argv[])
         if (curp.roff)          if (curp.roff)
                 roff_free(curp.roff);                  roff_free(curp.roff);
   
         return(exit_status);          return((int)exit_status);
 }  }
   
   
Line 288  version(void)
Line 287  version(void)
 {  {
   
         (void)printf("%s %s\n", progname, VERSION);          (void)printf("%s %s\n", progname, VERSION);
         exit(MANDOCLEVEL_OK);          exit((int)MANDOCLEVEL_OK);
 }  }
   
   
Line 299  usage(void)
Line 298  usage(void)
         (void)fprintf(stderr, "usage: %s [-V] [-foption] "          (void)fprintf(stderr, "usage: %s [-V] [-foption] "
                         "[-mformat] [-Ooption] [-Toutput] "                          "[-mformat] [-Ooption] [-Toutput] "
                         "[-Werr] [file...]\n", progname);                          "[-Werr] [file...]\n", progname);
         exit(MANDOCLEVEL_BADARG);          exit((int)MANDOCLEVEL_BADARG);
 }  }
   
   
Line 329  resize_buf(struct buf *buf, size_t initial)
Line 328  resize_buf(struct buf *buf, size_t initial)
         buf->buf = realloc(buf->buf, buf->sz);          buf->buf = realloc(buf->buf, buf->sz);
         if (NULL == buf->buf) {          if (NULL == buf->buf) {
                 perror(NULL);                  perror(NULL);
                 exit(MANDOCLEVEL_SYSERR);                  exit((int)MANDOCLEVEL_SYSERR);
         }          }
 }  }
   
Line 551  fdesc(struct curparse *curp)
Line 550  fdesc(struct curparse *curp)
                 }                  }
         }          }
   
         /*  
          * With -Wstop and warnings or errors of at least  
          * the requested level, do not produce output.  
          */  
   
         if (MANDOCLEVEL_OK != exit_status && curp->wstop)  
                 goto cleanup;  
   
         /* NOTE a parser may not have been assigned, yet. */          /* NOTE a parser may not have been assigned, yet. */
   
         if ( ! (man || mdoc)) {          if ( ! (man || mdoc)) {
Line 582  fdesc(struct curparse *curp)
Line 573  fdesc(struct curparse *curp)
                 goto cleanup;                  goto cleanup;
         }          }
   
           /*
            * With -Wstop and warnings or errors of at least
            * the requested level, do not produce output.
            */
   
           if (MANDOCLEVEL_OK != exit_status && curp->wstop)
                   goto cleanup;
   
         /* If unset, allocate output dev now (if applicable). */          /* If unset, allocate output dev now (if applicable). */
   
         if ( ! (curp->outman && curp->outmdoc)) {          if ( ! (curp->outman && curp->outmdoc)) {
Line 809  mmsg(enum mandocerr t, void *arg, int ln, int col, con
Line 808  mmsg(enum mandocerr t, void *arg, int ln, int col, con
   
         level = MANDOCLEVEL_FATAL;          level = MANDOCLEVEL_FATAL;
         while (t < mandoclimits[level])          while (t < mandoclimits[level])
                   /* LINTED */
                 level--;                  level--;
   
         cp = (struct curparse *)arg;          cp = (struct curparse *)arg;

Legend:
Removed from v.1.103  
changed lines
  Added in v.1.106

CVSweb