| 799 | } |
| 800 | |
| 801 | char* RCSwitch::dec2binWcharfill(unsigned long Dec, unsigned int bitLength, char fill){ |
| 802 | static char bin[64]; |
| 803 | unsigned int i=0; |
| 804 | |
| 805 | while (Dec > 0) { |
| 806 | bin[32+i++] = ((Dec & 1) > 0) ? '1' : fill; |
| 807 | Dec = Dec >> 1; |
| 808 | } |
| 809 | |
| 810 | for (unsigned int j = 0; j< bitLength; j++) { |
| 811 | if (j >= bitLength - i) { |
| 812 | bin[j] = bin[ 31 + i - (j - (bitLength - i)) ]; |
| 813 | }else { |
| 814 | bin[j] = fill; |
| 815 | } |
| 816 | } |
| 817 | bin[bitLength] = '\0'; |
| 818 | |
| 819 | return bin; |
| 820 | } |
| 821 | |
| 822 | |
| 823 |
nothing calls this directly
no outgoing calls
no test coverage detected