Mitchell Blank Jr
1ad7a1e3d8
C++ compilability: don't use "node" as both a type and a member
...
I originally solved this by renaming the "node" type to "node_t",
but Matz didn't like that. He suggested renaming the member
variable "nd" instead:
https://github.com/mruby/mruby/pull/144#issuecomment-5743153
2012-05-20 00:19:38 -07:00
Mitchell Blank Jr
42c6b324db
C++ compilability -- don't jump across variable initialization
...
C++ is picker than C about when you can "goto" across a variable being
defined. The fix is to just minimize the variable's scope inside an
extra set of brackets.
Without this change, g++ has the following errors:
transcode.c:590: error: jump to label 'resume_label3'
transcode.c:514: error: from here
transcode.c:582: error: crosses initialization of 'const unsigned char* p'
transcode.c:2124: error: jump to label 'set_encs'
transcode.c:2184: error: from here
transcode.c:2088: error: skips initialization of 'const char* err'
transcode.c:2089: error: skips initialization of 'size_t error_len'
transcode.c:2090: error: skips initialization of 'mrb_value bytes'
transcode.c:2091: error: skips initialization of 'mrb_value dumped'
transcode.c:2092: error: skips initialization of 'size_t readagain_len'
transcode.c:2093: error: skips initialization of 'mrb_value bytes2'
2012-05-20 00:06:49 -07:00
Mitchell Blank Jr
8c752c73e2
"volatile" no longer needed here
...
See Matz's comment here:
https://github.com/mruby/mruby/pull/144#issuecomment-5754054
2012-05-19 23:44:43 -07:00
Mitchell Blank Jr
d9529f198d
fix mrb_gc_mark_ht_size() and mrb_gc_free_ht() types
...
mrb_gc_mark_ht_size() and mrb_gc_free_ht() were declared in gc.h as
taking a "RHash *" argument, but then they were defined in hash.c
as taking a "RClass *" Get these in sync.
2012-05-19 23:33:01 -07:00
Mitchell Blank Jr
e3abf33384
C++ compilability: "not" is a C++ keyword, avoid it
...
see http://en.cppreference.com/w/cpp/language/operator_alternative
2012-05-19 23:28:40 -07:00
Mitchell Blank Jr
365cc40ac5
C++ compilabilty -- "new" is a C++ keyword, avoid it
2012-05-19 23:20:44 -07:00
Mitchell Blank Jr
be0e3fdf51
C++ compilability -- "try" is a keyword, avoid as variable name
2012-05-19 23:18:47 -07:00
Mitchell Blank Jr
4ebd0361e4
Helper functions for st_foreach() return "enum st_retval" not "int"
...
Just making this a bit more consistent throughout the code
2012-05-19 23:16:54 -07:00
Kazuki Tsujimoto
db196c5128
Add cast to remove "cast from pointer to integer of different size" warning
2012-05-20 14:41:50 +09:00
Mitchell Blank Jr
3471e2b134
C++ compilability - don't define types inside others
...
The following is legal code in both C and C++:
struct foo {
struct bar { int a } x;
int y;
};
...however in C++ it defines a type called "foo::bar" instead of "bar".
Just avoid this construct altogether
2012-05-19 22:40:57 -07:00
Daniel Bovensiepen
e1e072b800
Fix Hash#shift return value from Hash to Array
2012-05-20 13:18:34 +08:00
Yukihiro Matsumoto
2ed31892a8
should initialize p->sterm every parse time
2012-05-19 17:52:41 +09:00
Yukihiro Matsumoto
59da9f6974
remove src/pool.h; close #163
2012-05-19 16:56:15 +09:00
Yukihiro Matsumoto
6f6c270bb1
mirb should detect end of expression smarter
2012-05-19 16:15:11 +09:00
Yukihiro Matsumoto
aeca23166b
remove dependency to node.h and pool.h
2012-05-19 15:52:47 +09:00
Yukihiro Matsumoto
cb8b4691f0
p->tree may be NULL; close #161
2012-05-19 15:37:41 +09:00
Yukihiro Matsumoto
00c419f066
remove obsolete minimain.c
2012-05-18 22:32:10 +09:00
Yukihiro "Matz" Matsumoto
631ab3536d
Merge pull request #158 from pbosetti/tests
...
Minor edits to test suite and Math module
2012-05-18 00:33:43 -07:00
Yukihiro Matsumoto
2728f30297
implement Kernel#p in Ruby
2012-05-18 15:01:45 +09:00
Paolo Bosetti
8027d5120d
Merge branch 'tests' of github.com:pbosetti/mruby into tests
2012-05-17 22:55:35 -07:00
Yukihiro Matsumoto
1ace96a943
remove unused prototype
2012-05-18 14:42:07 +09:00
Yukihiro Matsumoto
fb60a2191a
revise version description
2012-05-18 14:41:00 +09:00
Yukihiro Matsumoto
e306bfaf94
failed to initialize source string
2012-05-18 14:23:40 +09:00
Yukihiro Matsumoto
219162117a
move compile.h to mruby/compile.h
2012-05-18 12:54:23 +09:00
Yukihiro Matsumoto
bbf7b0ceba
add extern "C" guards
2012-05-18 12:45:09 +09:00
Yukihiro Matsumoto
ec6c6df995
yywarn should use warn_buffer not error_buffer
2012-05-18 11:17:07 +09:00
Yukihiro Matsumoto
5223c0a6ac
remove mrb_parse_nstring_ext; use mrb_parser_new() then set p->capture_error = 1; then call mrb_parser_parse(); see tool/mirb/mirb.c
2012-05-18 11:07:11 +09:00
Yukihiro Matsumoto
61d8bb132e
keep toplevel local variables; close #133
2012-05-18 11:04:36 +09:00
Yukihiro Matsumoto
a18fb01b03
new API for parser
2012-05-18 11:03:43 +09:00
Paolo Bosetti
5760ad7d59
Minor edits in tests for Math module
2012-05-17 17:40:21 -07:00
Yukihiro Matsumoto
5d5d189dee
remove src/method.h
2012-05-18 02:06:09 +09:00
Yukihiro Matsumoto
74d29edf5c
remove unused method.h from kernel.c
2012-05-18 02:05:52 +09:00
Yukihiro Matsumoto
6c9ae9489f
remove unused method.h from object.c
2012-05-18 02:04:29 +09:00
Yukihiro Matsumoto
434ed1ed7c
compile error should contain line number
2012-05-17 23:46:55 +09:00
Yukihiro Matsumoto
0bae9c505c
print line number in compile error messages
2012-05-17 19:09:50 +09:00
Yukihiro Matsumoto
89e31b5838
too many line count in nextc()
2012-05-17 19:09:29 +09:00
Yukihiro Matsumoto
490fa45298
add cast to remove warning; close #154
2012-05-17 16:38:37 +09:00
Carson McDonald
1685d241c4
idx should be less than the cap, if it is equal irep needs to grow.
2012-05-17 00:33:49 -04:00
Yukihiro Matsumoto
103ef78e59
no SEGV for nth_ref & back_ref; close #152
2012-05-17 13:21:01 +09:00
Yukihiro Matsumoto
b68e69aa32
remove unused assignments
2012-05-17 12:57:08 +09:00
Yukihiro Matsumoto
3e3a8c18b9
avoid updating existing libmruby.a to avoid problems on low time resolution file systems; close #136
2012-05-17 12:13:24 +09:00
Yukihiro Matsumoto
74e531ecab
avoid isfinite() in num_pow
2012-05-17 10:34:28 +09:00
Yukihiro Matsumoto
470da1eda0
redefine POST/NEG FIXABLE using INT_MIN/MAX
2012-05-17 09:32:23 +09:00
Yukihiro Matsumoto
db20b4e063
ignore return value from strtod()
2012-05-17 09:23:18 +09:00
Yukihiro Matsumoto
cbeee91ddb
use gperf -L ANSI-C to generate lex.def
2012-05-17 08:39:27 +09:00
Yukihiro Matsumoto
2541530239
add mrb_define_singleton_method/mrb_define_module_function
2012-05-17 02:44:41 +09:00
Yukihiro Matsumoto
b706b4cba4
gmtime_r emulated by gmtime_s should return struct tm*; close #146
2012-05-17 02:39:28 +09:00
Yukihiro "Matz" Matsumoto
357aac680e
Merge pull request #139 from pbosetti/master
...
Re-added Math functions missing under MSVC, with custom implementations
2012-05-16 08:24:22 -07:00
Yukihiro "Matz" Matsumoto
7b4c28cef8
Merge pull request #142 from monaka/pr-initialize-variables-20110516
...
Avoid "may be used uninitialized in this function" warning.
2012-05-16 08:23:25 -07:00
Masaki Muranaka
6250d06b94
Avoid "may be used uninitialized in this function" warning.
2012-05-16 16:28:07 +09:00