wovo / hwlib

C++ OO micro-controller library for close-to-the-hardware programming
Boost Software License 1.0
57 stars 26 forks source link

Meaningless abs function in line draw #3

Closed ManDeJan closed 7 years ago

ManDeJan commented 7 years ago

link to code

static uint_fast16_t abs( uint_fast16_t x ){
      return x >= 0 ? x : -x;
}

the above function is written in the line class, however, it is meaningless as unsigned integers are always an absolute value.

wovo commented 7 years ago

I should have payed attention to this one, it took me some time to figure out why lines were drawn erratically. Corrected now (there were some more places where signed ints should be used insstead of unsigned).