diff --git a/gen_intrange.c b/gen_intrange.c index ae82fded3f65bb7035fb0857d43ef6e40a5aea4f..01e8cc49ca288837e6add8d462a468ad1d4e5226 100644 --- a/gen_intrange.c +++ b/gen_intrange.c @@ -28,7 +28,7 @@ struct charset * new_charset(void) { } void print_charset(struct charset *cs, int depth) { - printf("current byte index = %d ", depth); + printf("current byte index = %d \n", depth); for (int i = 0; i<32; i++) { printf("%hhx ",cs->bitmap[i]); @@ -103,8 +103,9 @@ void gen_int_range(uint64_t low, uint64_t high, uint8_t bytes, uint8_t starting_ charset_set(cs, i, 1); } printf("current byte index = %d ", current_byte_index); + print_charset(cs, current_byte_index); current_byte_index++; - print_charset(cs); + } else if (1 < bytes) { uint8_t low_head, hi_head; @@ -119,9 +120,10 @@ void gen_int_range(uint64_t low, uint64_t high, uint8_t bytes, uint8_t starting_ current_byte_index = starting_byte_index; { printf("current byte index = %d ", current_byte_index); + + HCFS_ADD_CHAR(low_head, current_byte_index); current_byte_index++; - HCFS_ADD_CHAR(low_head); gen_int_range(low & ((1 << (8 * (bytes - 1))) - 1), ((1 << (8*(bytes-1)))-1), bytes-1, current_byte_index); } HCFS_END_SEQ(); @@ -137,14 +139,16 @@ void gen_int_range(uint64_t low, uint64_t high, uint8_t bytes, uint8_t starting_ charset_set(rest, i, 1); } printf("current byte index = %d ", current_byte_index); + + HCFS_ADD_CHARSET(hd, current_byte_index); current_byte_index++; - HCFS_ADD_CHARSET(hd); for (int i = 2; i <= bytes; i++) { printf("current byte index = %d ", current_byte_index); + + HCFS_ADD_CHARSET(rest, current_byte_index); current_byte_index++; - HCFS_ADD_CHARSET(rest); } } HCFS_END_SEQ(); @@ -153,9 +157,10 @@ void gen_int_range(uint64_t low, uint64_t high, uint8_t bytes, uint8_t starting_ { current_byte_index = starting_byte_index; printf("current byte index = %d ", current_byte_index); + + HCFS_ADD_CHAR(hi_head, current_byte_index); current_byte_index++; - HCFS_ADD_CHAR(hi_head); gen_int_range(0, high & ((1 << (8 * (bytes - 1))) - 1), bytes-1, current_byte_index); } HCFS_END_SEQ(); @@ -171,9 +176,10 @@ void gen_int_range(uint64_t low, uint64_t high, uint8_t bytes, uint8_t starting_ current_byte_index = starting_byte_index; printf("current byte index = %d ", current_byte_index); + + HCFS_ADD_CHAR(low_head, current_byte_index); current_byte_index++; - HCFS_ADD_CHAR(low_head); gen_int_range( low & ((1 << (8 * (bytes - 1))) - 1), high & ((1 << (8 * (bytes - 1))) - 1),