joeycastillo / Sensor-Watch

A board replacement for the classic Casio F-91W wristwatch
Other
1.02k stars 210 forks source link

revert pointer nonsense, stick with array indexing #364

Closed theAlexes closed 3 months ago

theAlexes commented 5 months ago

the const qualifier on this is misplaced, so let's just go back to what we know works.

theAlexes commented 5 months ago

kinda torn on this change, actually, because at first glance, the array indexing generates slightly worse code.

taking off the const qualifier on the pointer version provokes warnings about discarding the qualifier, and generates the same code as with const — probably it doesn't generate a read-only variable because it isn't in global scope, it's on the stack of app_loop.

so i think we can abandon this change for now, unless the pointer code actually causes issues with the index changing in the face code. (though isn't that guarded by a watch_face_changed flag in the movement state?)