From 9f6d0202f04222aa6610c9f20db0644d723ee50e Mon Sep 17 00:00:00 2001 From: Frerich Raabe Date: Fri, 18 Jun 2004 22:06:04 +0000 Subject: [PATCH] - gcc 2.95.4 chokes if you static_cast something to an enum :-( svn path=/trunk/kdebase/kwin/; revision=321803 --- rules.cpp | 28 ++++++++++++++-------------- rules.h | 6 +++--- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/rules.cpp b/rules.cpp index f10e4e24b2..c4bba4ec17 100644 --- a/rules.cpp +++ b/rules.cpp @@ -118,7 +118,7 @@ void Rules::readFromCfg( KConfig& cfg ) READ_FORCE_RULE_2( placement,, Placement::policyFromString, false ); READ_SET_RULE_DEF( position, Point,, &invalidPoint ); READ_SET_RULE( size, Size, ); - if( size.isEmpty() && sizerule != static_cast< SetRule >( Remember )) + if( size.isEmpty() && sizerule != ( SetRule )Remember) sizerule = UnusedSetRule; READ_FORCE_RULE( minsize, Size, ); if( !minsize.isValid()) @@ -310,67 +310,67 @@ bool Rules::update( Client* c ) { // TODO check this setting is for this client ? bool updated = false; - if( positionrule == static_cast< SetRule >( Remember )) + if( positionrule == ( SetRule )Remember) { updated = updated || position != c->pos(); position = c->pos(); } - if( sizerule == static_cast< SetRule >( Remember )) + if( sizerule == ( SetRule )Remember) { updated = updated || size != c->size(); size = c->size(); } - if( desktoprule == static_cast< SetRule >( Remember )) + if( desktoprule == ( SetRule )Remember) { updated = updated || desktop != c->desktop(); desktop = c->desktop(); } - if( maximizevertrule == static_cast< SetRule >( Remember )) + if( maximizevertrule == ( SetRule )Remember) { updated = updated || maximizevert != bool( c->maximizeMode() & MaximizeVertical ); maximizevert = c->maximizeMode() & MaximizeVertical; } - if( maximizehorizrule == static_cast< SetRule >( Remember )) + if( maximizehorizrule == ( SetRule )Remember) { updated = updated || maximizehoriz != bool( c->maximizeMode() & MaximizeHorizontal ); maximizehoriz = c->maximizeMode() & MaximizeHorizontal; } - if( minimizerule == static_cast< SetRule >( Remember )) + if( minimizerule == ( SetRule )Remember) { updated = updated || minimize != c->isMinimized(); minimize = c->isMinimized(); } - if( shaderule == static_cast< SetRule >( Remember )) + if( shaderule == ( SetRule )Remember) { updated = updated || ( shade != ( c->shadeMode() != ShadeNone )); shade = c->shadeMode() != ShadeNone; } - if( skiptaskbarrule == static_cast< SetRule >( Remember )) + if( skiptaskbarrule == ( SetRule )Remember) { updated = updated || skiptaskbar != c->skipTaskbar(); skiptaskbar = c->skipTaskbar(); } - if( skippagerrule == static_cast< SetRule >( Remember )) + if( skippagerrule == ( SetRule )Remember) { updated = updated || skippager != c->skipPager(); skippager = c->skipPager(); } - if( aboverule == static_cast< SetRule >( Remember )) + if( aboverule == ( SetRule )Remember) { updated = updated || above != c->keepAbove(); above = c->keepAbove(); } - if( belowrule == static_cast< SetRule >( Remember )) + if( belowrule == ( SetRule )Remember) { updated = updated || below != c->keepBelow(); below = c->keepBelow(); } - if( fullscreenrule == static_cast< SetRule >( Remember )) + if( fullscreenrule == ( SetRule )Remember) { updated = updated || fullscreen != c->isFullScreen(); fullscreen = c->isFullScreen(); } - if( noborderrule == static_cast< SetRule >( Remember )) + if( noborderrule == ( SetRule )Remember) { updated = updated || noborder != c->isUserNoBorder(); noborder = c->isUserNoBorder(); diff --git a/rules.h b/rules.h index 7fde3824f8..494d84110f 100644 --- a/rules.h +++ b/rules.h @@ -189,9 +189,9 @@ class Rules inline bool Rules::checkSetRule( SetRule rule, bool init ) { - if( rule > static_cast< SetRule >( DontAffect )) // Unused or DontAffect + if( rule > ( SetRule )DontAffect) // Unused or DontAffect { - if( rule == static_cast< SetRule >( Force ) || init ) + if( rule == ( SetRule )Force || init ) return true; } return false; @@ -200,7 +200,7 @@ bool Rules::checkSetRule( SetRule rule, bool init ) inline bool Rules::checkForceRule( ForceRule rule ) { - return rule == static_cast< ForceRule >( Force ); + return rule == ( ForceRule )Force; } inline