On 6/23/05, Olivier Galibert <[EMAIL PROTECTED]> wrote: > No, I think he means the traditional: > > reiser4_fill_super() > { > if (init_a()) > goto failed_a; . . .
IMO this works very well when the initialization always completes or fails totally in a single routine. When your init routine can leave something partially inited, then putting all of the cleanup code in a single function and using the enums eliminates duplicate code and makes things easier to read. (it's a state machine like many device drivers and network stacks). Also, perhaps a compromise on the asserts at the beggining of functions. If they are moved into a header file, say resier4_contracts.h and replaced with a single macro, you get most of the benefits and elminate most of the clutter. If properly done, there may even be some advantages gained by auto generating the conttact.h file(s) from some sort of formal spec or design doc. Ross