Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/ExpressionNode.cc

    rbeec62c r7b1d5ec  
    1010// Created On       : Sat May 16 13:17:07 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Sep 12 10:00:29 2017
    13 // Update Count     : 672
     12// Last Modified On : Mon Sep 11 16:06:42 2017
     13// Update Count     : 666
    1414//
    1515
     
    4949// type.
    5050
    51 extern const Type::Qualifiers noQualifiers;                             // no qualifiers on constants
     51extern const Type::Qualifiers noQualifiers;             // no qualifiers on constants
    5252
    5353static inline bool checkH( char c ) { return c == 'h' || c == 'H'; }
     
    7979
    8080        bool dec = true, Unsigned = false;                                      // decimal, unsigned constant
    81         int size;                                                                                       // 0 => short, 1 => char, 2 => int, 3 => long int, 4 => long long int, 5 => size_t
     81        int size;                                                                                       // 0 => int, 1 => long, 2 => long long
    8282        unsigned long long int v;                                                       // converted integral value
    8383        size_t last = str.length() - 1;                                         // last character of constant
     
    163163                str.erase( last - size, size + 1 );                             // remove 'h'/"hh"
    164164        } else if ( checkZ( str[last] ) ) {                                     // suffix 'z' ?
    165                 size = 5;
    166165                str.erase( last, 1 );                                                   // remove 'z'
    167166        } // if
     
    169168        ret = new ConstantExpr( Constant( new BasicType( noQualifiers, kind[Unsigned][size] ), str, v ) );
    170169        if ( Unsigned && size < 2 ) {                                           // less than int ?
    171                 // int i = -1uh => 65535 not -1, so cast is necessary for unsigned, which eliminates warnings for large values.
     170                // int i = -1uh => 65535 not -1, so cast is necessary for unsigned, which eliminates some warnings for large
     171                // values.
    172172                ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][size] ) );
    173         } else if ( size == 5 ) {                                                       // explicit cast to size_t
    174                 ret = new CastExpr( ret, new TypeInstType( Type::Qualifiers(), "size_t", false ) );
    175173        } // if
    176174  CLEANUP:
Note: See TracChangeset for help on using the changeset viewer.