Skip to content
Snippets Groups Projects
Commit 89f12cc2 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Use more appropriate typed-integer ini file get/set functions

I noticed when setting a security level's lines per message value > 32767
in SCFG->System->Security Level Values, the value would be read back as 1 or
or some other crazy value. That was because we were writing this value
(and all the security level 16-bit values) using iniSetShortInt(). These are
*unsigned* 16-bit values, so that we should have been using iniSetUShortInt().
We'll just use iniSetUInteger() instead to fix that/those issues.

And since promotion/conversion from uint16_t or uint32_t to uint has no impact
when creating a decimal representation of a number, just use iniSetUInteger()
everywhere we're setting unsigned integer settings in the main config .ini
files. If/when these fields are made larger in the future, this code will just
work.

When reading .ini integers, use the more appropriate iniGet[U]Int16 functions
instead of iniGet[U]Short and use iniGetUInteger for reading enums or any
values that are immediately typecast to a uchar/uint8_t.

Replaced some other use of [u]short that I found when searching with stdint.h
types.
parent 84527be0
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #4073 passed
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment