change return codes to avoid overlap with fpc ones
authorsheepluva
Fri, 29 Sep 2017 23:31:29 +0200
changeset 12604 95f0e475ca8e
parent 12603 9805a1f8fb93
child 12605 ef780eda6e48
change return codes to avoid overlap with fpc ones
hedgewars/uConsts.pas
--- a/hedgewars/uConsts.pas	Fri Sep 29 23:29:00 2017 +0200
+++ b/hedgewars/uConsts.pas	Fri Sep 29 23:31:29 2017 +0200
@@ -27,17 +27,22 @@
 
 const
     HDPIScaleFactor     =  1;
+
+    // application return codes
     HaltNoError         =  0;
-    HaltUsageError      =  1;
-    HaltFatalError      =  2;
-    HaltStartupError    =  3;
-    HaltFatalErrorNoIPC =  4;
+
+    // error codes are placed in range 50-99 because that way then don't overlap with run-time errors of pascal
+    // see https://www.freepascal.org/docs-html/user/userap4.html
+    HaltUsageError      =  51;
+    HaltFatalError      =  52;
+    HaltStartupError    =  53;
+    HaltFatalErrorNoIPC =  54;
 
     // for automatic tests
     HaltTestSuccess     =  0;
-    HaltTestFailed      =  10;
-    HaltTestLuaError    =  11;
-    HaltTestUnexpected  =  12;
+    HaltTestFailed      =  60;
+    HaltTestLuaError    =  61;
+    HaltTestUnexpected  =  62;
 
 
     sfMax = 1000;