explicit conversions

doc_update_sequoia
Volker Birk 5 years ago
parent efee3c28e1
commit 476e31491a

@ -393,7 +393,7 @@ unsigned long long get_bitmask(int num_bits) {
static char* get_base_36_rep(unsigned long long value, int num_sig_bits) {
int bufsize = ceil(num_sig_bits / _pEp_log2_36) + 1;
int bufsize = ((int) ceil((double) num_sig_bits / _pEp_log2_36)) + 1;
// based on
// https://en.wikipedia.org/wiki/Base36#C_implementation
@ -478,7 +478,7 @@ static PEP_STATUS generate_message_id(message* msg) {
time_t curr_time = time(NULL);
time_prefix = get_base_36_rep(curr_time, ceil(log2(curr_time)));
time_prefix = get_base_36_rep(curr_time, (int) ceil(log2((double) curr_time)));
if (!time_prefix)
goto enomem;

@ -1336,7 +1336,7 @@ DYNAMIC_API PEP_STATUS init(PEP_SESSION *session)
// Note: Following statement is NOT for any cryptographic/secure functionality; it is
// ONLY used for some randomness in generated outer message ID, which are
// required by the RFC to be globally unique!
srand(time(NULL));
srand((unsigned int) time(NULL));
return PEP_STATUS_OK;

@ -427,6 +427,6 @@ extern int _pEp_rand_max_bits;
extern double _pEp_log2_36;
static inline void _init_globals() {
_pEp_rand_max_bits = ceil(log2(RAND_MAX));
_pEp_rand_max_bits = (int) ceil(log2((double) RAND_MAX));
_pEp_log2_36 = log2(36);
}

@ -145,7 +145,7 @@ void *dlopen(const char *filename, int flag) {
TEXT("SOFTWARE\\GnuPG"), TEXT("Install Directory"), path,
PATH_BUF_SIZE, NULL);
// If not found in current user, look up in local machine
if (!result)
if (!result)
result = readRegistryString(HKEY_LOCAL_MACHINE,
TEXT("SOFTWARE\\GnuPG"), TEXT("Install Directory"), path,
PATH_BUF_SIZE, NULL);

Loading…
Cancel
Save