#2638 Impure generic/platform code splitting

obsolete: 8.5a2
closed-fixed
Vince Darley
3
2004-10-07
2004-03-29
Donal K. Fellows
No

When examining generic/tclIOUtil.c, I see a number of
references to things relating to Windows only. Would it
be possible to hive these things off behind a
TclpThingy interface?

At the same time, why is TclpNativeToNormalized defined
in that file at all? That's a function that I'd expect
to be done exclusively by the platform-specific parts
of the core (for all that it is more work that way.)
Perhaps we've actually got an error in the splitting of
functionality between functions if we need that much
common code in that function?

I make all these points because keeping different
platform-specific bits of the core separated from the
generic core makes for much cleaner code overall;
#ifdef-fery is often best characterised as an
obfuscation technique rather than a high-quality
programming paradigm...

Discussion

  • Vince Darley
    Vince Darley
    2004-03-30

    Logged In: YES
    user_id=32170

    I agree that we would be better with more platform specific
    separation, and less #ifdef'ing. I'd certainly support any
    efforts to clean things up.

     
  • Vince Darley
    Vince Darley
    2004-09-30

    Logged In: YES
    user_id=32170

    Attaching a proposed patch to remove #ifdef's and move the
    code to the platform directories.

     
  • Vince Darley
    Vince Darley
    2004-09-30

    diff -u with windows eols

     
    Attachments
  • Vince Darley
    Vince Darley
    2004-09-30

    Logged In: YES
    user_id=32170

    p.s. patch needs testing on Unix. Works fine on Windows.

     
  • Don Porter
    Don Porter
    2004-10-01

     
    Attachments
  • Don Porter
    Don Porter
    2004-10-01

    Logged In: YES
    user_id=80530

    revised patch tests ok on
    Linux/Alpha and Solaris

    now to review the code...

     
  • Don Porter
    Don Porter
    2004-10-02

    Logged In: YES
    user_id=80530

    also tests ok on Mac OS X

     
  • Vince Darley
    Vince Darley
    2004-10-07

    • status: open --> closed-fixed
     
  • Vince Darley
    Vince Darley
    2004-10-07

    Logged In: YES
    user_id=32170

    Updated patch for latest cvs HEAD changes, and applied.