cpp: Fix debug output of SignatureMode
* lang/cpp/src/context.cpp (operator<<): Treat signature mode as combination of a 2-bit flag and a 1-bit flag. -- This fixes the output for normal signature mode. GnuPG-bug-id: 6342
This commit is contained in:
parent
8c4436e73a
commit
41a30f6d9f
@ -1906,10 +1906,18 @@ std::ostream &operator<<(std::ostream &os, KeyListMode mode)
|
|||||||
std::ostream &operator<<(std::ostream &os, SignatureMode mode)
|
std::ostream &operator<<(std::ostream &os, SignatureMode mode)
|
||||||
{
|
{
|
||||||
os << "GpgME::SignatureMode(";
|
os << "GpgME::SignatureMode(";
|
||||||
#define CHECK( x ) if ( !(mode & (x)) ) {} else do { os << #x " "; } while (0)
|
#undef CHECK
|
||||||
|
switch (mode & (NormalSignatureMode|Detached|Clearsigned)) {
|
||||||
|
#define CHECK( x ) case x: os << #x; break
|
||||||
CHECK(NormalSignatureMode);
|
CHECK(NormalSignatureMode);
|
||||||
CHECK(Detached);
|
CHECK(Detached);
|
||||||
CHECK(Clearsigned);
|
CHECK(Clearsigned);
|
||||||
|
#undef CHECK
|
||||||
|
default:
|
||||||
|
os << "???" "(" << static_cast<int>(mode) << ')';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#define CHECK( x ) if ( !(mode & (x)) ) {} else do { os << #x " "; } while (0)
|
||||||
CHECK(SignArchive);
|
CHECK(SignArchive);
|
||||||
#undef CHECK
|
#undef CHECK
|
||||||
return os << ')';
|
return os << ')';
|
||||||
|
Loading…
Reference in New Issue
Block a user