pgbackrest.git / summary / log / commit / refs

commit    d3be1e41a4cdb5b7bbc40d73de8f185b22a97efd
Author:   David Steele <david@pgmasters.net>
Date:     Thu Jan 16 23:23:40 2020 +0000

    Add braces and spaces for clarity.
    
    This should make it a little easier to see how the TRY macros work together.


src/common/error.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/common/error.h b/src/common/error.h index 162294c4e..37fe703da 100644 --- a/src/common/error.h +++ b/src/common/error.h @@ -84,37 +84,39 @@ unsigned int errorTryDepth(void); Begin a block where errors can be thrown ***********************************************************************************************************************************/ #define TRY_BEGIN() \ -do \ -{ \ - if (errorInternalTry(__FILE__, __func__, __LINE__) && setjmp(*errorInternalJump()) >= 0) \ + do \ { \ - while (errorInternalProcess(false)) \ - if (errorInternalStateTry()) + if (errorInternalTry(__FILE__, __func__, __LINE__) && setjmp(*errorInternalJump()) >= 0) \ + { \ + while (errorInternalProcess(false)) \ + { \ + if (errorInternalStateTry()) /*********************************************************************************************************************************** Catch a specific error thrown in the try block ***********************************************************************************************************************************/ #define CATCH(errorTypeCatch) \ - else if (errorInternalStateCatch(&errorTypeCatch)) + else if (errorInternalStateCatch(&errorTypeCatch)) /*********************************************************************************************************************************** Catch any error thrown in the try block ***********************************************************************************************************************************/ #define CATCH_ANY() \ - else if (errorInternalStateCatch(&RuntimeError)) + else if (errorInternalStateCatch(&RuntimeError)) /*********************************************************************************************************************************** Code to run whether the try block was successful or not ***********************************************************************************************************************************/ #define FINALLY() \ - else if (errorInternalStateFinal()) + else if (errorInternalStateFinal()) /*********************************************************************************************************************************** End the try block ***********************************************************************************************************************************/ #define TRY_END() \ - } \ -} while (0) + } \ + } \ + } while (0) /*********************************************************************************************************************************** Throw an error [parent: 254f79803fca]