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
5a153851
Commit
5a153851
authored
Mar 04, 2013
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #947 from monaka/pr-cleanup-stdio-calls-20130304
Cleanup stdio related.
parents
f074951a
0e662e3b
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
21 additions
and
29 deletions
+21
-29
include/mrbconf.h
include/mrbconf.h
+4
-0
src/class.c
src/class.c
+0
-1
src/error.c
src/error.c
+4
-3
src/numeric.c
src/numeric.c
+0
-1
src/object.c
src/object.c
+0
-1
src/parse.y
src/parse.y
+0
-1
src/print.c
src/print.c
+13
-20
src/string.c
src/string.c
+0
-1
src/vm.c
src/vm.c
+0
-1
No files found.
include/mrbconf.h
View file @
5a153851
...
...
@@ -110,4 +110,8 @@ typedef short mrb_sym;
# include <inttypes.h>
#endif
#ifdef ENABLE_STDIO
# include <stdio.h>
#endif
#endif
/* MRUBYCONF_H */
src/class.c
View file @
5a153851
...
...
@@ -6,7 +6,6 @@
#include "mruby.h"
#include <stdarg.h>
#include <stdio.h>
#include <ctype.h>
#include "mruby/class.h"
#include "mruby/proc.h"
...
...
src/error.c
View file @
5a153851
...
...
@@ -6,7 +6,6 @@
#include "mruby.h"
#include <stdarg.h>
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
#include "error.h"
...
...
@@ -209,9 +208,7 @@ mrb_exc_raise(mrb_state *mrb, mrb_value exc)
mrb
->
exc
=
(
struct
RObject
*
)
mrb_object
(
exc
);
exc_debug_info
(
mrb
,
mrb
->
exc
);
if
(
!
mrb
->
jmp
)
{
#ifdef ENABLE_STDIO
mrb_p
(
mrb
,
exc
);
#endif
abort
();
}
longjmp
(
*
(
jmp_buf
*
)
mrb
->
jmp
,
1
);
...
...
@@ -280,23 +277,27 @@ mrb_sprintf(mrb_state *mrb, const char *fmt, ...)
void
mrb_warn
(
const
char
*
fmt
,
...)
{
#ifdef ENABLE_STDIO
va_list
args
;
va_start
(
args
,
fmt
);
printf
(
"warning: "
);
vprintf
(
fmt
,
args
);
va_end
(
args
);
#endif
}
void
mrb_bug
(
const
char
*
fmt
,
...)
{
#ifdef ENABLE_STDIO
va_list
args
;
va_start
(
args
,
fmt
);
printf
(
"bug: "
);
vprintf
(
fmt
,
args
);
va_end
(
args
);
#endif
exit
(
EXIT_FAILURE
);
}
...
...
src/numeric.c
View file @
5a153851
...
...
@@ -10,7 +10,6 @@
#include "mruby/array.h"
#include <math.h>
#include <stdio.h>
#include <assert.h>
#if defined(__FreeBSD__) && __FreeBSD__ < 4
...
...
src/object.c
View file @
5a153851
...
...
@@ -7,7 +7,6 @@
#include "mruby.h"
#include <string.h>
#include "mruby/string.h"
#include <stdio.h>
#include "mruby/class.h"
#include "mruby/numeric.h"
#include "error.h"
...
...
src/parse.y
View file @
5a153851
...
...
@@ -22,7 +22,6 @@
#include "mruby/proc.h"
#include "node.h"
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
#include <string.h>
...
...
src/print.c
View file @
5a153851
...
...
@@ -5,13 +5,12 @@
*/
#include "mruby.h"
#ifdef ENABLE_STDIO
#include "mruby/string.h"
#include <stdio.h>
static
void
printstr
(
mrb_state
*
mrb
,
mrb_value
obj
)
{
#ifdef ENABLE_STDIO
struct
RString
*
str
;
char
*
s
;
int
len
;
...
...
@@ -22,14 +21,17 @@ printstr(mrb_state *mrb, mrb_value obj)
len
=
str
->
len
;
fwrite
(
s
,
len
,
1
,
stdout
);
}
#endif
}
void
mrb_p
(
mrb_state
*
mrb
,
mrb_value
obj
)
{
#ifdef ENABLE_STDIO
obj
=
mrb_funcall
(
mrb
,
obj
,
"inspect"
,
0
);
printstr
(
mrb
,
obj
);
putc
(
'\n'
,
stdout
);
#endif
}
/* 15.3.1.2.9 */
...
...
@@ -55,31 +57,22 @@ mrb_init_print(mrb_state *mrb)
mrb_define_method
(
mrb
,
krn
,
"__printstr__"
,
mrb_printstr
,
ARGS_REQ
(
1
));
}
void
mrb_show_version
(
mrb_state
*
mrb
)
{
printf
(
"mruby - Embeddable Ruby Copyright (c) 2010-2013 mruby developers
\n
"
)
;
}
static
const
char
version_msg
[]
=
"mruby - Embeddable Ruby Copyright (c) 2010-2013 mruby developers
\n
"
;
mrb_value
msg
;
void
mrb_show_copyright
(
mrb_state
*
mrb
)
{
printf
(
"mruby - Copyright (c) 2010-2013 mruby developers
\n
"
);
}
#else
void
mrb_p
(
mrb_state
*
mrb
,
mrb_value
obj
)
{
}
void
mrb_show_version
(
mrb_state
*
mrb
)
{
msg
=
mrb_str_new
(
mrb
,
version_msg
,
sizeof
(
version_msg
)
-
1
);
printstr
(
mrb
,
msg
);
}
void
mrb_show_copyright
(
mrb_state
*
mrb
)
{
static
const
char
copyright_msg
[]
=
"mruby - Copyright (c) 2010-2013 mruby developers
\n
"
;
mrb_value
msg
;
msg
=
mrb_str_new
(
mrb
,
copyright_msg
,
sizeof
(
copyright_msg
)
-
1
);
printstr
(
mrb
,
msg
);
}
#endif
src/string.c
View file @
5a153851
...
...
@@ -15,7 +15,6 @@
#include "mruby/array.h"
#include "mruby/class.h"
#include "mruby/numeric.h"
#include <stdio.h>
#include "re.h"
const
char
mrb_digitmap
[]
=
"0123456789abcdefghijklmnopqrstuvwxyz"
;
...
...
src/vm.c
View file @
5a153851
...
...
@@ -17,7 +17,6 @@
#include "mruby/numeric.h"
#include "error.h"
#include <stdio.h>
#include <string.h>
#include <setjmp.h>
#include <stddef.h>
...
...
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