summaryrefslogtreecommitdiffhomepage
path: root/src/debug.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2021-07-09 14:10:48 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2021-07-09 14:10:48 +0900
commitb5039fdb6c746cc77d0b3a499c0cf0baacc4f815 (patch)
treef423ca1151b54d7faa0de4b7e1b44198999d17ba /src/debug.c
parent29556a49a0419ba60721efe2b0fa2c9ecff863f7 (diff)
downloadmruby-b5039fdb6c746cc77d0b3a499c0cf0baacc4f815.tar.gz
mruby-b5039fdb6c746cc77d0b3a499c0cf0baacc4f815.zip
debug.h: use `uint8_t` instead of `char` for BER compressed binary.
Diffstat (limited to 'src/debug.c')
-rw-r--r--src/debug.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/debug.c b/src/debug.c
index f41140edf..96c58ed8d 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -48,7 +48,7 @@ packed_int_len(uint32_t num)
}
static size_t
-packed_int_encode(uint32_t num, char *p, char *pend)
+packed_int_encode(uint32_t num, uint8_t *p, uint8_t *pend)
{
size_t llen = 0;
@@ -64,7 +64,7 @@ packed_int_encode(uint32_t num, char *p, char *pend)
}
static uint32_t
-packed_int_decode(char *p, char **newpos)
+packed_int_decode(uint8_t *p, uint8_t **newpos)
{
size_t i = 0, shift = 0;
uint32_t n = 0;
@@ -158,8 +158,8 @@ mrb_debug_get_line(mrb_state *mrb, const mrb_irep *irep, uint32_t pc)
}
case mrb_debug_line_packed_map: {
- char *p = f->lines.packed_map;
- char *pend = p + f->line_entry_count;
+ uint8_t *p = f->lines.packed_map;
+ uint8_t *pend = p + f->line_entry_count;
uint32_t pos = 0, line = 0, line_diff;
while (p < pend) {
pos += packed_int_decode(p, &p);
@@ -265,7 +265,7 @@ mrb_debug_info_append_file(mrb_state *mrb, mrb_irep_debug_info *d,
uint32_t prev_line = 0;
uint32_t prev_pc = 0;
size_t packed_size = 0;
- char *p, *pend;
+ uint8_t *p, *pend;
for (i = 0; i < file_pc_count; ++i) {
if (lines[start_pos + i] == prev_line) { continue; }
@@ -275,7 +275,7 @@ mrb_debug_info_append_file(mrb_state *mrb, mrb_irep_debug_info *d,
packed_size += packed_int_len(lines[start_pos+i]-prev_line);
prev_line = lines[start_pos + i];
}
- p = f->lines.packed_map = (char*)mrb_malloc(mrb, packed_size);
+ p = f->lines.packed_map = (uint8_t*)mrb_malloc(mrb, packed_size);
pend = p + packed_size;
prev_line = 0; prev_pc = 0;
for (i = 0; i < file_pc_count; ++i) {