zauberzeug / lizard

Domain-specific language to specify behaviour of microcontroller managed hardware
MIT License
15 stars 5 forks source link

Buffer comparison cast fix #89

Closed JensOgorek closed 2 weeks ago

JensOgorek commented 3 weeks ago

This is a fix for #86. Size_t is unsigned and pos can be negative. After the change, I could not reproduce the problem.

Also, I increased the size of the patter queue to 100, like in the main queue with uart 0. I ran into a full queue multiple times. W (3232) uart: Fail to enqueue pattern position, pattern queue is full.

JensOgorek commented 3 weeks ago

The main issue is the comparison of int with size_t, when the int is negative. But it would be good practice not to mix unsigned and signed without casting

JensOgorek commented 2 weeks ago

Right now, yes. But maybe we should have an eye open for this and change it sometime in the future.