Skip to content
Snippets Groups Projects
  • Max Horn's avatar
    e3960a0a
    switch receive code to ints instead of long · e3960a0a
    Max Horn authored
    This results in much smaller and more efficient machine code.
    
    It should not affect correctness, either: Indeed, the delay value
    is computed from dividing an int by another int, so it fits into an int.
    The delayTolerance is a fraction of that int, so it also fits.
    Intermediate results like delay * pro.zero.high are ints because they
    are equal to
     timings[0] * pro.zero.high / pro.syncFactor.low
    but syncfactor.low is always larger (at least in all current protocols)
    than any other high/low value.
    e3960a0a
    History
    switch receive code to ints instead of long
    Max Horn authored
    This results in much smaller and more efficient machine code.
    
    It should not affect correctness, either: Indeed, the delay value
    is computed from dividing an int by another int, so it fits into an int.
    The delayTolerance is a fraction of that int, so it also fits.
    Intermediate results like delay * pro.zero.high are ints because they
    are equal to
     timings[0] * pro.zero.high / pro.syncFactor.low
    but syncfactor.low is always larger (at least in all current protocols)
    than any other high/low value.