Changeset 3560 for trunk/oscam-simples.c
- Timestamp:
- 10/16/10 17:32:56 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/oscam-simples.c
r3422 r3560 684 684 if(value % 2 == 1) result[pos]='1'; 685 685 else result[pos]='0'; 686 value=value / 2;686 value=value / (SIDTABBITS)2; 687 687 pos++; 688 688 } … … 705 705 else result[pos]='0'; 706 706 value=value / 2; 707 pos++; 708 } 709 } 710 711 /* Converts a uint64 value to a char array in bitwise representation. 712 Note that the result array MUST be at least 65 bit large and that 713 this function assumes long values to hold only values up to 64bits and to be positive! 714 the result of e.g. long 7 is 11100000000000000000000000000000000000000000000000000000000000000 this means the array 715 is reversed */ 716 void uint642bitchar(uint64 value, char *result){ 717 int pos; 718 for (pos=0;pos<64;pos++) result[pos]='0'; 719 result[pos] = '\0'; 720 721 pos=0; 722 while (value > 0 && pos < 64){ 723 if(value % 2 == 1) result[pos]='1'; 724 else result[pos]='0'; 725 value=value / (uint64)2; 707 726 pos++; 708 727 }
Note:
See TracChangeset
for help on using the changeset viewer.