diff options
| author | Lothar Scholz <[email protected]> | 2017-12-23 01:10:43 +0100 |
|---|---|---|
| committer | Lothar Scholz <[email protected]> | 2017-12-23 01:10:43 +0100 |
| commit | 06f90a3b45fa4f241bbc43e91287aa9a127dc8c3 (patch) | |
| tree | 46ab4c39e6784ac4bb6efbe4af28bfd6653d5f8c /mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c | |
| parent | 100f0e6759be8e439e586acf01032d2b8b96c6bd (diff) | |
| download | mruby-06f90a3b45fa4f241bbc43e91287aa9a127dc8c3.tar.gz mruby-06f90a3b45fa4f241bbc43e91287aa9a127dc8c3.zip | |
Make source compilable with C++17
Changes applied:
- Removing "register" keyword
- Fixing const pointer to pointer assignments
- Adding type casts to rb_malloc calls
Diffstat (limited to 'mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c')
| -rw-r--r-- | mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c b/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c index 8aaa30bcd..62f7670e0 100644 --- a/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c +++ b/mrbgems/mruby-bin-debugger/tools/mrdb/apilist.c @@ -48,7 +48,7 @@ build_path(mrb_state *mrb, const char *dir, const char *base) len += strlen(dir) + sizeof("/") - 1; } - path = mrb_malloc(mrb, len); + path = (char*)mrb_malloc(mrb, len); memset(path, 0, len); if (strcmp(dir, ".")) { @@ -64,7 +64,8 @@ static char* dirname(mrb_state *mrb, const char *path) { size_t len; - char *p, *dir; + const char *p; + char *dir; if (path == NULL) { return NULL; @@ -73,7 +74,7 @@ dirname(mrb_state *mrb, const char *path) p = strrchr(path, '/'); len = p != NULL ? (size_t)(p - path) : strlen(path); - dir = mrb_malloc(mrb, len + 1); + dir = (char*)mrb_malloc(mrb, len + 1); strncpy(dir, path, len); dir[len] = '\0'; @@ -85,7 +86,7 @@ source_file_new(mrb_state *mrb, mrb_debug_context *dbg, char *filename) { source_file *file = NULL; - file = mrb_malloc(mrb, sizeof(source_file)); + file = (source_file*)mrb_malloc(mrb, sizeof(source_file)); memset(file, '\0', sizeof(source_file)); file->fp = fopen(filename, "rb"); @@ -96,7 +97,7 @@ source_file_new(mrb_state *mrb, mrb_debug_context *dbg, char *filename) } file->lineno = 1; - file->path = mrb_malloc(mrb, strlen(filename) + 1); + file->path = (char*)mrb_malloc(mrb, strlen(filename) + 1); strcpy(file->path, filename); return file; } |
