Print this page
4210 unsigned unsigned short short is valid in dtrace
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Eric Diven <eric.diven@delphix.com>
Reviewed by: Adam Leventhal <ahl@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libdtrace/common/dt_decl.c
          +++ new/usr/src/lib/libdtrace/common/dt_decl.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  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  /*
  23   23   * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  24      - * Copyright (c) 2012 by Delphix. All rights reserved.
       24 + * Copyright (c) 2013 by Delphix. All rights reserved.
  25   25   */
  26   26  
  27   27  #include <strings.h>
  28   28  #include <stdlib.h>
  29   29  #include <limits.h>
  30   30  #include <alloca.h>
  31   31  #include <assert.h>
  32   32  
  33   33  #include <dt_decl.h>
  34   34  #include <dt_parser.h>
↓ open down ↓ 224 lines elided ↑ open up ↑
 259  259  dt_decl_attr(ushort_t attr)
 260  260  {
 261  261          dt_decl_t *ddp = yypcb->pcb_dstack.ds_decl;
 262  262  
 263  263          if (ddp == NULL) {
 264  264                  ddp = dt_decl_push(dt_decl_alloc(CTF_K_UNKNOWN, NULL));
 265  265                  ddp->dd_attr = attr;
 266  266                  return (ddp);
 267  267          }
 268  268  
      269 +        if ((attr & DT_DA_LONG) && (ddp->dd_attr & DT_DA_LONGLONG)) {
      270 +                xyerror(D_DECL_COMBO, "the attribute 'long' may only "
      271 +                    "be used at most twice in a declaration");
      272 +        }
      273 +
      274 +        if ((attr & DT_DA_SHORT) && (ddp->dd_attr & DT_DA_SHORT)) {
      275 +                xyerror(D_DECL_COMBO, "the attribute 'short' may only be "
      276 +                    "used at most once in a declaration");
      277 +        }
      278 +
      279 +        if ((attr & DT_DA_SIGNED) && (ddp->dd_attr & DT_DA_SIGNED)) {
      280 +                xyerror(D_DECL_COMBO, "the attribute 'signed' may only be "
      281 +                    "used at most once in a declaration");
      282 +        }
      283 +
      284 +        if ((attr & DT_DA_UNSIGNED) && (ddp->dd_attr & DT_DA_UNSIGNED)) {
      285 +                xyerror(D_DECL_COMBO, "the attribute 'unsigned' may only be "
      286 +                    "used at most once in a declaration");
      287 +        }
      288 +
 269  289          if (attr == DT_DA_LONG && (ddp->dd_attr & DT_DA_LONG)) {
 270  290                  ddp->dd_attr &= ~DT_DA_LONG;
 271  291                  attr = DT_DA_LONGLONG;
 272  292          }
 273  293  
 274  294          ddp->dd_attr |= attr;
 275  295          return (dt_decl_check(ddp));
 276  296  }
 277  297  
 278  298  /*
↓ open down ↓ 841 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX