archlinux / alpm.rs

Rust bindings for libalpm
GNU General Public License v3.0
112 stars 21 forks source link

Fix compiling on ARM-based platforms #1

Closed grego closed 4 years ago

grego commented 4 years ago

On several ARM- and PowerPC-based platforms, c_char is defined as u8, which, without casting, prevents compiling on these platforms.

Morganamilo commented 4 years ago

For some reason github has decided not to make me watch my own repos by default.

Thanks for the PR, I'll merge this for now seems as compiling is better than not compiling.

But now that i've looked into it, it seems pubkey_algo is actually intended to be a character an not just a byte. So it's probably best that we return a u8 so it interlopes with b'R' in rust.


lib/libalpm/signing.c
377:    pgpkey->pubkey_algo = '?';
379:    switch(key->subkeys->pubkey_algo) {
383:            pgpkey->pubkey_algo = 'R';
387:            pgpkey->pubkey_algo = 'D';
402:            pgpkey->pubkey_algo = 'E';
410:     * here if we have a valid pubkey_algo. */
411:    if (pgpkey->pubkey_algo == '?') {
413:            "unknown public key algorithm: %d\n", key->subkeys->pubkey_algo);
`