Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main - Matching case for case-sensitive keys #1322

Merged
merged 5 commits into from
Dec 18, 2024

Conversation

JonBons
Copy link
Contributor

@JonBons JonBons commented Apr 6, 2024

Fixes 152 referring to lowercase variants of hashmap keys

Still need to look into what to do to resolve the some of the issues brought up here: #1320 (comment)

@jonpas jonpas added this to the 2.13.0 milestone Apr 6, 2024
@JonBons
Copy link
Contributor Author

JonBons commented Apr 6, 2024

Need to change use of setVar and make sure this works correctly
https://github.com/IDI-Systems/acre2/blob/master/addons/sys_data/XEH_preInit.sqf#L40-L105

@JonBons
Copy link
Contributor Author

JonBons commented Apr 8, 2024

List of hashmap key constants based on a case-sensitive deduplicated grep of the codebase (this does not include any keys from vars/macros or at runtime, will make an attempt to get this data later)

Used for HASH_SET:

1
acre_radioConnectionData
acre_radioState
active
allowed
anotherKey
audioPath
band
ch
channelKnobPosition
channelMode
channelNumber
channels
channelSpacing
channelSpacingKnobPosition
CTCSS
CTCSSRx
CTCSSTx
currentChannel
currentEditEntry
currentGroup
currentPreset
currentState
currentView
description
deviation
disabled
editEntry
encryption
entryCursor
fade
frequencies
frequencyRX
frequencyTX
function
functionKnobPosition
groups
isRadioRemovable
key
key1
kHzKnobPosition
label
lastActiveChannel
mainKnobPosition
manualChannelSelection
MemorySlotKnobPosition
menuIndex
menuPage
MHzKnobPosition
mode
modefunction
modulation
mountedRadio
name
networkID
NetworkKnobPosition
okRadios
on
optionCode
pgm_pa_mode
phase
playerRadios
power
powerSource
pressedButton
programmingStep
radioOn
RPTR
rxOnly
selectedEntry
shortName
squelch
syncLength
TEK
trafficRate
type
vehicle
volume
volumeKnobPosition
volumeModifier
wiredIntercoms

Used for HASH_GET:

ACRE_INTERNAL_RADIOSPATIALIZATION
acre_radioConnectionData
acre_radioState
active
audioPath
band
channelKnobPosition
channelMode
channels
CTCSS
CTCSSRx
CTCSSTx
currentChannel
description
deviation
encryption
fade
frequencies
frequencyRX
frequencyTX
groups
key
key1
kHzKnobPosition
label
manualChannelSelection
MHzKnobPosition
mode
modefunction
modulation
name
networkID
okRadios
on
optChannelData
optChannelId
optionCode
phase
playerRadios
power
powerSource
radioOn
RPTR
rxOnly
squelch
syncLength
TEK
trafficRate
volume
volumeModifier

@JonBons JonBons changed the title (WIP) Main - Case sensitivity fixes for native HashMap Main - Matching case for case-sensitive keys Jul 24, 2024
@JonBons
Copy link
Contributor Author

JonBons commented Jul 24, 2024

I'm shifting this into just being changes for mismatched case between getter/setter, I think this is most or all of the differences resolved.

It should be good to go with no dependencies on any other branch or commit.

@PabstMirror
Copy link
Collaborator

HEMTT 1.13 can now "optimize" away toLower and toUpper on string literals

so #define HASH_GET(hash, key) (hash get toLower key)
will have no runtime cost for many but not all uses

HASH_GET(_channel,"frequencyTX") // free - done at buildtime
HASH_GET(GVAR(callBacks),_id) // not free

@jonpas jonpas merged commit ad359bd into IDI-Systems:master Dec 18, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants