Skip to content
Snippets Groups Projects
Commit 7546e24c authored by Kia's avatar Kia
Browse files

print the byte index along with the character set

parent a921e688
Branches master
No related tags found
No related merge requests found
...@@ -28,7 +28,7 @@ struct charset * new_charset(void) { ...@@ -28,7 +28,7 @@ struct charset * new_charset(void) {
} }
void print_charset(struct charset *cs, int depth) { 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++) for (int i = 0; i<32; i++)
{ {
printf("%hhx ",cs->bitmap[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_ ...@@ -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); charset_set(cs, i, 1);
} }
printf("current byte index = %d ", current_byte_index); printf("current byte index = %d ", current_byte_index);
print_charset(cs, current_byte_index);
current_byte_index++; current_byte_index++;
print_charset(cs);
} }
else if (1 < bytes) { else if (1 < bytes) {
uint8_t low_head, hi_head; 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_ ...@@ -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; current_byte_index = starting_byte_index;
{ {
printf("current byte index = %d ", current_byte_index); printf("current byte index = %d ", current_byte_index);
HCFS_ADD_CHAR(low_head, current_byte_index);
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); gen_int_range(low & ((1 << (8 * (bytes - 1))) - 1), ((1 << (8*(bytes-1)))-1), bytes-1, current_byte_index);
} }
HCFS_END_SEQ(); HCFS_END_SEQ();
...@@ -137,14 +139,16 @@ void gen_int_range(uint64_t low, uint64_t high, uint8_t bytes, uint8_t starting_ ...@@ -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); charset_set(rest, i, 1);
} }
printf("current byte index = %d ", current_byte_index); printf("current byte index = %d ", current_byte_index);
HCFS_ADD_CHARSET(hd, current_byte_index);
current_byte_index++; current_byte_index++;
HCFS_ADD_CHARSET(hd);
for (int i = 2; i <= bytes; i++) { for (int i = 2; i <= bytes; i++) {
printf("current byte index = %d ", current_byte_index); printf("current byte index = %d ", current_byte_index);
HCFS_ADD_CHARSET(rest, current_byte_index);
current_byte_index++; current_byte_index++;
HCFS_ADD_CHARSET(rest);
} }
} }
HCFS_END_SEQ(); HCFS_END_SEQ();
...@@ -153,9 +157,10 @@ void gen_int_range(uint64_t low, uint64_t high, uint8_t bytes, uint8_t starting_ ...@@ -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; current_byte_index = starting_byte_index;
printf("current byte index = %d ", current_byte_index); printf("current byte index = %d ", current_byte_index);
HCFS_ADD_CHAR(hi_head, current_byte_index);
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); gen_int_range(0, high & ((1 << (8 * (bytes - 1))) - 1), bytes-1, current_byte_index);
} }
HCFS_END_SEQ(); HCFS_END_SEQ();
...@@ -171,9 +176,10 @@ void gen_int_range(uint64_t low, uint64_t high, uint8_t bytes, uint8_t starting_ ...@@ -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; current_byte_index = starting_byte_index;
printf("current byte index = %d ", current_byte_index); printf("current byte index = %d ", current_byte_index);
HCFS_ADD_CHAR(low_head, current_byte_index);
current_byte_index++; current_byte_index++;
HCFS_ADD_CHAR(low_head);
gen_int_range( gen_int_range(
low & ((1 << (8 * (bytes - 1))) - 1), low & ((1 << (8 * (bytes - 1))) - 1),
high & ((1 << (8 * (bytes - 1))) - 1), high & ((1 << (8 * (bytes - 1))) - 1),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment