{ {SC_F, SC_0}, {SC_7, SC_8}, {SC_3, SC_C}, {SC_1, SC_E} }
};
-/* for converting to binary string */
+/** converting a digit to a binary string */
static const char *binary_table[16] = {
"0000", "0001", "0010", "0011", "0100", "0101", "0110", "0111",
"1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111"
}
else if (is_signed && !_bitisset(buffer[offset], bitoffset))
{
- /* this unsets the upper bits of the leftmost digit */
+ /* this clears the upper bits of the leftmost digit */
buffer[offset] = and_table[_val(buffer[offset])][_val(max_digit[bitoffset])];
for (counter = offset+1; counter < calc_buffer_size; counter++)
{
offset = offset % radius;
- /* rotation by multiples of the typelength is identity */
+ /* rotation by multiples of the type length is identity */
if (offset == 0) {
memmove(buffer, val1, calc_buffer_size);
return;
return calc_buffer_size;
}
-/* XXX doesn't check for overflows */
+/* FIXME doesn't check for overflows */
void sc_val_from_str(const char *str, unsigned int len, void *buffer)
{
const char *orig_str = str;
/*
* convert to a string
- * XXX Doesn't check buffer bounds
+ * FIXME: Doesn't check buffer bounds
*/
const char *sc_print(const void *value, unsigned bits, enum base_t base)
{
if (base == SC_DEC) {
/* check for negative values */
if (_bit(val, bits - 1)) {
- _negate(val, div2_res);
- sign = 1;
- p = div2_res;
+ _negate(val, div2_res);
+ sign = 1;
+ p = div2_res;
}
}
- /* transfer data into oscilating buffers */
+ /* transfer data into oscillating buffers */
memset(div1_res, SC_0, calc_buffer_size);
for (counter = 0; counter < nibbles; ++counter)
div1_res[counter] = p[counter];