Porting style

Werner Koch wk at gnupg.org
Wed Jan 15 19:44:10 CET 2003


On Wed, 15 Jan 2003 11:11:03 -0600, David Champion said:

> either.) Yet I'd actually disagree that your second example is more
> readable than the first, though. I think it less so, because HAVE_PGP
> and foo are of a different nature. It's useful for the person reading

Mutt's code is at some places more complicated, something like:

  if (foo) {
#ifdef HAVE_PGP
    bar ();
#ifdef HAVE_SMIME
    if (detached)
      smime_check_something ()
#endif
    baz();
  }
  else
#endif
#ifdef HAVE_PGP
    more_pgp_code ();
#else
#ifndef HAVE_SMIME
    special_exception ()
#endif
    display_no_pgp ();
#endif

Combine this with a couple of "if else" and non-crypto related ifdefs and
you might get an idea why I feel my approach is more readable ;-)











More information about the Gnupg-devel mailing list