SimpleMobileTools / Simple-Clock

Combination of a beautiful clock with widget, alarm, stopwatch & timer, no ads
https://www.simplemobiletools.com
GNU General Public License v3.0
588 stars 237 forks source link

fix bit set check #496

Closed fatihergin closed 1 year ago

fatihergin commented 1 year ago

addresses https://github.com/SimpleMobileTools/Simple-Clock/issues/485

tibbi commented 1 year ago

what does this fix?

fatihergin commented 1 year ago

what does this fix?

bits have been used to store enabled days for an alarm.

sth like:

0b0000001 -> Monday 
0b0000010 -> Tuesday  
0b0000100 -> Wednesday
0b0001000 -> Thursday 
0b0010000 -> Friday 
0b0100000 -> Saturday
0b1000000 -> Sunday

e.g. if the alarm is enabled for Monday and Wednesday, the stored value for the days of the alarm will be 0b0000001 || 0b0000100 = 0b0000101 and there is an extension Int.isBitSet to check whether the n. bit of a number is set or not. this extension doesn't work as expected, fixing it resolves https://github.com/SimpleMobileTools/Simple-Clock/issues/485

stackoverflow

tibbi commented 1 year ago

alright thanks

tibbi commented 1 year ago

use comments like "fix #485" instead of addresses please, that way if I accept a PR, the issue is closed automatically