Browse Source

Merge branch 'clang'. Closes #10

Eiyeron Fulmincendii 9 years ago
parent
commit
ca550f3104
4 changed files with 7 additions and 7 deletions
  1. 1 1
      Makefile
  2. 2 2
      platform/sfml/Graphics.cpp
  3. 3 3
      platform/sfml/rules.mk
  4. 1 1
      src/engine/StateMachine.cpp

+ 1 - 1
Makefile

@@ -14,7 +14,7 @@ CFLAGS = $(CFLAGS_COMMON) -std=gnu11
 
 CPPFLAGS = $(CFLAGS_COMMON) -std=gnu++11
 
-LDFLAGS = $(CFLAGS_COMMON) -Wl,--gc-sections -lz
+LDFLAGS = $(CFLAGS_COMMON) -fuse-ld=gold -lz
 
 SRCS_C :=
 SRCS_CPP :=

+ 2 - 2
platform/sfml/Graphics.cpp

@@ -139,12 +139,12 @@ void Graphics::put_pixel(uint16_t x, uint16_t y, const Pixel &color)
 void Graphics::put_horizontal_line(uint16_t x, uint16_t x2, uint16_t y,
                                    const Pixel &color)
 {
-    put_rectangle({x, y, x2 - x + 1, 1}, color);
+    put_rectangle({x, y, x2 - x + 1u, 1}, color);
 }
 
 void Graphics::put_vertical_line(uint16_t x, uint16_t y, uint16_t y2, const Pixel &color)
 {
-    put_rectangle({x, y, 1, y2 - y + 1}, color);
+    put_rectangle({x, y, 1, y2 - y + 1u}, color);
 }
 
 void Graphics::put_line(uint16_t x, uint16_t y, uint16_t x2, uint16_t y2,

+ 3 - 3
platform/sfml/rules.mk

@@ -4,12 +4,12 @@ SRCS_C += $(wildcard $(sfml_LOCAL_PATH)/platform/*.c)
 SRCS_CPP += $(wildcard $(sfml_LOCAL_PATH)/*.cpp)
 INCLUDE += $(sfml_LOCAL_PATH)/public
 
-LDFLAGS += -lstdc++ -lsfml-window -lsfml-graphics -lsfml-system -lGL -lm
+LDFLAGS += -lstdc++ -lsfml-window -lsfml-graphics -lsfml-system
 
 CFLAGS_COMMON += -DSFML=1
 
-CC = gcc
-CPP = g++
+CC = clang
+CPP = clang++
 
 EXE = $(OUT)/$(NAME)
 

+ 1 - 1
src/engine/StateMachine.cpp

@@ -15,7 +15,7 @@ using WalrusRPG::States::State;
 
 namespace
 {
-    void draw_button(unsigned x, unsigned y, KeyState state)
+    void draw_button(signed x, signed y, KeyState state)
     {
         put_horizontal_line(x + 1, x + 5, y, Gray);
         put_horizontal_line(x + 1, x + 5, y + 6, Gray);