Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
5e55b61c
Unverified
Commit
5e55b61c
authored
Aug 11, 2020
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix `mrb_int` and `size_t` combination warnings.
parent
4695dfdc
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
35 additions
and
34 deletions
+35
-34
include/mruby/debug.h
include/mruby/debug.h
+1
-1
include/mruby/gc.h
include/mruby/gc.h
+1
-1
include/mruby/hash.h
include/mruby/hash.h
+1
-1
include/mruby/variable.h
include/mruby/variable.h
+1
-1
mrbgems/mruby-compiler/core/parse.y
mrbgems/mruby-compiler/core/parse.y
+2
-2
mrbgems/mruby-compiler/core/y.tab.c
mrbgems/mruby-compiler/core/y.tab.c
+2
-2
mrbgems/mruby-os-memsize/src/memsize.c
mrbgems/mruby-os-memsize/src/memsize.c
+13
-11
mrbgems/mruby-pack/src/pack.c
mrbgems/mruby-pack/src/pack.c
+4
-4
mrbgems/mruby-sleep/src/mrb_sleep.c
mrbgems/mruby-sleep/src/mrb_sleep.c
+1
-1
src/debug.c
src/debug.c
+1
-1
src/gc.c
src/gc.c
+2
-3
src/hash.c
src/hash.c
+3
-3
src/load.c
src/load.c
+1
-1
src/string.c
src/string.c
+1
-1
src/variable.c
src/variable.c
+1
-1
No files found.
include/mruby/debug.h
View file @
5e55b61c
...
...
@@ -52,7 +52,7 @@ MRB_API const char *mrb_debug_get_filename(mrb_state *mrb, mrb_irep *irep, ptrdi
* get line from irep's debug info and program counter
* @return returns -1 if not found
*/
MRB_API
int32_t
mrb_debug_get_line
(
mrb_state
*
mrb
,
mrb_irep
*
irep
,
ptrdiff
_t
pc
);
MRB_API
int32_t
mrb_debug_get_line
(
mrb_state
*
mrb
,
const
mrb_irep
*
irep
,
size
_t
pc
);
MRB_API
mrb_irep_debug_info
*
mrb_debug_info_alloc
(
mrb_state
*
mrb
,
mrb_irep
*
irep
);
MRB_API
mrb_irep_debug_info_file
*
mrb_debug_info_append_file
(
...
...
include/mruby/gc.h
View file @
5e55b61c
...
...
@@ -21,7 +21,7 @@ struct mrb_state;
#define MRB_EACH_OBJ_BREAK 1
typedef
int
(
mrb_each_object_callback
)(
struct
mrb_state
*
mrb
,
struct
RBasic
*
obj
,
void
*
data
);
void
mrb_objspace_each_objects
(
struct
mrb_state
*
mrb
,
mrb_each_object_callback
*
callback
,
void
*
data
);
mrb_in
t
mrb_objspace_page_slot_size
(
void
);
size_
t
mrb_objspace_page_slot_size
(
void
);
MRB_API
void
mrb_free_context
(
struct
mrb_state
*
mrb
,
struct
mrb_context
*
c
);
#ifndef MRB_GC_ARENA_SIZE
...
...
include/mruby/hash.h
View file @
5e55b61c
...
...
@@ -23,7 +23,7 @@ struct RHash {
#define mrb_hash_ptr(v) ((struct RHash*)(mrb_ptr(v)))
#define mrb_hash_value(p) mrb_obj_value((void*)(p))
mrb_in
t
mrb_os_memsize_of_hash_table
(
mrb_value
obj
);
size_
t
mrb_os_memsize_of_hash_table
(
mrb_value
obj
);
MRB_API
mrb_value
mrb_hash_new_capa
(
mrb_state
*
mrb
,
mrb_int
capa
);
MRB_API
mrb_value
mrb_ensure_hash_type
(
mrb_state
*
mrb
,
mrb_value
hash
);
MRB_API
mrb_value
mrb_check_hash_type
(
mrb_state
*
mrb
,
mrb_value
hash
);
...
...
include/mruby/variable.h
View file @
5e55b61c
...
...
@@ -35,7 +35,7 @@ mrb_value mrb_vm_cv_get(mrb_state*, mrb_sym);
void
mrb_vm_cv_set
(
mrb_state
*
,
mrb_sym
,
mrb_value
);
mrb_value
mrb_vm_const_get
(
mrb_state
*
,
mrb_sym
);
void
mrb_vm_const_set
(
mrb_state
*
,
mrb_sym
,
mrb_value
);
mrb_in
t
mrb_obj_iv_tbl_memsize
(
mrb_state
*
,
mrb_value
);
size_
t
mrb_obj_iv_tbl_memsize
(
mrb_state
*
,
mrb_value
);
MRB_API
mrb_value
mrb_const_get
(
mrb_state
*
,
mrb_value
,
mrb_sym
);
MRB_API
void
mrb_const_set
(
mrb_state
*
,
mrb_value
,
mrb_sym
,
mrb_value
);
MRB_API
mrb_bool
mrb_const_defined
(
mrb_state
*
,
mrb_value
,
mrb_sym
);
...
...
mrbgems/mruby-compiler/core/parse.y
View file @
5e55b61c
...
...
@@ -6380,7 +6380,7 @@ MRB_API void
mrb_parser_set_filename(struct mrb_parser_state *p, const char *f)
{
mrb_sym sym;
size
_t i;
uint16
_t i;
mrb_sym* new_table;
sym = mrb_intern_cstr(p->mrb, f);
...
...
@@ -6389,7 +6389,7 @@ mrb_parser_set_filename(struct mrb_parser_state *p, const char *f)
for (i = 0; i < p->filename_table_length; ++i) {
if (p->filename_table[i] == sym) {
p->current_filename_index =
(int)
i;
p->current_filename_index = i;
return;
}
}
...
...
mrbgems/mruby-compiler/core/y.tab.c
View file @
5e55b61c
...
...
@@ -12177,7 +12177,7 @@ MRB_API void
mrb_parser_set_filename
(
struct
mrb_parser_state
*
p
,
const
char
*
f
)
{
mrb_sym
sym
;
size
_t
i
;
uint16
_t
i
;
mrb_sym
*
new_table
;
sym
=
mrb_intern_cstr
(
p
->
mrb
,
f
);
...
...
@@ -12186,7 +12186,7 @@ mrb_parser_set_filename(struct mrb_parser_state *p, const char *f)
for
(
i
=
0
;
i
<
p
->
filename_table_length
;
++
i
)
{
if
(
p
->
filename_table
[
i
]
==
sym
)
{
p
->
current_filename_index
=
(
int
)
i
;
p
->
current_filename_index
=
i
;
return
;
}
}
...
...
mrbgems/mruby-os-memsize/src/memsize.c
View file @
5e55b61c
...
...
@@ -11,16 +11,18 @@
#include <mruby/value.h>
#include <mruby/range.h>
static
mrb_in
t
static
size_
t
os_memsize_of_ivars
(
mrb_state
*
mrb
,
mrb_value
obj
)
{
return
mrb_obj_iv_tbl_memsize
(
mrb
,
obj
);
}
static
mrb_in
t
static
size_
t
os_memsize_of_irep
(
mrb_state
*
state
,
const
struct
mrb_irep
*
irep
)
{
mrb_int
size
,
i
;
size_t
size
;
int
i
;
size
=
(
irep
->
slen
*
sizeof
(
mrb_sym
))
+
(
irep
->
plen
*
sizeof
(
mrb_code
))
+
(
irep
->
ilen
*
sizeof
(
mrb_code
));
...
...
@@ -31,10 +33,10 @@ os_memsize_of_irep(mrb_state* state, const struct mrb_irep *irep)
return
size
;
}
static
mrb_in
t
static
size_
t
os_memsize_of_method
(
mrb_state
*
mrb
,
mrb_value
method_obj
)
{
mrb_in
t
size
;
size_
t
size
;
mrb_value
proc_value
=
mrb_obj_iv_get
(
mrb
,
mrb_obj_ptr
(
method_obj
),
mrb_intern_lit
(
mrb
,
"_proc"
));
struct
RProc
*
proc
=
mrb_proc_ptr
(
proc_value
);
...
...
@@ -57,10 +59,10 @@ obj_is_kind_of_checked(mrb_state *mrb, mrb_value obj, const char *classname)
return
FALSE
;
}
static
mrb_in
t
static
size_
t
os_memsize_of_object
(
mrb_state
*
mrb
,
mrb_value
obj
)
{
mrb_in
t
size
=
0
;
size_
t
size
=
0
;
switch
(
mrb_type
(
obj
))
{
case
MRB_TT_STRING
:
...
...
@@ -178,17 +180,17 @@ os_memsize_of_object(mrb_state* mrb, mrb_value obj)
static
mrb_value
os_memsize_of
(
mrb_state
*
mrb
,
mrb_value
self
)
{
mrb_in
t
total
;
size_
t
total
;
mrb_value
obj
;
mrb_get_args
(
mrb
,
"o"
,
&
obj
);
total
=
os_memsize_of_object
(
mrb
,
obj
);
return
mrb_fixnum_value
(
total
);
return
mrb_fixnum_value
(
(
mrb_int
)
total
);
}
struct
os_memsize_of_all_cb_data
{
mrb_in
t
t
;
size_
t
t
;
struct
RClass
*
type
;
};
...
...
@@ -225,7 +227,7 @@ os_memsize_of_all(mrb_state *mrb, mrb_value self)
struct
os_memsize_of_all_cb_data
data
=
{
0
};
mrb_get_args
(
mrb
,
"|c"
,
&
data
.
type
);
mrb_objspace_each_objects
(
mrb
,
os_memsize_of_all_cb
,
&
data
);
return
mrb_fixnum_value
(
data
.
t
);
return
mrb_fixnum_value
(
(
mrb_int
)
data
.
t
);
}
void
...
...
mrbgems/mruby-pack/src/pack.c
View file @
5e55b61c
...
...
@@ -413,13 +413,13 @@ unpack_q(mrb_state *mrb, const unsigned char *src, int srclen, mrb_value ary, un
i64tostr
(
msg
,
sizeof
(
msg
),
sll
);
mrb_raisef
(
mrb
,
E_RANGE_ERROR
,
"cannot unpack to Fixnum: %s"
,
msg
);
}
n
=
sll
;
n
=
(
mrb_int
)
sll
;
}
else
{
if
(
!
POSFIXABLE
(
ull
))
{
u64tostr
(
msg
,
sizeof
(
msg
),
ull
);
mrb_raisef
(
mrb
,
E_RANGE_ERROR
,
"cannot unpack to Fixnum: %s"
,
msg
);
}
n
=
ull
;
n
=
(
mrb_int
)
ull
;
}
mrb_ary_push
(
mrb
,
ary
,
mrb_fixnum_value
(
n
));
return
8
;
...
...
@@ -828,7 +828,7 @@ unpack_h(mrb_state *mrb, const void *src, int slen, mrb_value ary, int count, un
}
}
dst
=
mrb_str_resize
(
mrb
,
dst
,
dptr
-
dptr0
);
dst
=
mrb_str_resize
(
mrb
,
dst
,
(
mrb_int
)(
dptr
-
dptr0
)
);
mrb_ary_push
(
mrb
,
ary
,
dst
);
return
(
int
)(
sptr
-
sptr0
);
}
...
...
@@ -951,7 +951,7 @@ unpack_m(mrb_state *mrb, const void *src, int slen, mrb_value ary, unsigned int
}
done:
dst
=
mrb_str_resize
(
mrb
,
dst
,
dptr
-
dptr0
);
dst
=
mrb_str_resize
(
mrb
,
dst
,
(
mrb_int
)(
dptr
-
dptr0
)
);
mrb_ary_push
(
mrb
,
ary
,
dst
);
return
(
int
)(
sptr
-
sptr0
);
}
...
...
mrbgems/mruby-sleep/src/mrb_sleep.c
View file @
5e55b61c
...
...
@@ -66,7 +66,7 @@ mrb_f_sleep(mrb_state *mrb, mrb_value self)
#endif
end
=
time
(
0
)
-
beg
;
return
mrb_fixnum_value
(
end
);
return
mrb_fixnum_value
(
(
mrb_int
)
end
);
}
/* mruby special; needed for mruby without float numbers */
...
...
src/debug.c
View file @
5e55b61c
...
...
@@ -64,7 +64,7 @@ mrb_debug_get_filename(mrb_state *mrb, mrb_irep *irep, ptrdiff_t pc)
}
MRB_API
int32_t
mrb_debug_get_line
(
mrb_state
*
mrb
,
mrb_irep
*
irep
,
ptrdiff
_t
pc
)
mrb_debug_get_line
(
mrb_state
*
mrb
,
const
mrb_irep
*
irep
,
size
_t
pc
)
{
if
(
irep
&&
pc
>=
0
&&
pc
<
irep
->
ilen
)
{
mrb_irep_debug_info_file
*
f
=
NULL
;
...
...
src/gc.c
View file @
5e55b61c
...
...
@@ -1601,11 +1601,10 @@ mrb_objspace_each_objects(mrb_state *mrb, mrb_each_object_callback *callback, vo
}
}
mrb_in
t
size_
t
mrb_objspace_page_slot_size
(
void
)
{
const
mrb_int
i
=
sizeof
(
RVALUE
);
return
i
;
return
sizeof
(
RVALUE
);
}
#ifdef GC_TEST
...
...
src/hash.c
View file @
5e55b61c
...
...
@@ -523,13 +523,13 @@ ht_foreach(mrb_state *mrb, htable *t, mrb_hash_foreach_func *func, void *p)
}
}
mrb_in
t
size_
t
mrb_os_memsize_of_hash_table
(
mrb_value
obj
)
{
struct
htable
*
h
=
mrb_hash_ptr
(
obj
)
->
ht
;
mrb_in
t
segkv_size
=
0
;
size_
t
segkv_size
=
0
;
if
(
h
->
index
)
segkv_size
=
(
sizeof
(
struct
segkv
)
*
h
->
index
->
capa
);
if
(
h
->
index
)
segkv_size
=
(
sizeof
(
struct
segkv
)
*
h
->
index
->
capa
);
return
sizeof
(
htable
)
+
sizeof
(
segindex
)
+
...
...
src/load.c
View file @
5e55b61c
...
...
@@ -54,7 +54,7 @@ str_to_double(mrb_state *mrb, const char *p, size_t len)
}
#endif
mrb_value
mrb_str_len_to_inum
(
mrb_state
*
mrb
,
const
char
*
str
,
mrb_in
t
len
,
mrb_int
base
,
int
badcheck
);
mrb_value
mrb_str_len_to_inum
(
mrb_state
*
mrb
,
const
char
*
str
,
size_
t
len
,
mrb_int
base
,
int
badcheck
);
static
void
tempirep_free
(
mrb_state
*
mrb
,
void
*
p
)
...
...
src/string.c
View file @
5e55b61c
...
...
@@ -2258,7 +2258,7 @@ mrb_str_split_m(mrb_state *mrb, mrb_value str)
}
mrb_value
mrb_str_len_to_inum
(
mrb_state
*
mrb
,
const
char
*
str
,
mrb_in
t
len
,
mrb_int
base
,
int
badcheck
)
mrb_str_len_to_inum
(
mrb_state
*
mrb
,
const
char
*
str
,
size_
t
len
,
mrb_int
base
,
int
badcheck
)
{
const
char
*
p
=
str
;
const
char
*
pend
=
str
+
len
;
...
...
src/variable.c
View file @
5e55b61c
...
...
@@ -1128,7 +1128,7 @@ mrb_class_find_path(mrb_state *mrb, struct RClass *c)
return
path
;
}
mrb_in
t
size_
t
mrb_obj_iv_tbl_memsize
(
mrb_state
*
mrb
,
mrb_value
obj
)
{
size_t
nseg
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment