gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: long long unsigned on 32-bit machines


From: Kai Harrekilde-Petersen
Subject: Re: long long unsigned on 32-bit machines
Date: Sun, 26 Jan 2020 16:22:56 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1



On 26 Jan 2020 16.03, Bernd Zeimetz wrote:

On 1/26/20 3:44 PM, Kai Harrekilde-Petersen wrote:
My guess is that the problem lies in the bit-selection expresion: (1 << i).
The 1 is a signed int by default, so forcing i to be an uint64_t
promotes the result to be 64 bit as well, so testing for bit 31 works
correctly. If this is indeed the problem, use 1UL instead.
Good guess, I think that is the case here.

I guess using
((unsigned int) 1 << i)  would also fix this?

Yup, two syntaxes, same result.

Kai



reply via email to

[Prev in Thread] Current Thread [Next in Thread]