• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythongamewindowsbathyscaphephpguic翻訳omegattwitterframeworktestbtronarduinovb.net計画中(planning stage)directxpreviewerゲームエンジンdom

TADや、その他BTRON基本データ型を扱うmrbgemの開発用


Commit MetaInfo

Revision8d86a0519d2f6d9c8e5a04513f9abee8c0d30641 (tree)
Time2017-06-24 01:31:30
Authorornse01 <ornse01@user...>
Commiterornse01

Log Message

fix compile error.

Change Summary

Incremental Difference

--- a/src/tad.c
+++ b/src/tad.c
@@ -1,4 +1,8 @@
11 #include "mruby.h"
2+#include "mruby/class.h"
3+#include "mruby/data.h"
4+
5+#include <btron/btron.h>
26
37 const static struct mrb_data_type mrb_PNT_type = { "PNT", mrb_free };
48
@@ -27,7 +31,7 @@ mrb_PNT_init(mrb_state *mrb, mrb_value self)
2731 p->y = arg.y;
2832
2933 DATA_TYPE(self) = &mrb_PNT_type;
30- DATA_PTR(self) = h;
34+ DATA_PTR(self) = p;
3135
3236 return self;
3337 }
@@ -87,7 +91,7 @@ mrb_PNT_init_copy(mrb_state *mrb, mrb_value copy)
8791 mrb_raise(mrb, E_TYPE_ERROR, "wrong argument class");
8892 }
8993 if (!DATA_PTR(copy)) {
90- DATA_PTR(copy) = (struct hoge *)mrb_malloc(mrb, sizeof(struct hoge));
94+ DATA_PTR(copy) = (struct hoge *)mrb_malloc(mrb, sizeof(PNT));
9195 DATA_TYPE(copy) = &mrb_PNT_type;
9296 }
9397 *(PNT*)DATA_PTR(copy) = *(PNT*)DATA_PTR(src);
@@ -98,14 +102,14 @@ mrb_PNT_init_copy(mrb_state *mrb, mrb_value copy)
98102 LOCAL mrb_value
99103 mrb_PNT_equal(mrb_state *mrb, mrb_value self)
100104 {
101- mrb_value src;
105+ mrb_value other;
102106 PNT *self_real, *other_real;
103107
104108 mrb_get_args(mrb, "o", &other);
105109 if (mrb_obj_equal(mrb, self, other)) {
106110 return mrb_bool_value(FALSE);
107111 }
108- if (!mrb_obj_is_instance_of(mrb, other, mrb_obj_class(mrb, copy))) {
112+ if (!mrb_obj_is_instance_of(mrb, other, mrb_obj_class(mrb, self))) {
109113 return mrb_bool_value(FALSE);
110114 }
111115 if (!DATA_PTR(other)) {
@@ -114,7 +118,7 @@ mrb_PNT_equal(mrb_state *mrb, mrb_value self)
114118
115119 self_real = DATA_PTR(self);
116120 other_real = DATA_PTR(other);
117- if ((self_real->x == other_real->x) && (self_real->y == other_real.y)) {
121+ if ((self_real->x == other_real->x) && (self_real->y == other_real->y)) {
118122 return mrb_bool_value(TRUE);
119123 }
120124 return mrb_bool_value(FALSE);
@@ -124,7 +128,7 @@ LOCAL mrb_value
124128 mrb_PNT_plus(mrb_state *mrb, mrb_value self)
125129 {
126130 struct RClass *cls;
127- mrb_value src, result;
131+ mrb_value other, result;
128132 PNT *self_real, *other_real;
129133
130134 cls = mrb_obj_class(mrb, self);
@@ -150,7 +154,7 @@ LOCAL mrb_value
150154 mrb_PNT_minus(mrb_state *mrb, mrb_value self)
151155 {
152156 struct RClass *cls;
153- mrb_value src, result;
157+ mrb_value other, result;
154158 PNT *self_real, *other_real;
155159
156160 cls = mrb_obj_class(mrb, self);