File tree Expand file tree Collapse file tree
src/hal/drivers/mesa-hostmot2 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929#include "hostmot2.h"
3030#include "bitfile.h"
3131
32+ // Local definition of labs() because RTAI compile barfs on using labs(). It
33+ // could be optimized using compiler built-ins, but the single use in here is
34+ // not critical.
35+ static inline rtapi_s64 xlabs (rtapi_s64 x ) { return x < 0 ? - x : x ; }
3236
3337int getbits (hm2_sserial_remote_t * chan , rtapi_u64 * val , int start , int len ){
3438 //load the bits from the registers in to bit 0+ of *val
@@ -1550,7 +1554,7 @@ int hm2_sserial_register_tram(hostmot2_t *hm2, hm2_sserial_remote_t *chan){
15501554 case 64 :
15511555 shift = 0 ;
15521556 }
1553- if (labs ((p -> s64_param - p -> s64_written ) >> shift ) > 2 ) break ;
1557+ if (xlabs ((p -> s64_param - p -> s64_written ) >> shift ) > 2 ) break ;
15541558 * inst -> state2 = 2 ; // increment indices
15551559 return * inst -> state2 ;
15561560 default :
You can’t perform that action at this time.
0 commit comments