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
106f4c4e
Commit
106f4c4e
authored
4 years ago
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add proper casts to silence VC warnings.
parent
f1523d24
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
10 deletions
+10
-10
mrbgems/mruby-sleep/src/mrb_sleep.c
mrbgems/mruby-sleep/src/mrb_sleep.c
+1
-1
mrbgems/mruby-string-ext/src/string.c
mrbgems/mruby-string-ext/src/string.c
+3
-3
src/fmt_fp.c
src/fmt_fp.c
+4
-4
src/hash.c
src/hash.c
+2
-2
No files found.
mrbgems/mruby-sleep/src/mrb_sleep.c
View file @
106f4c4e
...
...
@@ -30,7 +30,7 @@
#ifdef _WIN32
#include <windows.h>
#define sleep(x) Sleep(x * 1000)
#define usleep(x) Sleep((DWORD)((
x)<1000) ? 1 : ((x)/1000
))
#define usleep(x) Sleep((DWORD)((
(x)<1000) ? 1 : ((x)/1000)
))
#else
#include <unistd.h>
#include <sys/time.h>
...
...
This diff is collapsed.
Click to expand it.
mrbgems/mruby-string-ext/src/string.c
View file @
106f4c4e
...
...
@@ -335,7 +335,7 @@ tr_parse_pattern(mrb_state *mrb, struct tr_pattern *ret, const mrb_value v_patte
len
=
i
-
start_pos
;
if
(
len
>
UINT16_MAX
)
{
mrb_raise
(
mrb
,
E_ARGUMENT_ERROR
,
"tr pattern too long (max 6553
6
)"
);
mrb_raise
(
mrb
,
E_ARGUMENT_ERROR
,
"tr pattern too long (max 6553
5
)"
);
}
if
(
pat1
==
NULL
&&
ret
)
{
goto
nomem
;
...
...
@@ -343,9 +343,9 @@ tr_parse_pattern(mrb_state *mrb, struct tr_pattern *ret, const mrb_value v_patte
pat1
->
type
=
TR_IN_ORDER
;
pat1
->
flag_reverse
=
flag_reverse
;
pat1
->
flag_on_heap
=
!
ret_uninit
;
pat1
->
n
=
len
;
pat1
->
n
=
(
uint16_t
)
len
;
pat1
->
next
=
NULL
;
pat1
->
val
.
start_pos
=
start_pos
;
pat1
->
val
.
start_pos
=
(
uint16_t
)
start_pos
;
}
if
(
ret
==
NULL
||
ret_uninit
)
{
...
...
This diff is collapsed.
Click to expand it.
src/fmt_fp.c
View file @
106f4c4e
...
...
@@ -160,7 +160,7 @@ fmt_fp(struct fmt_args *f, long double y, ptrdiff_t w, ptrdiff_t p, uint32_t fl,
out
(
f
,
prefix
,
pl
);
out
(
f
,
ss
,
3
);
pad
(
f
,
' '
,
w
,
3
+
pl
,
fl
^
LEFT_ADJ
);
return
MAX
(
w
,
3
+
(
int
)
pl
);
return
(
int
)
MAX
(
w
,
3
+
pl
);
}
y
=
frexp
((
double
)
y
,
&
e2
)
*
2
;
...
...
@@ -215,7 +215,7 @@ fmt_fp(struct fmt_args *f, long double y, ptrdiff_t w, ptrdiff_t p, uint32_t fl,
pad
(
f
,
'0'
,
l
-
(
ebuf
-
estr
)
-
(
s
-
buf
),
0
,
0
);
out
(
f
,
estr
,
ebuf
-
estr
);
pad
(
f
,
' '
,
w
,
pl
+
l
,
fl
^
LEFT_ADJ
);
return
MAX
(
w
,
(
int
)
pl
+
(
int
)
l
);
return
(
int
)
MAX
(
w
,
pl
+
l
);
}
if
(
p
<
0
)
p
=
6
;
...
...
@@ -366,7 +366,7 @@ fmt_fp(struct fmt_args *f, long double y, ptrdiff_t w, ptrdiff_t p, uint32_t fl,
pad
(
f
,
' '
,
w
,
pl
+
l
,
fl
^
LEFT_ADJ
);
return
MAX
(
w
,
(
int
)
pl
+
(
int
)
l
);
return
(
int
)
MAX
(
w
,
pl
+
l
);
}
static
int
...
...
@@ -440,7 +440,7 @@ mrb_float_to_cstr(mrb_state *mrb, char *buf, size_t len, const char *fmt, mrb_fl
mrb_raise
(
mrb
,
E_ARGUMENT_ERROR
,
"invalid format string"
);
}
*
cstr
.
buf
=
'\0'
;
return
cstr
.
buf
-
buf
;
return
(
int
)
cstr
.
buf
-
buf
;
}
#else
/* MRB_DISABLE_STDIO || _WIN32 || _WIN64 */
#include <mruby.h>
...
...
This diff is collapsed.
Click to expand it.
src/hash.c
View file @
106f4c4e
...
...
@@ -365,7 +365,7 @@ ht_put(mrb_state *mrb, htable *t, mrb_value key, mrb_value val)
if
(
!
seg
->
next
&&
i
>=
t
->
last_len
)
{
seg
->
e
[
i
].
key
=
key
;
seg
->
e
[
i
].
val
=
val
;
t
->
last_len
=
i
+
1
;
t
->
last_len
=
(
uint16_t
)
i
+
1
;
t
->
size
++
;
return
;
}
...
...
@@ -407,7 +407,7 @@ ht_put(mrb_state *mrb, htable *t, mrb_value key, mrb_value val)
}
seg
->
e
[
i
].
key
=
key
;
seg
->
e
[
i
].
val
=
val
;
t
->
last_len
=
i
+
1
;
t
->
last_len
=
(
uint16_t
)
i
+
1
;
if
(
t
->
index
==
NULL
&&
t
->
size
>
MRB_HT_INIT_SIZE
*
4
)
{
ht_index
(
mrb
,
t
);
}
...
...
This diff is collapsed.
Click to expand it.
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