Changeset 164:7b47551c117c in rrlib_util


Ignore:
Timestamp:
13.04.2018 17:29:56 (20 months ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
14.08
Children:
165:20f165f22d0f, 166:f256efc85099, 167:db24b1e80891
Phase:
public
Message:

Bugfix for Get and Set methods of tEnumBasedFlags when used with 64-Bit TStorage types

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tEnumBasedFlags.h

    r160 r164  
    122122  bool Get(TFlag flag) const 
    123123  { 
    124     return this->wrapped & (1 << static_cast<TStorage>(flag)); 
     124    return this->wrapped & (static_cast<TStorage>(1) << static_cast<TStorage>(flag)); 
    125125  } 
    126126 
     
    143143    if (value) 
    144144    { 
    145       this->wrapped |= (1 << static_cast<TStorage>(flag)); 
     145      this->wrapped |= (static_cast<TStorage>(1) << static_cast<TStorage>(flag)); 
    146146    } 
    147147    else 
    148148    { 
    149       this->wrapped &= (~(1 << static_cast<TStorage>(flag))); 
     149      this->wrapped &= (~(static_cast<TStorage>(1) << static_cast<TStorage>(flag))); 
    150150    } 
    151151    return *this; 
Note: See TracChangeset for help on using the changeset viewer.