2
0

Remove __unused since it's non-standard.

1. It breaks compilers without support for __attribute__
2. It breaks system headers that declare variables named __unused (eg. musl libc).
This commit is contained in:
Maarten Billemont
2018-06-05 21:22:40 -04:00
parent c7425be681
commit c3017069b1
5 changed files with 15 additions and 19 deletions

View File

@@ -127,7 +127,7 @@ static MPSiteKey mpw_siteKey_v0(
}
static const char *mpw_sitePasswordFromTemplate_v0(
MPMasterKey __unused masterKey, MPSiteKey siteKey, MPResultType resultType, const char __unused *resultParam) {
MPMasterKey masterKey, MPSiteKey siteKey, MPResultType resultType, const char *resultParam) {
const char *_siteKey = (const char *)siteKey;
@@ -157,7 +157,7 @@ static const char *mpw_sitePasswordFromTemplate_v0(
}
static const char *mpw_sitePasswordFromCrypt_v0(
MPMasterKey masterKey, MPSiteKey __unused siteKey, MPResultType __unused resultType, const char *cipherText) {
MPMasterKey masterKey, MPSiteKey siteKey, MPResultType resultType, const char *cipherText) {
if (!cipherText) {
err( "Missing encrypted state." );
@@ -187,7 +187,7 @@ static const char *mpw_sitePasswordFromCrypt_v0(
}
static const char *mpw_sitePasswordFromDerive_v0(
MPMasterKey __unused masterKey, MPSiteKey siteKey, MPResultType resultType, const char *resultParam) {
MPMasterKey masterKey, MPSiteKey siteKey, MPResultType resultType, const char *resultParam) {
switch (resultType) {
case MPResultTypeDeriveKey: {
@@ -232,7 +232,7 @@ static const char *mpw_sitePasswordFromDerive_v0(
}
static const char *mpw_siteState_v0(
MPMasterKey masterKey, MPSiteKey __unused siteKey, MPResultType __unused resultType, const char *plainText) {
MPMasterKey masterKey, MPSiteKey siteKey, MPResultType resultType, const char *plainText) {
// Encrypt
size_t bufSize = strlen( plainText );

View File

@@ -53,7 +53,7 @@ static MPSiteKey mpw_siteKey_v1(
}
static const char *mpw_sitePasswordFromTemplate_v1(
MPMasterKey __unused masterKey, MPSiteKey siteKey, MPResultType resultType, const char __unused *resultParam) {
MPMasterKey masterKey, MPSiteKey siteKey, MPResultType resultType, const char *resultParam) {
// Determine the template.
uint8_t seedByte = siteKey[0];

View File

@@ -29,10 +29,6 @@
#define mpw_enum(_type, _name) _type _name; enum
#endif
#ifndef __unused
#define __unused __attribute__((unused))
#endif
//// Types.
extern const size_t MPMasterKeySize, MPSiteKeySize; /* bytes */