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

@ -494,7 +494,7 @@ Blowfish_expandstate(blf_ctx *c, const uint8_t *data, uint16_t databytes,
}
void
__unused blf_key(blf_ctx *c, const uint8_t *k, uint16_t len)
blf_key(blf_ctx *c, const uint8_t *k, uint16_t len)
{
/* Initialize S-boxes and subkeys with Pi */
Blowfish_initstate(c);
@ -517,7 +517,7 @@ blf_enc(blf_ctx *c, uint32_t *data, uint16_t blocks)
}
void
__unused blf_dec(blf_ctx *c, uint32_t *data, uint16_t blocks)
blf_dec(blf_ctx *c, uint32_t *data, uint16_t blocks)
{
uint32_t *d;
uint16_t i;
@ -530,7 +530,7 @@ __unused blf_dec(blf_ctx *c, uint32_t *data, uint16_t blocks)
}
void
__unused blf_ecb_encrypt(blf_ctx *c, uint8_t *data, uint32_t len)
blf_ecb_encrypt(blf_ctx *c, uint8_t *data, uint32_t len)
{
uint32_t l, r;
uint32_t i;
@ -552,7 +552,7 @@ __unused blf_ecb_encrypt(blf_ctx *c, uint8_t *data, uint32_t len)
}
void
__unused blf_ecb_decrypt(blf_ctx *c, uint8_t *data, uint32_t len)
blf_ecb_decrypt(blf_ctx *c, uint8_t *data, uint32_t len)
{
uint32_t l, r;
uint32_t i;
@ -574,7 +574,7 @@ __unused blf_ecb_decrypt(blf_ctx *c, uint8_t *data, uint32_t len)
}
void
__unused blf_cbc_encrypt(blf_ctx *c, uint8_t *iv, uint8_t *data, uint32_t len)
blf_cbc_encrypt(blf_ctx *c, uint8_t *iv, uint8_t *data, uint32_t len)
{
uint32_t l, r;
uint32_t i, j;
@ -599,7 +599,7 @@ __unused blf_cbc_encrypt(blf_ctx *c, uint8_t *iv, uint8_t *data, uint32_t len)
}
void
__unused blf_cbc_decrypt(blf_ctx *c, uint8_t *iva, uint8_t *data, uint32_t len)
blf_cbc_decrypt(blf_ctx *c, uint8_t *iva, uint8_t *data, uint32_t len)
{
uint32_t l, r;
uint8_t *iv;

View File

@ -530,7 +530,7 @@ void cli_user(Arguments *args, Operation *operation) {
operation->fullName, operation->masterPassword, MPAlgorithmVersionCurrent );
}
void cli_site(Arguments __unused *args, Operation *operation) {
void cli_site(Arguments *args, Operation *operation) {
if (!operation->siteName)
abort();
@ -546,7 +546,7 @@ void cli_site(Arguments __unused *args, Operation *operation) {
operation->user, operation->siteName, operation->user->defaultType, MPCounterValueDefault, operation->user->algorithm );
}
void cli_question(Arguments __unused *args, Operation *operation) {
void cli_question(Arguments *args, Operation *operation) {
if (!operation->site)
abort();
@ -569,7 +569,7 @@ void cli_question(Arguments __unused *args, Operation *operation) {
}
}
void cli_operation(Arguments __unused *args, Operation *operation) {
void cli_operation(Arguments *args, Operation *operation) {
mpw_free_string( &operation->identicon );
operation->identicon = mpw_identicon_str( mpw_identicon( operation->user->fullName, operation->user->masterPassword ) );
@ -770,7 +770,7 @@ void cli_mpw(Arguments *args, Operation *operation) {
operation->site->uses++;
}
void cli_save(Arguments __unused *args, Operation *operation) {
void cli_save(Arguments *args, Operation *operation) {
if (operation->sitesFormat == MPMarshalFormatNone)
return;

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 */