Re: [dev] Re: [slstatus] temperature module acts wierd on OpenBSD

From: Aaron Marcher <me_AT_drkhsh.at>
Date: Mon, 30 Nov 2020 21:05:36 +0100

Hey,

is the problem still present with the commit i just pushed?
94b549a5ebe893bc727115ae845e51c4153f92e5
(Fix temperature reporting on OpenBSD)

Regards,
Aaron

On 20-06-16 Tue, Laslo Hunhold wrote:
>On Tue, 16 Jun 2020 20:53:34 +0200
>Mattias Andrée <maandree_AT_kth.se> wrote:
>
>Dear Mattias,
>
>> I'm assuming temp.value i an `int`, as %d is used. The problem was
>> probably that `1E6` is actually a `double` rather than an `int`,
>> as the whole expression is promoted to `double`, because `bprintf` is
>> (I assume) variadic, and the compiler does not know to change the
>> cast the expression back to `int` because only the type of the first
>> argument is specified in its declaration.
>
>ah yes, of course! Thanks for pointing that out. It's never a good idea
>to work with floats when you end up casting to int in a step inbetween
>or after. Let's go with the FreeBSD-approach seen below that code.
>
>With best regards
>
>Laslo
>

-- 
Web: https://drkhsh.at/ or http://drkhsh5rv6pnahas.onion/
Gopher: gopher://drkhsh.at or gopher://drkhsh5rv6pnahas.onion
GPG: 0x7A65E38D55BE96FE
Fingerprint: 4688 907C 8720 3318 0D9F AFDE 7A65 E38D 55BE 96FE
Received on Mon Nov 30 2020 - 21:05:36 CET

This archive was generated by hypermail 2.3.0 : Mon Nov 30 2020 - 21:12:08 CET