[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepim/libkcal
From:       Stephan Kulow <coolo () kde ! org>
Date:       2006-04-28 7:36:15
Message-ID: 1146209775.422624.14560.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 534950 by coolo:

I know const_cast<KCal::Incidence*>(this) is considered hip, but
as a matter of fact it's undefined behaviour and every compiler is
free to create crashing code


 M  +1 -1      incidence.cpp  
 M  +1 -1      incidence.h  


--- trunk/KDE/kdepim/libkcal/incidence.cpp #534949:534950
@@ -337,7 +337,7 @@
 {
   if (!mRecurrence)
   {
-    const_cast<KCal::Incidence*>(this)->mRecurrence = new Recurrence();
+    mRecurrence = new Recurrence();
     mRecurrence->setStartDateTime( IncidenceBase::dtStart() );
     mRecurrence->setFloats( doesFloat() );
     mRecurrence->setRecurReadOnly( mReadOnly );
--- trunk/KDE/kdepim/libkcal/incidence.h #534949:534950
@@ -485,7 +485,7 @@
     int mPriority;                        // 1 = highest, 2 = less, etc.
 
     Alarm::List mAlarms;
-    Recurrence *mRecurrence;
+    mutable Recurrence *mRecurrence;
 
     QString mLocation;
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic