From 0eeb63749fa02b996ea2523dcef1d172a6a00b09 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Thu, 5 Jun 2008 22:26:51 -0500 Subject: [PATCH] Oops. Fix Log_Entry diff'ing. --- Timeline/Log_Entry.C | 14 +++++++------- Timeline/Log_Entry.H | 2 +- Timeline/Loggable.C | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Timeline/Log_Entry.C b/Timeline/Log_Entry.C index fb21e87..79fc424 100644 --- a/Timeline/Log_Entry.C +++ b/Timeline/Log_Entry.C @@ -166,8 +166,11 @@ Log_Entry::parse_alist( const char *s ) /** compare elements of dumps s1 and s2, removing those elements of dst which are not changed from src */ bool -Log_Entry::log_diff ( char **sa1, char **sa2 ) +Log_Entry::diff ( Log_Entry *e1, Log_Entry *e2 ) { + char **sa1 = e1->_sa; + char **sa2 = e2->_sa; + if ( ! sa1 ) return true; @@ -194,13 +197,10 @@ Log_Entry::log_diff ( char **sa1, char **sa2 ) sa1[ w ] = NULL; sa2[ w ] = NULL; - return w == 0 ? false : true; -} + e1->_i = w; + e2->_i = w; -bool -Log_Entry::operator!= ( const Log_Entry &rhs ) const -{ - return log_diff( this->_sa, rhs._sa ); + return w == 0 ? false : true; } void diff --git a/Timeline/Log_Entry.H b/Timeline/Log_Entry.H index 3033337..bb8ecae 100644 --- a/Timeline/Log_Entry.H +++ b/Timeline/Log_Entry.H @@ -60,7 +60,7 @@ public: /* Examination */ /***************/ - bool operator!= ( const Log_Entry &rhs ) const; + static bool diff ( Log_Entry *e1, Log_Entry *e2 ); int size ( void ) const; diff --git a/Timeline/Loggable.C b/Timeline/Loggable.C index 9d39501..7d83b4e 100644 --- a/Timeline/Loggable.C +++ b/Timeline/Loggable.C @@ -603,7 +603,7 @@ Loggable::log_end ( void ) get( *new_state ); - if ( *_old_state != *new_state ) + if ( Log_Entry::diff( _old_state, new_state ) ) { log( "%s 0x%X set ", class_name(), _id );