summaryrefslogtreecommitdiffhomepage
path: root/src/load.c
diff options
context:
space:
mode:
authorMasaki Muranaka <[email protected]>2013-03-29 16:26:00 +0900
committerMasaki Muranaka <[email protected]>2013-03-29 16:26:00 +0900
commit2b6e9ee556fabebf732ba24fe1de2250b6a6dda2 (patch)
tree70a0fad38f259f4e5317fd9ab7b47e126b0ff637 /src/load.c
parentc67aec25b6aeb4191b695a197eb3835b83d81886 (diff)
downloadmruby-2b6e9ee556fabebf732ba24fe1de2250b6a6dda2.tar.gz
mruby-2b6e9ee556fabebf732ba24fe1de2250b6a6dda2.zip
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.
Diffstat (limited to 'src/load.c')
-rw-r--r--src/load.c4
1 files changed, 2 insertions, 2 deletions
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