David Reiss | 9e7ba8c | 2010-10-05 16:39:27 +0000 | [diff] [blame] | 1 | #include "t_type.h" |
David Reiss | 41d3058 | 2010-10-05 16:39:29 +0000 | [diff] [blame] | 2 | #include "t_typedef.h" |
David Reiss | 9e7ba8c | 2010-10-05 16:39:27 +0000 | [diff] [blame] | 3 | |
| 4 | #include "md5.h" |
| 5 | |
| 6 | void t_type::generate_fingerprint() { |
| 7 | std::string material = get_fingerprint_material(); |
| 8 | md5_state_t ctx; |
| 9 | md5_init(&ctx); |
| 10 | md5_append(&ctx, (md5_byte_t*)(material.data()), (int)material.size()); |
| 11 | md5_finish(&ctx, (md5_byte_t*)fingerprint_); |
| 12 | } |
David Reiss | 41d3058 | 2010-10-05 16:39:29 +0000 | [diff] [blame] | 13 | |
| 14 | t_type* t_type::get_true_type() { |
| 15 | t_type* type = this; |
| 16 | while (type->is_typedef()) { |
| 17 | type = ((t_typedef*)type)->get_type(); |
| 18 | } |
| 19 | return type; |
| 20 | } |