From 5cca794c5b6549b7750c88b5c2217d659fa963dd Mon Sep 17 00:00:00 2001
From: Daniel Karbach <daniel.karbach@localhorst.tv>
Date: Mon, 28 Jan 2019 17:49:07 +0100
Subject: [PATCH] new language, new compiler

---
 src/common/ScriptRunner.cpp |  4 ++++
 src/loader/Interpreter.cpp  |  4 ++++
 src/loader/Parser.cpp       | 14 +++++++-------
 3 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/src/common/ScriptRunner.cpp b/src/common/ScriptRunner.cpp
index 947ded7..6c2d2fa 100644
--- a/src/common/ScriptRunner.cpp
+++ b/src/common/ScriptRunner.cpp
@@ -71,6 +71,8 @@ void ScriptRunner::Exec(Script::Code code) {
 					vector[code.reg1] = value;
 					break;
 				}
+				default:
+					break;
 			}
 			break;
 
@@ -89,6 +91,8 @@ void ScriptRunner::Exec(Script::Code code) {
 					vector[code.reg1] += value;
 					break;
 				}
+				default:
+					break;
 			}
 			break;
 
diff --git a/src/loader/Interpreter.cpp b/src/loader/Interpreter.cpp
index a1fdc82..1888361 100644
--- a/src/loader/Interpreter.cpp
+++ b/src/loader/Interpreter.cpp
@@ -625,6 +625,8 @@ void Interpreter::ReadScript(const std::vector<ScriptToken *> &s, Script *script
 						ReadScriptVector(**i, text + cursor);
 						cursor += sizeof(Vector<int>);
 						break;
+					default:
+						break;
 				}
 			}
 		} else if (cmd == "add") {
@@ -671,6 +673,8 @@ void Interpreter::ReadScript(const std::vector<ScriptToken *> &s, Script *script
 						ReadScriptVector(**i, text + cursor);
 						cursor += sizeof(Vector<int>);
 						break;
+					default:
+						break;
 				}
 			}
 		} else if (cmd == "mod") {
diff --git a/src/loader/Parser.cpp b/src/loader/Parser.cpp
index 89e3931..25a99b6 100644
--- a/src/loader/Parser.cpp
+++ b/src/loader/Parser.cpp
@@ -3,12 +3,12 @@
 #include "ParsedSource.h"
 #include "utility.h"
 
-#include <auto_ptr.h>
 #include <fstream>
+#include <memory>
 #include <string>
 #include <vector>
 
-using std::auto_ptr;
+using std::unique_ptr;
 using std::ifstream;
 using std::string;
 using std::vector;
@@ -87,14 +87,14 @@ Declaration *Parser::ProbeDefinition() {
 		Token t(GetToken());
 		tok.Putback(t);
 		if (BeginOfPropertyList(t)) {
-			auto_ptr<PropertyList> propertyList(ParsePropertyList());
-			auto_ptr<Definition> dfn(new Definition(typeName, identifier));
+			unique_ptr<PropertyList> propertyList(ParsePropertyList());
+			unique_ptr<Definition> dfn(new Definition(typeName, identifier));
 			dfn->SetValue(propertyList.release());
 			product.AddDefinition(dfn.get());
 			return dfn.release();
 		} else if (BeginningOfPrimitiveLiteral(t)) {
-			auto_ptr<Literal> literal(ParseLiteral());
-			auto_ptr<Definition> dfn(new Definition(typeName, identifier));
+			unique_ptr<Literal> literal(ParseLiteral());
+			unique_ptr<Definition> dfn(new Definition(typeName, identifier));
 			dfn->SetValue(literal.release());
 			product.AddDefinition(dfn.get());
 			return dfn.release();
@@ -182,7 +182,7 @@ PropertyList *Parser::ParsePropertyList() {
 	Token t(GetToken());
 	AssertTokenType(t.type, Token::ANGLE_BRACKET_OPEN);
 
-	auto_ptr<PropertyList> props(new PropertyList);
+	unique_ptr<PropertyList> props(new PropertyList);
 
 	while (t.type != Token::ANGLE_BRACKET_CLOSE) {
 		Token name(GetToken());
-- 
2.39.5