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>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Dan McDonald <danmcd@omniti.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) 2013 by Delphix. All rights reserved.
       24 + * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
  25   25   * Copyright (c) 2013 Joyent, Inc. All rights reserved.
  26   26   */
  27   27  
  28   28  #include <strings.h>
  29   29  #include <stdlib.h>
  30   30  #include <limits.h>
  31   31  #include <alloca.h>
  32   32  #include <assert.h>
  33   33  
  34   34  #include <dt_decl.h>
↓ open down ↓ 225 lines elided ↑ open up ↑
 260  260  dt_decl_attr(ushort_t attr)
 261  261  {
 262  262          dt_decl_t *ddp = yypcb->pcb_dstack.ds_decl;
 263  263  
 264  264          if (ddp == NULL) {
 265  265                  ddp = dt_decl_push(dt_decl_alloc(CTF_K_UNKNOWN, NULL));
 266  266                  ddp->dd_attr = attr;
 267  267                  return (ddp);
 268  268          }
 269  269  
      270 +        if ((attr & DT_DA_LONG) && (ddp->dd_attr & DT_DA_LONGLONG)) {
      271 +                xyerror(D_DECL_COMBO, "the attribute 'long' may only "
      272 +                    "be used at most twice in a declaration");
      273 +        }
      274 +
      275 +        if ((attr & DT_DA_SHORT) && (ddp->dd_attr & DT_DA_SHORT)) {
      276 +                xyerror(D_DECL_COMBO, "the attribute 'short' may only be "
      277 +                    "used at most once in a declaration");
      278 +        }
      279 +
      280 +        if ((attr & DT_DA_SIGNED) && (ddp->dd_attr & DT_DA_SIGNED)) {
      281 +                xyerror(D_DECL_COMBO, "the attribute 'signed' may only be "
      282 +                    "used at most once in a declaration");
      283 +        }
      284 +
      285 +        if ((attr & DT_DA_UNSIGNED) && (ddp->dd_attr & DT_DA_UNSIGNED)) {
      286 +                xyerror(D_DECL_COMBO, "the attribute 'unsigned' may only be "
      287 +                    "used at most once in a declaration");
      288 +        }
      289 +
 270  290          if (attr == DT_DA_LONG && (ddp->dd_attr & DT_DA_LONG)) {
 271  291                  ddp->dd_attr &= ~DT_DA_LONG;
 272  292                  attr = DT_DA_LONGLONG;
 273  293          }
 274  294  
 275  295          ddp->dd_attr |= attr;
 276  296          return (dt_decl_check(ddp));
 277  297  }
 278  298  
 279  299  /*
↓ open down ↓ 846 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX