Re: Curious code in Installer::installOneSource

2003-04-05 Thread Robert Collins
On Sun, 2003-04-06 at 08:38, Max Bowsher wrote:
> I'm working in this area to implement the MD5-on-install feature. Is there
> any reason why I should not simplify this:

From memory there was either a const correctness issue, or a funny
optimiser bug. Lets keep non-related bugfixes to HEAD though. (i.e.
patch that in HEAD not 200303).

Rob
-- 
GPG key available at: .


signature.asc
Description: This is a digitally signed message part


Re: Curious code in Installer::installOneSource

2003-04-05 Thread Igor Pechtchanski
On Sat, 5 Apr 2003, Max Bowsher wrote:

> I'm working in this area to implement the MD5-on-install feature. Is there
> any reason why I should not simplify this:
>
> char msg[64];
> strcpy (msg, "Installing");
> Progress.SetText1 (msg);
> log (LOG_PLAIN, String (msg) + " " + source.Cached ());
>
> To this:
> char msg[] = "Installing";
> Progress.SetText1 (msg);
> log (LOG_PLAIN, String (msg) + " " + source.Cached ());
>
> Or even, this:
> Progress.SetText1 ("Installing");
> log (LOG_PLAIN, String ("Installing ") + source.Cached ());
>
> (There is no other use of the msg variable outside the context shown here.)
> Max.

Max,

Normally I would argue for a #define (using the "Redundancy leads to
inconsistency" principle), but in this case the two uses seem to be
completely independent, so I think your last suggestion is ok.
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
 |,4-  ) )-,_. ,\ (  `'-'   Igor Pechtchanski
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Knowledge is an unending adventure at the edge of uncertainty.
  -- Leto II



Curious code in Installer::installOneSource

2003-04-05 Thread Max Bowsher
I'm working in this area to implement the MD5-on-install feature. Is there
any reason why I should not simplify this:

char msg[64];
strcpy (msg, "Installing");
Progress.SetText1 (msg);
log (LOG_PLAIN, String (msg) + " " + source.Cached ());

To this:
char msg[] = "Installing";
Progress.SetText1 (msg);
log (LOG_PLAIN, String (msg) + " " + source.Cached ());

Or even, this:
Progress.SetText1 ("Installing");
log (LOG_PLAIN, String ("Installing ") + source.Cached ());

(There is no other use of the msg variable outside the context shown here.)


Max.