Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Type.cc

    rbe9288a rde9285f  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Aug  2 11:11:00 2017
    13 // Update Count     : 29
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Mon Sep 11 13:21:25 2017
     13// Update Count     : 37
    1414//
    1515#include "Type.h"
     
    2626        "_Bool",
    2727        "char",
    28         "char",
     28        "signed char",
    2929        "unsigned char",
    30         "short",
    31         "short unsigned",
    32         "int",
     30        "signed short int",
     31        "unsigned short int",
     32        "signed int",
    3333        "unsigned int",
    34         "long int",
    35         "long unsigned int",
    36         "long long int",
    37         "long long unsigned int",
     34        "signed long int",
     35        "unsigned long int",
     36        "signed long long int",
     37        "unsigned long long int",
    3838        "float",
    3939        "double",
     
    6464const char * Type::QualifiersNames[] = { "const", "restrict", "volatile", "lvalue", "mutex", "_Atomic" };
    6565
    66 Type *Type::stripDeclarator() {
    67         Type * type = this;
    68         while ( Type * at = InitTweak::getPointerBase( type ) ) {
    69                 type = at;
    70         }
     66Type * Type::stripDeclarator() {
     67        Type * type, * at;
     68        for ( type = this; (at = InitTweak::getPointerBase( type )); type = at );
    7169        return type;
    7270}
     71
     72Type * Type::stripReferences() {
     73        Type * type;
     74        ReferenceType * ref;
     75        for ( type = this; (ref = dynamic_cast<ReferenceType *>( type )); type = ref->get_base() );
     76        return type;
     77}
     78
     79int Type::referenceDepth() const { return 0; }
    7380
    7481void Type::print( std::ostream &os, int indent ) const {
Note: See TracChangeset for help on using the changeset viewer.