cpp: Avoid missing returns in non-void functions

* lang/cpp/src/context.cpp
  (Context::signaturePolicyURL): return nullptr on default
  (to_tofu_policy_t): add default case for unknown
* lang/cpp/src/key.cpp
  (Key::primaryFingerprint): return nullptr on default
* lang/cpp/src/tofuinfo.cpp
  (GpgME::TofuInfo::policy): add default case for unknown

Signed-off-by: Andreas Stieger <astieger@suse.com>
Signed-off-by: Andre Heinecke <aheinecke@intevation.de>
This commit is contained in:
Andreas Stieger 2016-09-21 14:28:23 +02:00 committed by Andre Heinecke
parent 0b78bc7ba4
commit ae324b51ff
3 changed files with 4 additions and 0 deletions

View File

@ -1051,6 +1051,7 @@ const char *Context::signaturePolicyURL() const
return n->value; return n->value;
} }
} }
return nullptr;
} }
Notation Context::signatureNotation(unsigned int idx) const Notation Context::signatureNotation(unsigned int idx) const
@ -1344,6 +1345,7 @@ static gpgme_tofu_policy_t to_tofu_policy_t(unsigned int policy)
case TofuInfo::PolicyAsk: case TofuInfo::PolicyAsk:
return GPGME_TOFU_POLICY_ASK; return GPGME_TOFU_POLICY_ASK;
case TofuInfo::PolicyUnknown: case TofuInfo::PolicyUnknown:
default:
return GPGME_TOFU_POLICY_UNKNOWN; return GPGME_TOFU_POLICY_UNKNOWN;
} }
} }

View File

@ -273,6 +273,7 @@ const char *Key::primaryFingerprint() const
/* Return the first subkeys fingerprint */ /* Return the first subkeys fingerprint */
return key->subkeys->fpr; return key->subkeys->fpr;
} }
return nullptr;
} }
unsigned int Key::keyListMode() const unsigned int Key::keyListMode() const

View File

@ -109,6 +109,7 @@ GpgME::TofuInfo::Policy GpgME::TofuInfo::policy() const
case GPGME_TOFU_POLICY_ASK: case GPGME_TOFU_POLICY_ASK:
return PolicyAsk; return PolicyAsk;
case GPGME_TOFU_POLICY_UNKNOWN: case GPGME_TOFU_POLICY_UNKNOWN:
default:
return PolicyUnknown; return PolicyUnknown;
} }
} }