summaryrefslogtreecommitdiffhomepage
path: root/ext
diff options
context:
space:
mode:
authorTom Black <[email protected]>2016-07-16 17:06:12 -0400
committerTom Black <[email protected]>2016-07-16 17:06:12 -0400
commit0397b5aedfd9e0e51c27437a0743d4f59b32008e (patch)
tree2293e2beefcd1fb7c8b3b129a47486e5d71b44d8 /ext
parentaa41134d58b16b1fb88482865a80bb44eb9e1052 (diff)
downloadruby2d-0397b5aedfd9e0e51c27437a0743d4f59b32008e.tar.gz
ruby2d-0397b5aedfd9e0e51c27437a0743d4f59b32008e.zip
Make funcs and vars static, where possible
Diffstat (limited to 'ext')
-rw-r--r--ext/ruby2d/ruby2d.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/ruby2d/ruby2d.c b/ext/ruby2d/ruby2d.c
index 281f402..0a727c9 100644
--- a/ext/ruby2d/ruby2d.c
+++ b/ext/ruby2d/ruby2d.c
@@ -8,10 +8,10 @@
#define TEXT 4
// Ruby 2D window
-VALUE self;
+static VALUE self;
// Simple 2D window
-S2D_Window *window;
+static S2D_Window *window;
// Ruby data types
static VALUE ruby2d_module;
@@ -79,7 +79,7 @@ static VALUE init_text(char *font, char *msg, int size) {
/*
* Simple 2D `on_key` input callback function
*/
-void on_key(const char *key) {
+static void on_key(const char *key) {
rb_funcall(self, rb_intern("key_callback"), 1, rb_str_new2(key));
}
@@ -87,7 +87,7 @@ void on_key(const char *key) {
/*
* Simple 2D `on_key_down` input callback function
*/
-void on_key_down(const char *key) {
+static void on_key_down(const char *key) {
rb_funcall(self, rb_intern("key_down_callback"), 1, rb_str_new2(key));
}
@@ -95,7 +95,7 @@ void on_key_down(const char *key) {
/*
* Simple 2D `on_controller` input callback function
*/
-void on_controller(bool is_axis, int axis, int val, bool is_btn, int btn) {
+static void on_controller(bool is_axis, int axis, int val, bool is_btn, int btn) {
rb_funcall(self, rb_intern("controller_callback"), 5,
is_axis ? Qtrue : Qfalse, INT2NUM(axis), INT2NUM(val),
is_btn ? Qtrue : Qfalse, INT2NUM(btn)
@@ -106,7 +106,7 @@ void on_controller(bool is_axis, int axis, int val, bool is_btn, int btn) {
/*
* Simple 2D `update` callback function
*/
-void update() {
+static void update() {
// Set the cursor
rb_iv_set(self, "@mouse_x", INT2NUM(window->mouse.x));
@@ -123,7 +123,7 @@ void update() {
/*
* Simple 2D `render` callback function
*/
-void render() {
+static void render() {
// Read window objects
VALUE objects = rb_iv_get(self, "@objects");