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
4fa3359d
Commit
4fa3359d
authored
Dec 15, 2020
by
John Bampton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: remove trailing whitespace from C, Header, Ruby and YAML files
Lint
parent
e9fe337b
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
30 additions
and
30 deletions
+30
-30
.github/workflows/codeql-analysis.yml
.github/workflows/codeql-analysis.yml
+1
-1
build_config/dreamcast_shelf.rb
build_config/dreamcast_shelf.rb
+5
-5
include/mruby/array.h
include/mruby/array.h
+1
-1
include/mruby/compile.h
include/mruby/compile.h
+2
-2
include/mruby/string.h
include/mruby/string.h
+1
-1
mrbgems/mruby-compiler/core/codegen.c
mrbgems/mruby-compiler/core/codegen.c
+1
-1
mrbgems/mruby-enumerator/test/enumerator.rb
mrbgems/mruby-enumerator/test/enumerator.rb
+1
-1
mrbgems/mruby-io/src/file.c
mrbgems/mruby-io/src/file.c
+5
-5
mrbgems/mruby-range-ext/mrblib/range.rb
mrbgems/mruby-range-ext/mrblib/range.rb
+1
-1
mrbgems/mruby-range-ext/test/range.rb
mrbgems/mruby-range-ext/test/range.rb
+1
-1
mrbgems/mruby-rational/src/rational.c
mrbgems/mruby-rational/src/rational.c
+2
-2
mrbgems/mruby-test/vformat.c
mrbgems/mruby-test/vformat.c
+2
-2
mrblib/array.rb
mrblib/array.rb
+1
-1
src/class.c
src/class.c
+1
-1
src/dump.c
src/dump.c
+2
-2
src/numeric.c
src/numeric.c
+1
-1
test/t/integer.rb
test/t/integer.rb
+1
-1
test/t/range.rb
test/t/range.rb
+1
-1
No files found.
.github/workflows/codeql-analysis.yml
View file @
4fa3359d
...
...
@@ -23,7 +23,7 @@ jobs:
# the head of the pull request instead of the merge commit.
-
run
:
git checkout HEAD^2
if
:
${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
-
name
:
Initialize CodeQL
uses
:
github/codeql-action/init@v1
...
...
build_config/dreamcast_shelf.rb
View file @
4fa3359d
...
...
@@ -11,7 +11,7 @@ MRuby::CrossBuild.new("dreamcast") do |conf|
# To compile mruby with DreamSDK, RubyInstaller for Windows should be installed
DREAMSDK_HOME
=
ENV
[
"DREAMSDK_HOME"
]
MSYS_ROOT
=
!
(
DREAMSDK_HOME
.
nil?
||
DREAMSDK_HOME
.
empty?
)
?
"
#{
DREAMSDK_HOME
}
/msys/1.0"
:
""
# Setting paths
DREAMCAST_PATH
=
"
#{
MSYS_ROOT
}
/opt/toolchains/dc"
KOS_PATH
=
"
#{
DREAMCAST_PATH
}
/kos"
...
...
@@ -37,16 +37,16 @@ MRuby::CrossBuild.new("dreamcast") do |conf|
cxx
.
defines
=
conf
.
cc
.
defines
.
dup
cxx
.
compile_options
=
conf
.
cc
.
compile_options
.
dup
end
# Linker
# There is an issue when making the mruby library with KallistiOS:
# 'newlib_kill.o' and 'newlib_getpid.o' aren't found so they are explicitly
# 'newlib_kill.o' and 'newlib_getpid.o' aren't found so they are explicitly
# specified here at least for now.
conf
.
linker
do
|
linker
|
linker
.
command
=
"
#{
BIN_PATH
}
/sh-elf-gcc"
linker
.
flags
<<
[
"
#{
MSYS_ROOT
}
/opt/toolchains/dc/kos/kernel/build/newlib_kill.o"
,
"
#{
MSYS_ROOT
}
/opt/toolchains/dc/kos/kernel/build/newlib_getpid.o"
,
"-Wl,--start-group -lkallisti -lc -lgcc -Wl,--end-group"
]
linker
.
library_paths
<<
[
"
#{
KOS_PATH
}
/lib/dreamcast"
,
"
#{
KOS_PATH
}
/addons/lib/dreamcast"
,
"
#{
KOS_PATH
}
/../kos-ports/lib"
]
end
end
# Archiver
conf
.
archiver
do
|
archiver
|
...
...
@@ -62,7 +62,7 @@ MRuby::CrossBuild.new("dreamcast") do |conf|
# Disable C++ exception
conf
.
disable_cxx_exception
# Gems from core
# removing mruby-io
conf
.
gem
:core
=>
"mruby-metaprog"
...
...
include/mruby/array.h
View file @
4fa3359d
...
...
@@ -64,7 +64,7 @@ struct RArray {
#define ARY_SET_EMBED_LEN(a,len) ((a)->flags = ((a)->flags&~MRB_ARY_EMBED_MASK) | ((uint32_t)(len) + 1))
#define ARY_EMBED_PTR(a) ((a)->as.ary)
#endif
#define ARY_LEN(a) (ARY_EMBED_P(a)?ARY_EMBED_LEN(a):(a)->as.heap.len)
#define ARY_PTR(a) (ARY_EMBED_P(a)?ARY_EMBED_PTR(a):(a)->as.heap.ptr)
#define RARRAY_LEN(a) ARY_LEN(RARRAY(a))
...
...
include/mruby/compile.h
View file @
4fa3359d
...
...
@@ -182,8 +182,8 @@ MRB_API struct mrb_parser_state* mrb_parse_nstring(mrb_state*,const char*,size_t
MRB_API
struct
RProc
*
mrb_generate_code
(
mrb_state
*
,
struct
mrb_parser_state
*
);
MRB_API
mrb_value
mrb_load_exec
(
mrb_state
*
mrb
,
struct
mrb_parser_state
*
p
,
mrbc_context
*
c
);
/** program load functions
* Please note! Currently due to interactions with the GC calling these functions will
/** program load functions
* Please note! Currently due to interactions with the GC calling these functions will
* leak one RProc object per function call.
* To prevent this save the current memory arena before calling and restore the arena
* right after, like so
...
...
include/mruby/string.h
View file @
4fa3359d
...
...
@@ -159,7 +159,7 @@ MRB_API mrb_int mrb_str_index(mrb_state *mrb, mrb_value str, const char *p, mrb_
*
* mrb_close(mrb);
* return 0;
* }
* }
*
* Result:
*
...
...
mrbgems/mruby-compiler/core/codegen.c
View file @
4fa3359d
...
...
@@ -2498,7 +2498,7 @@ codegen(codegen_scope *s, node *tree, int val)
else
{
if
(
i
<
0
)
{
if
(
i
==
-
1
)
genop_1
(
s
,
OP_LOADI__1
,
cursp
());
else
if
(
i
>=
-
0xff
)
genop_2
(
s
,
OP_LOADINEG
,
cursp
(),
(
uint16_t
)
-
i
);
else
if
(
i
>=
-
0xff
)
genop_2
(
s
,
OP_LOADINEG
,
cursp
(),
(
uint16_t
)
-
i
);
else
if
(
i
>=
INT16_MIN
)
genop_2S
(
s
,
OP_LOADI16
,
cursp
(),
(
uint16_t
)
i
);
else
if
(
i
>=
INT32_MIN
)
genop_2SS
(
s
,
OP_LOADI32
,
cursp
(),
(
uint32_t
)
i
);
else
goto
lit_int
;
...
...
mrbgems/mruby-enumerator/test/enumerator.rb
View file @
4fa3359d
...
...
@@ -567,7 +567,7 @@ assert 'Enumerator.produce' do
# Without initial object
passed_args
=
[]
enum
=
Enumerator
.
produce
{
|
obj
|
passed_args
<<
obj
;
(
obj
||
0
).
succ
}
assert_equal
Enumerator
,
enum
.
class
assert_equal
Enumerator
,
enum
.
class
assert_take
[
1
,
2
,
3
],
enum
assert_equal
[
nil
,
1
,
2
],
passed_args
...
...
mrbgems/mruby-io/src/file.c
View file @
4fa3359d
...
...
@@ -290,20 +290,20 @@ mrb_file__getwd(mrb_state *mrb, mrb_value klass)
#define IS_DEVICEID(x) (x == '.' || x == '?')
#define CHECK_UNCDEV_PATH (IS_FILESEP(path[0]) && IS_FILESEP(path[1]))
static
int
static
int
is_absolute_traditional_path
(
const
char
*
path
,
size_t
len
)
{
if
(
len
<
3
)
return
0
;
return
(
ISALPHA
(
path
[
0
])
&&
IS_VOLSEP
(
path
[
1
])
&&
IS_FILESEP
(
path
[
2
]));
}
static
int
static
int
is_aboslute_unc_path
(
const
char
*
path
,
size_t
len
)
{
if
(
len
<
2
)
return
0
;
return
(
CHECK_UNCDEV_PATH
&&
!
IS_DEVICEID
(
path
[
2
]));
}
static
int
static
int
is_absolute_device_path
(
const
char
*
path
,
size_t
len
)
{
if
(
len
<
4
)
return
0
;
return
(
CHECK_UNCDEV_PATH
&&
IS_DEVICEID
(
path
[
2
])
&&
IS_FILESEP
(
path
[
3
]));
...
...
@@ -316,8 +316,8 @@ mrb_file_is_absolute_path(const char *path)
if
(
IS_FILESEP
(
path
[
0
]))
return
1
;
if
(
len
>
0
)
return
(
is_absolute_traditional_path
(
path
,
len
)
||
is_aboslute_unc_path
(
path
,
len
)
||
is_absolute_traditional_path
(
path
,
len
)
||
is_aboslute_unc_path
(
path
,
len
)
||
is_absolute_device_path
(
path
,
len
)
);
else
...
...
mrbgems/mruby-range-ext/mrblib/range.rb
View file @
4fa3359d
...
...
@@ -80,7 +80,7 @@ class Range
last
=
self
.
end
if
block
raise
RangeError
,
"cannot get the minimum of endless range with custom comparison method"
if
last
.
nil?
return
super
return
super
end
return
val
if
last
.
nil?
...
...
mrbgems/mruby-range-ext/test/range.rb
View file @
4fa3359d
...
...
@@ -35,7 +35,7 @@ assert('Range#size') do
assert_equal
41
,
(
1
...
42
).
size
assert_nil
(
'a'
..
'z'
).
size
assert_nil
(
'a'
..
).
size
assert_nil
(
1
..
).
size
unless
Object
.
const_defined?
(
:Float
)
skip
unless
Object
.
const_defined?
(
:Float
)
...
...
mrbgems/mruby-rational/src/rational.c
View file @
4fa3359d
...
...
@@ -96,7 +96,7 @@ rational_new(mrb_state *mrb, mrb_int numerator, mrb_int denominator)
* md: max denominator value. Note that machine floating point number
* has a finite resolution (10e-16 ish for 64 bit double), so specifying
* a "best match with minimal error" is often wrong, because one can
* always just retrieve the significand and return that divided by
* always just retrieve the significand and return that divided by
* 2**52, which is in a sense accurate, but generally not very useful:
* 1.0/7.0 would be "2573485501354569/18014398509481984", for example.
*/
...
...
@@ -122,7 +122,7 @@ rational_new_f(mrb_state *mrb, mrb_float f0)
mrb_raise
(
mrb
,
E_RANGE_ERROR
,
"integer overflow in rational"
);
}
d
=
(
mrb_int
)
f
;
/* continued fraction and check denominator each step */
for
(
i
=
0
;
i
<
64
;
i
++
)
{
a
=
(
mrb_int
)(
n
?
d
/
n
:
0
);
...
...
mrbgems/mruby-test/vformat.c
View file @
4fa3359d
...
...
@@ -24,7 +24,7 @@ vf_s_format_c(mrb_state *mrb, mrb_value klass)
mrb_value
fmt_str
,
arg_str
;
const
char
*
fmt
;
char
c
;
mrb_get_args
(
mrb
,
"SS"
,
&
fmt_str
,
&
arg_str
);
fmt
=
RSTRING_CSTR
(
mrb
,
fmt_str
);
c
=
RSTRING_CSTR
(
mrb
,
arg_str
)[
0
];
...
...
@@ -164,7 +164,7 @@ mrb_init_test_vformat(mrb_state *mrb)
#define VF_DEFINE_FORMAT_METHOD(t) VF_DEFINE_FORMAT_METHOD_n(t,2)
#define VF_DEFINE_FORMAT_METHOD_n(t,n) mrb_define_class_method(mrb, vf, #t, vf_s_format_##t, MRB_ARGS_REQ(n));
VF_DEFINE_FORMAT_METHOD
(
c
);
VF_DEFINE_FORMAT_METHOD
(
d
);
#ifndef MRB_NO_FLOAT
...
...
mrblib/array.rb
View file @
4fa3359d
...
...
@@ -12,7 +12,7 @@ class Array
# ISO 15.2.12.5.10
def
each
(
&
block
)
return
to_enum
:each
unless
block
idx
=
0
while
idx
<
length
block
.
call
(
self
[
idx
])
...
...
src/class.c
View file @
4fa3359d
...
...
@@ -1458,7 +1458,7 @@ fix_prepend_module(mrb_state *mrb, struct RBasic *obj, void *data)
if
(
p
->
tt
==
MRB_TT_CLASS
)
break
;
if
(
p
->
c
==
m
[
0
])
{
include_module_at
(
mrb
,
ins_pos
,
ins_pos
,
m
[
1
],
0
);
break
;
break
;
}
c
=
p
;
p
=
p
->
super
;
...
...
src/dump.c
View file @
4fa3359d
...
...
@@ -138,7 +138,7 @@ get_pool_block_size(mrb_state *mrb, const mrb_irep *irep)
#endif
break
;
default:
/* packed IREP_TT_STRING */
default:
/* packed IREP_TT_STRING */
{
mrb_int
len
=
irep
->
pool
[
pool_no
].
tt
>>
2
;
/* unpack length */
mrb_assert_int_fit
(
mrb_int
,
len
,
size_t
,
SIZE_MAX
);
...
...
@@ -961,7 +961,7 @@ dump_pool(mrb_state *mrb, const mrb_pool_value *p, FILE *fp)
}
mrb_bool
mrb_sym_static_p
(
mrb_state
*
mrb
,
mrb_sym
sym
);
static
int
dump_sym
(
mrb_state
*
mrb
,
mrb_sym
sym
,
FILE
*
fp
)
{
...
...
src/numeric.c
View file @
4fa3359d
...
...
@@ -75,7 +75,7 @@ int_pow(mrb_state *mrb, mrb_value x)
#ifndef MRB_NO_FLOAT
mrb_value
y
=
mrb_get_arg1
(
mrb
);
mrb_float
z
;
if
(
!
mrb_integer_p
(
y
))
{
mrb_get_args
(
mrb
,
"f"
,
&
z
);
z
=
pow
((
mrb_float
)
base
,
z
);
...
...
test/t/integer.rb
View file @
4fa3359d
...
...
@@ -28,7 +28,7 @@ assert('Integer#*', '15.2.8.3.3') do
a
=
1
*
1
assert_equal
1
,
a
if
Object
.
const_defined?
(
:Float
)
b
=
1
*
1.0
b
=
1
*
1.0
assert_equal
1.0
,
b
end
assert_raise
(
TypeError
){
0
*
nil
}
...
...
test/t/range.rb
View file @
4fa3359d
...
...
@@ -155,7 +155,7 @@ assert('Range#eql?', '15.2.14.4.14') do
assert_false
(
1
..
).
eql?
"1.."
skip
unless
Object
.
const_defined?
(
:Float
)
assert_false
(
1
..
10
).
eql?
(
Range
.
new
(
1.0
,
10.0
))
assert_false
(
1
..
).
eql?
(
Range
.
new
(
1.0
,
nil
))
assert_false
(
1
..
).
eql?
(
Range
.
new
(
1.0
,
nil
))
end
assert
(
'Range#initialize_copy'
,
'15.2.14.4.15'
)
do
...
...
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