shithub: rott

Download patch

ref: 15fbcd640bb628e52fef1b54f5bdd856c5c43bd2
parent: f66ee83d0938466f66eae07e21107455c13a8d9b
parent: 94a3394c37862c6c997a735d1c0ec6d580226627
author: LTCHIPS <ltchips994@gmail.com>
date: Mon Jun 4 20:56:03 EDT 2018

Merge pull request #4 from marespiaut/master

Fixing Makefile, added C17 std build flag to makefile

--- a/rott/Makefile
+++ b/rott/Makefile
@@ -14,10 +14,10 @@
 
 # Regular build flags and rules
 
-CC ?= gccs
+CC ?= gcc
 
-CFLAGS ?= -g -O2
-CFLAGS += -Wall -Wno-unused
+CFLAGS ?= -std=c17 -g -Og
+CFLAGS += -Wall -Wextra -Wshadow -Wpedantic
 CFLAGS += $(shell sdl2-config --cflags)
 CFLAGS += $(EXTRACFLAGS)
 
--- a/rott/audiolib/Makefile
+++ b/rott/audiolib/Makefile
@@ -6,8 +6,8 @@
 
 ARFLAGS ?= rcT
 
-CFLAGS ?= -g -O2
-CFLAGS += -Wall
+CFLAGS ?= -std=c17 -g -Og
+CFLAGS += -Wall -Wextra -Wshadow -Wpedantic
 CFLAGS += $(shell sdl-config --cflags)
 
 OBJS :=
--- a/rott/rt_cfg.c
+++ b/rott/rt_cfg.c
@@ -1149,8 +1149,7 @@
 
     // Write Battle File
     GetPathFromEnvironment( filename, ApogeePath, BattleName );
-    file = open( filename, O_RDWR | O_TEXT | O_CREAT | O_TRUNC,
-                 S_IREAD | S_IWRITE );
+    file = open( filename, O_RDWR | O_TEXT | O_CREAT | O_TRUNC );
 
     if ( file == -1 )
     {
@@ -1508,8 +1507,7 @@
     }
 
     GetPathFromEnvironment( filename, ApogeePath, SoundName );
-    file = open ( filename, O_RDWR | O_TEXT | O_CREAT | O_TRUNC,
-                  S_IREAD | S_IWRITE);
+    file = open ( filename, O_RDWR | O_TEXT | O_CREAT | O_TRUNC );
 
     if (file == -1)
         Error ("Error opening %s: %s", filename, strerror(errno));
@@ -1623,8 +1621,7 @@
     WriteBattleConfig();
 
     GetPathFromEnvironment( filename, ApogeePath, ConfigName );
-    file = open( filename,O_RDWR | O_TEXT | O_CREAT | O_TRUNC
-                 , S_IREAD | S_IWRITE);
+    file = open( filename,O_RDWR | O_TEXT | O_CREAT | O_TRUNC );
 
     if (file == -1)
         Error ("Error opening %s: %s",filename,strerror(errno));
--- a/rott/rt_util.c
+++ b/rott/rt_util.c
@@ -582,8 +582,7 @@
     filename[sizeof (filename) - 1] = '\0';
     FixFilePath(filename);
 
-    handle = open(filename,O_RDWR | O_BINARY | O_CREAT | O_APPEND
-                  , S_IREAD | S_IWRITE);
+    handle = open(filename,O_RDWR | O_BINARY | O_CREAT | O_APPEND );
 
     if (handle == -1)
         Error ("Error opening for append %s: %s",filename,strerror(errno));
@@ -599,8 +598,7 @@
     filename[sizeof (filename) - 1] = '\0';
     FixFilePath(filename);
 
-    handle = open(filename,O_RDWR | O_BINARY | O_CREAT | O_TRUNC
-                  , S_IREAD | S_IWRITE);
+    handle = open(filename,O_RDWR | O_BINARY | O_CREAT | O_TRUNC );
 
     if (handle == -1)
         Error ("Error opening %s: %s",filename,strerror(errno));
--- a/rott/w_wad.c
+++ b/rott/w_wad.c
@@ -19,6 +19,7 @@
 */
 // W_wad.c
 
+#include <alloca.h>
 #include <stdio.h>
 #include <string.h>
 #include <fcntl.h>