summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/parse.y6
-rw-r--r--src/time.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/src/parse.y b/src/parse.y
index e9348e7a1..871842668 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -10,6 +10,12 @@
#define YYDEBUG 1
#define YYERROR_VERBOSE 1
+/*
+ * Force yacc to use our memory management. This is a little evil because
+ * the macros assume that "parser_state *p" is in scope
+ */
+#define YYMALLOC(n) mrb_malloc(p->mrb, (n))
+#define YYFREE(o) mrb_free(p->mrb, (o))
#define YYSTACK_USE_ALLOCA 0
#include "mruby.h"
diff --git a/src/time.c b/src/time.c
index 8e306ed36..293eef583 100644
--- a/src/time.c
+++ b/src/time.c
@@ -266,8 +266,7 @@ time_mktime(mrb_state *mrb, mrb_int ayear, mrb_int amonth, mrb_int aday,
static mrb_value
mrb_time_gm(mrb_state *mrb, mrb_value self)
{
- mrb_int ayear = 0, amonth = 1, aday = 1, ahour = 0,
- amin = 0, asec = 0, ausec = 0;
+ mrb_int ayear = 0, amonth = 1, aday = 1, ahour = 0, amin = 0, asec = 0, ausec = 0;
mrb_get_args(mrb, "iiiiiii",
&ayear, &amonth, &aday, &ahour, &amin, &asec, &ausec);
@@ -281,8 +280,7 @@ mrb_time_gm(mrb_state *mrb, mrb_value self)
static mrb_value
mrb_time_local(mrb_state *mrb, mrb_value self)
{
- mrb_int ayear = 0, amonth = 1, aday = 1, ahour = 0,
- amin = 0, asec = 0, ausec = 0;
+ mrb_int ayear = 0, amonth = 1, aday = 1, ahour = 0, amin = 0, asec = 0, ausec = 0;
mrb_get_args(mrb, "iiiiiii",
&ayear, &amonth, &aday, &ahour, &amin, &asec, &ausec);