Print this page
10075 make usr/src/tools smatch clean

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/ctf/cvt/st_parse.c
          +++ new/usr/src/tools/ctf/cvt/st_parse.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   */
  24   24  
  25   25  /*
       26 + * Copyright (c) 2018, Joyent, Inc.
       27 + */
       28 +
       29 +/*
  26   30   * This file is a sewer.
  27   31   */
  28   32  
  29   33  #include <limits.h>
  30   34  #include <stdarg.h>
  31   35  #include <stdio.h>
  32   36  #include <assert.h>
  33   37  #include <strings.h>
  34   38  #include <setjmp.h>
  35   39  #include <ctype.h>
↓ open down ↓ 586 lines elided ↑ open up ↑
 622  626                                      "redefine type (%d,%d)\n", TYPEFILE(h2),
 623  627                                      TYPENUM(h2));
 624  628                          }
 625  629                  }
 626  630  
 627  631                  if (ntdp == NULL) {  /* if that type isn't defined yet */
 628  632                          if (*cp != '=') {
 629  633                                  /* record it as unresolved */
 630  634                                  parse_debug(3, NULL, "tdefdecl unres type %d",
 631  635                                      h2);
 632      -                                *rtdp = calloc(sizeof (**rtdp), 1);
      636 +                                *rtdp = calloc(1, sizeof (**rtdp));
 633  637                                  (*rtdp)->t_type = TYPEDEF_UNRES;
 634  638                                  (*rtdp)->t_id = h2;
 635  639                                  break;
 636  640                          } else
 637  641                                  cp++;
 638  642  
 639  643                          /* define a new type */
 640  644                          cp = tdefdecl(cp, h2, rtdp);
 641  645                          if ((*rtdp)->t_id && (*rtdp)->t_id != h2) {
 642      -                                ntdp = calloc(sizeof (*ntdp), 1);
      646 +                                ntdp = calloc(1, sizeof (*ntdp));
 643  647                                  ntdp->t_type = TYPEDEF;
 644  648                                  ntdp->t_tdesc = *rtdp;
 645  649                                  *rtdp = ntdp;
 646  650                          }
 647  651  
 648  652                          addhash(*rtdp, h2);
 649  653  
 650  654                  } else { /* that type is already defined */
 651  655                          if (ntdp->t_type != TYPEDEF || ntdp->t_name != NULL) {
 652  656                                  *rtdp = ntdp;
↓ open down ↓ 558 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX