if ((err = SSLHashSHA1.update(&hashCtx, &serverRandom)) != 0) goto fail; if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0) goto fail; goto fail; if ((err = SSLHashSHA1.final(&hashCtx, &hashOut)) != 0) goto fail; ...
Name:
Anonymous2014-06-07 14:15
This could happened with everything, I am not a fan of goto but for fuck's sake if ((err = SSLHashSHA1.update(&hashCtx, &serverRandom)) != 0) throw exceptionFailFactoryFactory; if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0) throw exceptionFailFactoryFactory; throw exceptionFailFactoryFactory; if ((err = SSLHashSHA1.final(&hashCtx, &hashOut)) != 0) throw exceptionFailFactoryFactory; /* throw a exception to the factory that creates factories that create failures */
this could be avoided by using auto-indenting, emacs and kate have that for cases like this Now, can anybody tell me why the fuck do they put ``err ='' if they do not use it?
This would not be high grade programming suitable for mission-critical applications. Our style conventions dictacate the following:
errlevel=0; a=push1(data); if(a != SUCCESS)
{ // Open brace A here
errlevel=-1;
a=push2(otherdata); if(a != SUCCESS)
{ // Open brace B here
errlevel=-2;
a=do_something(data,otherdata); if(a != SUCCESS)
{ // Open brace C here
errlevel=-3;
pop2(otherdata);
} // Close brace C here
pop1(data);
} // Close brace B here
return errlevel;
As you can see it's essential to name your brackets so they can be back referenced. This avoids 100% of programmer error.
Name:
Anonymous2014-06-08 12:54
I actualy semy-agree with >>16-nigger that putting the success into the if is a better idea one reason for this is that you can avoid more than one or two return statements and it also saves you from goto nigger; errors that only subhumans do
Please tell you Dijkstra to learn about Mach's Principle. Because the nature is dual: glass can be both half-full and half-empty, but Dijkstra sees GOTOs as a half-empty glass. That is typical of shortsighted and self-righteous persons.