X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2FKM_error.h;h=77a0846af9dccd41d47777c76e1e0c694316a864;hb=665b2e2e5dcf2266e636d29bcf4ef281da65117f;hp=c0305e88db1f839d1493ee38f0f59a3d42100de2;hpb=2d873c4cc863b3c1d26cfaccdc9fe29cf347a621;p=asdcplib.git diff --git a/src/KM_error.h b/src/KM_error.h index c0305e8..77a0846 100755 --- a/src/KM_error.h +++ b/src/KM_error.h @@ -1,5 +1,5 @@ /* -Copyright (c) 2004-2011, John Hurst +Copyright (c) 2004-2014, John Hurst All rights reserved. Redistribution and use in source and binary forms, with or without @@ -105,7 +105,8 @@ namespace Kumu KM_DECLARE_RESULT(NOTAFILE, -19, "Filename not found."); KM_DECLARE_RESULT(UNKNOWN, -20, "Unknown result code."); KM_DECLARE_RESULT(DIR_CREATE, -21, "Unable to create directory."); - // -22 is reserved + KM_DECLARE_RESULT(NOT_EMPTY, -22, "Unable to delete non-empty directory."); + // 23-100 are reserved } // namespace Kumu @@ -135,6 +136,22 @@ namespace Kumu return Kumu::RESULT_NULL_STR; \ } +// RESULT_STATE is ambiguous. Use these everywhere it is assigned to provide some context +#define KM_RESULT_STATE_TEST_IMPLICIT() \ + if ( result == Kumu::RESULT_STATE ) { \ + Kumu::DefaultLogSink().Error("RESULT_STATE RETURNED at %s (%d)\n", __FILE__, __LINE__); \ + } + +#define KM_RESULT_STATE_TEST_THIS(_this__r_) \ + if ( _this__r_ == Kumu::RESULT_STATE ) { \ + Kumu::DefaultLogSink().Error("RESULT_STATE RETURNED at %s (%d)\n", __FILE__, __LINE__); \ + } + +#define KM_RESULT_STATE_HERE() \ + Kumu::DefaultLogSink().Error("RESULT_STATE RETURNED at %s (%d)\n", __FILE__, __LINE__); + + + namespace Kumu { // simple tracing mechanism