From 2b6e9ee556fabebf732ba24fe1de2250b6a6dda2 Mon Sep 17 00:00:00 2001 From: Masaki Muranaka Date: Fri, 29 Mar 2013 16:26:00 +0900 Subject: Modify the type of line-number to uint16_t. Type short is not portable. And it cannot be more than UINT16_MAX because of the mrbc binary format. --- src/load.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/load.c') diff --git a/src/load.c b/src/load.c index c58dde4ce..66182e10f 100644 --- a/src/load.c +++ b/src/load.c @@ -226,7 +226,7 @@ read_rite_lineno_record(mrb_state *mrb, const uint8_t *bin, size_t irepno, uint3 int ret; size_t i, fname_len, niseq; char *fname; - short *lines; + uint16_t *lines; ret = MRB_DUMP_OK; *len = 0; @@ -249,7 +249,7 @@ read_rite_lineno_record(mrb_state *mrb, const uint8_t *bin, size_t irepno, uint3 bin += sizeof(uint32_t); // niseq *len += sizeof(uint32_t); - lines = (short *)mrb_malloc(mrb, niseq * sizeof(short)); + lines = (uint16_t *)mrb_malloc(mrb, niseq * sizeof(uint16_t)); for (i = 0; i < niseq; i++) { lines[i] = bin_to_uint16(bin); bin += sizeof(uint16_t); // niseq -- cgit v1.2.3