Joshua Cranmer wrote:

Justin Dolske wrote:

But really, the best way to fix this would be to use a macro:

  err = SSLHashSHA1.update(&hashCtx, &foo);
  SSL_ENSURE_SUCCESS(err, err);
  err = SSLHashSHA1.update(&hashCtx, &bar);
  SSL_ENSURE_SUCCESS(err, err);
  err = SSLHashSHA1.update(&hashCtx, &baz);
  SSL_ENSURE_SUCCESS(err, err);

Ok, maybe I'm not being entirely serious. :P

Being serious here, early-return and RTTI (to handle the cleanup prior to exit) would have eliminated the need for gotos in the first place.

I assume you mean RAII. Unfortunately that requires C++. (I was fooled too; someone pointed out to me on IRC that update is actually a function pointer member. You reap what you sow.)

--
Warning: May contain traces of nuts.
_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to