Hi,
On 2023/5/23 16:50, David Laight wrote:
From: 15330273...@189.cn <15330273...@189.cn>
Sent: 23 May 2023 05:27
On 2023/5/22 19:29, Jani Nikula wrote:
In general, do not use unsigned types in arithmethic to avoid negative
values, because most people will be tripped over by integer promotion
From: 15330273...@189.cn <15330273...@189.cn>
> Sent: 23 May 2023 05:27
>
> On 2023/5/22 19:29, Jani Nikula wrote:
> > In general, do not use unsigned types in arithmethic to avoid negative
> > values, because most people will be tripped over by integer promotion
> > rules, and you'll get negative
Hi,
On 2023/5/23 12:26, Sui Jingfeng wrote:
Hi,
On 2023/5/22 19:29, Jani Nikula wrote:
In general, do not use unsigned types in arithmethic to avoid negative
values, because most people will be tripped over by integer promotion
rules, and you'll get negative values anyway.
Here I'm sure abo
Hi,
On 2023/5/22 19:29, Jani Nikula wrote:
In general, do not use unsigned types in arithmethic to avoid negative
values, because most people will be tripped over by integer promotion
rules, and you'll get negative values anyway.
Here I'm sure about this,
but there are plenty unsigned types
Hi,
On 2023/5/22 23:01, Jani Nikula wrote:
On Mon, 22 May 2023, Sui Jingfeng <15330273...@189.cn> wrote:
Hi,
On 2023/5/22 20:13, Jani Nikula wrote:
On Mon, 22 May 2023, Sui Jingfeng <15330273...@189.cn> wrote:
Hi,
On 2023/5/22 19:29, Jani Nikula wrote:
On Thu, 18 May 2023, Sui Jingfeng <15
On Mon, 22 May 2023, Sui Jingfeng <15330273...@189.cn> wrote:
> Hi,
>
> On 2023/5/22 20:13, Jani Nikula wrote:
>> On Mon, 22 May 2023, Sui Jingfeng <15330273...@189.cn> wrote:
>>> Hi,
>>>
>>> On 2023/5/22 19:29, Jani Nikula wrote:
On Thu, 18 May 2023, Sui Jingfeng <15330273...@189.cn> wrote:
>
Hi,
On 2023/5/22 20:13, Jani Nikula wrote:
On Mon, 22 May 2023, Sui Jingfeng <15330273...@189.cn> wrote:
Hi,
On 2023/5/22 19:29, Jani Nikula wrote:
On Thu, 18 May 2023, Sui Jingfeng <15330273...@189.cn> wrote:
On 2023/5/17 18:59, David Laight wrote:
From: 15330273...@189.cn
Sent: 16 May 20
On Mon, 22 May 2023, Sui Jingfeng <15330273...@189.cn> wrote:
> Hi,
>
> On 2023/5/22 19:29, Jani Nikula wrote:
>> On Thu, 18 May 2023, Sui Jingfeng <15330273...@189.cn> wrote:
>>> On 2023/5/17 18:59, David Laight wrote:
From: 15330273...@189.cn
> Sent: 16 May 2023 18:30
>
> From: S
From: 15330273...@189.cn <15330273...@189.cn>
> Sent: 22 May 2023 12:56
...
> > I'll bet most people will be surprised to see what this prints:
> >
> > #include
> > #include
> >
> > int main(void)
> > {
> > uint16_t x = 0x;
> > uint16_t y = 0x;
> > uint64_t z = x * y;
> >
> >
Hi,
On 2023/5/22 19:29, Jani Nikula wrote:
On Thu, 18 May 2023, Sui Jingfeng <15330273...@189.cn> wrote:
On 2023/5/17 18:59, David Laight wrote:
From: 15330273...@189.cn
Sent: 16 May 2023 18:30
From: Sui Jingfeng
Both mode->crtc_htotal and mode->crtc_vtotal are u16 type,
mode->crtc_htotal
On Thu, 18 May 2023, Sui Jingfeng <15330273...@189.cn> wrote:
> On 2023/5/17 18:59, David Laight wrote:
>> From: 15330273...@189.cn
>>> Sent: 16 May 2023 18:30
>>>
>>> From: Sui Jingfeng
>>>
>>> Both mode->crtc_htotal and mode->crtc_vtotal are u16 type,
>>> mode->crtc_htotal * mode->crtc_vtotal wi
On 2023/5/17 18:59, David Laight wrote:
From: 15330273...@189.cn
Sent: 16 May 2023 18:30
From: Sui Jingfeng
Both mode->crtc_htotal and mode->crtc_vtotal are u16 type,
mode->crtc_htotal * mode->crtc_vtotal will results a unsigned type.
Nope, u16 gets promoted to 'signed int' and the result
From: 15330273...@189.cn
> Sent: 16 May 2023 18:30
>
> From: Sui Jingfeng
>
> Both mode->crtc_htotal and mode->crtc_vtotal are u16 type,
> mode->crtc_htotal * mode->crtc_vtotal will results a unsigned type.
Nope, u16 gets promoted to 'signed int' and the result of the
multiply is also signed.
From: Sui Jingfeng
Both mode->crtc_htotal and mode->crtc_vtotal are u16 type,
mode->crtc_htotal * mode->crtc_vtotal will results a unsigned type.
Using a u32 is enough to store the result, but considering that the
result will be casted to u64 soon after. We use a u64 type directly.
So there no ne
Hi,
On 2023/5/17 01:06, Thomas Zimmermann wrote:
Am 16.05.23 um 18:59 schrieb Sui Jingfeng:
Both mode->crtc_htotal and mode->crtc_vtotal are u16 type,
mode->crtc_htotal * mode->crtc_vtotal will results a unsigned type.
Using a u32 is enough to store the result, but considering that the
result
Am 16.05.23 um 18:59 schrieb Sui Jingfeng:
Both mode->crtc_htotal and mode->crtc_vtotal are u16 type,
mode->crtc_htotal * mode->crtc_vtotal will results a unsigned type.
Using a u32 is enough to store the result, but considering that the
result will be casted to u64 soon after. We use a u64 typ
16 matches
Mail list logo