cleanup headers, remove -I . from rtl lib to save a few warnings webgl
authorkoda
Tue, 13 Nov 2012 23:39:49 +0100
branchwebgl
changeset 8047 25a4daa6473c
parent 8044 796f2653f21d
child 8050 c82b68016c68
cleanup headers, remove -I . from rtl lib to save a few warnings
project_files/hwc/CMakeLists.txt
project_files/hwc/Math.h
project_files/hwc/rtl/CMakeLists.txt
project_files/hwc/rtl/Math.h
project_files/hwc/rtl/SysUtils.h
project_files/hwc/rtl/Types.h
project_files/hwc/rtl/fileio.h
project_files/hwc/rtl/fpcrtl.h
project_files/hwc/rtl/pmath.c
project_files/hwc/rtl/pmath.h
project_files/hwc/rtl/system.c
project_files/hwc/rtl/system.h
project_files/hwc/rtl/sysutils.c
project_files/hwc/rtl/sysutils.h
project_files/hwc/rtl/types.h
--- a/project_files/hwc/CMakeLists.txt	Tue Nov 13 22:24:30 2012 +0100
+++ b/project_files/hwc/CMakeLists.txt	Tue Nov 13 23:39:49 2012 +0100
@@ -31,9 +31,9 @@
 find_package(SDL_ttf REQUIRED)
 
 #compile our rtl implementation
+add_subdirectory(rtl)
 include_directories("${GLEW_INCLUDE_PATH}")
 include_directories("${CMAKE_CURRENT_SOURCE_DIR}/rtl")
-add_subdirectory(rtl)
 
 
 configure_file(${CMAKE_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc)
--- a/project_files/hwc/rtl/CMakeLists.txt	Tue Nov 13 22:24:30 2012 +0100
+++ b/project_files/hwc/rtl/CMakeLists.txt	Tue Nov 13 23:39:49 2012 +0100
@@ -1,13 +1,8 @@
-
-set(fpcrtl_src  fileio.c
-                misc.c
-                pmath.c
-                system.c
-                sysutils.c
-)
 
 include_directories(${GLEW_INCLUDE_PATH})
 
+file(GLOB fpcrtl_src *.c)
+
 add_library(fpcrtl ${fpcrtl_src})
 
 #if(WEBGL)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/hwc/rtl/Math.h	Tue Nov 13 23:39:49 2012 +0100
@@ -0,0 +1,4 @@
+#pragma once
+
+#include <math.h>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/hwc/rtl/SysUtils.h	Tue Nov 13 23:39:49 2012 +0100
@@ -0,0 +1,41 @@
+#ifndef _FPCRTL_SYSUTILS_H_
+#define _FPCRTL_SYSUTILS_H_
+
+#include "Types.h"
+
+// EFFECTS: return the current date time in pascal notation
+//          http://www.merlyn.demon.co.uk/del-prgg.htm#TDT
+TDateTime   fpcrtl_now();
+#define     now                     fpcrtl_now
+#define     Now                     fpcrtl_now
+
+// EFFECTS: return the current time
+//          http://www.merlyn.demon.co.uk/del-prgg.htm#TDT
+TDateTime   fpcrtl_time();
+
+
+// EFFECTS: return the current date
+//          http://www.merlyn.demon.co.uk/del-prgg.htm#TDT
+TDateTime   fpcrtl_date();
+#define     date                    fpcrtl_date
+#define     Date                    fpcrtl_date
+
+// EFFECTS: Trim strips blank characters (spaces) at the beginning and end of S
+// and returns the resulting string. Only #32 characters are stripped.
+// If the string contains only spaces, an empty string is returned.
+string255   fpcrtl_trim(string255 s);
+#define     trim                    fpcrtl_trim
+#define     Trim                    fpcrtl_trim
+
+Integer     fpcrtl_strToInt(string255 s);
+#define     StrToInt                fpcrtl_strToInt
+#define     strToInt                fpcrtl_strToInt
+
+string255   fpcrtl_extractFileName(string255 f);
+#define     fpcrtl_ExtractFileName  fpcrtl_extractFileName
+
+string255   fpcrtl_strPas(PChar);
+#define     fpcrtl_StrPas           fpcrtl_strPas
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/hwc/rtl/Types.h	Tue Nov 13 23:39:49 2012 +0100
@@ -0,0 +1,39 @@
+#ifndef _TYPES_H_
+#define _TYPES_H_
+
+#include "pas2c.h"
+
+/*
+ * Not very useful currently
+ */
+
+typedef double TDate;
+typedef double TTime;
+typedef double TDateTime;
+typedef string255 TMonthNameArray[13];
+typedef string255 TWeekNameArray[8];
+
+typedef struct {
+    Byte CurrencyFormat;
+    Byte NegCurrFormat;
+    Char ThousandSeparator;
+    Char DecimalSeparator;
+    Byte CurrencyDecimals;
+    Char DateSeparator;
+    Char TimeSeparator;
+    Char ListSeparator;
+    string255 CurrencyString;
+    string255 ShortDateFormat;
+    string255 LongDateFormat;
+    string255 TimeAMString;
+    string255 TimePMString;
+    string255 ShortTimeFormat;
+    string255 LongTimeFormat;
+    TMonthNameArray ShortMonthNames;
+    TMonthNameArray LongMonthNames;
+    TWeekNameArray ShortDayNames;
+    TWeekNameArray LongDayNames;
+    Word TwoDigitYearCenturyWindow;
+}TFormatSettings;
+
+#endif
--- a/project_files/hwc/rtl/fileio.h	Tue Nov 13 22:24:30 2012 +0100
+++ b/project_files/hwc/rtl/fileio.h	Tue Nov 13 23:39:49 2012 +0100
@@ -2,7 +2,7 @@
 #define FILEIO_H_
 
 #include <stdio.h>
-#include "types.h"
+#include "Types.h"
 #include "misc.h"
 
 extern        int                                       FileMode;
--- a/project_files/hwc/rtl/fpcrtl.h	Tue Nov 13 22:24:30 2012 +0100
+++ b/project_files/hwc/rtl/fpcrtl.h	Tue Nov 13 23:39:49 2012 +0100
@@ -3,13 +3,13 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <math.h>
 #include <string.h>
 #include <unistd.h>
+#include <math.h>
 
+#include "SysUtils.h"
 #include "system.h"
 #include "misc.h"
-#include "sysutils.h"
 #include "fileio.h"
 #include "pmath.h"
 
--- a/project_files/hwc/rtl/pmath.c	Tue Nov 13 22:24:30 2012 +0100
+++ b/project_files/hwc/rtl/pmath.c	Tue Nov 13 23:39:49 2012 +0100
@@ -1,7 +1,6 @@
 #include "pmath.h"
+#include <stdlib.h>
 #include <math.h>
-#include <stdlib.h>
-#include <stdint.h>
 
 /*
  * power raises base to the power power.
--- a/project_files/hwc/rtl/pmath.h	Tue Nov 13 22:24:30 2012 +0100
+++ b/project_files/hwc/rtl/pmath.h	Tue Nov 13 23:39:49 2012 +0100
@@ -2,6 +2,7 @@
 #define PMATH_H_
 
 #include <stdint.h>
+#include <math.h>
 
 #define     fpcrtl_min(a, b)                ((a) < (b) ? (a) : (b))
 #define     fpcrtl_max(a, b)                ((a) > (b) ? (a) : (b))
--- a/project_files/hwc/rtl/system.c	Tue Nov 13 22:24:30 2012 +0100
+++ b/project_files/hwc/rtl/system.c	Tue Nov 13 23:39:49 2012 +0100
@@ -3,13 +3,10 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <wchar.h>
-#include <math.h>
 
 int paramCount;
 string255 params[MAX_PARAMS];
 
-double pi = M_PI;
-
 string255 fpcrtl_copy(string255 s, Integer index, Integer count) {
     string255 result = STRINIT("");
 
--- a/project_files/hwc/rtl/system.h	Tue Nov 13 22:24:30 2012 +0100
+++ b/project_files/hwc/rtl/system.h	Tue Nov 13 23:39:49 2012 +0100
@@ -2,8 +2,7 @@
 #define SYSTEM_H_
 
 #include <time.h>
-#include <math.h>
-#include "types.h"
+#include "Types.h"
 #include "misc.h"
 
 extern double pi;
--- a/project_files/hwc/rtl/sysutils.c	Tue Nov 13 22:24:30 2012 +0100
+++ b/project_files/hwc/rtl/sysutils.c	Tue Nov 13 23:39:49 2012 +0100
@@ -1,11 +1,13 @@
-#include "sysutils.h"
-#include "system.h"
-#include "misc.h"
+#include "SysUtils.h"
+
 #include <time.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
+#include "system.h"
+#include "misc.h"
+
 TDateTime fpcrtl_date()
 {
     const int num_days_between_1900_1980 = 29220;
--- a/project_files/hwc/rtl/sysutils.h	Tue Nov 13 22:24:30 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-#ifndef _FPCRTL_SYSUTILS_H_
-#define _FPCRTL_SYSUTILS_H_
-
-#include "types.h"
-
-// EFFECTS: return the current date time in pascal notation
-//          http://www.merlyn.demon.co.uk/del-prgg.htm#TDT
-TDateTime   fpcrtl_now();
-#define     now                     fpcrtl_now
-#define     Now                     fpcrtl_now
-
-// EFFECTS: return the current time
-//          http://www.merlyn.demon.co.uk/del-prgg.htm#TDT
-TDateTime   fpcrtl_time();
-
-
-// EFFECTS: return the current date
-//          http://www.merlyn.demon.co.uk/del-prgg.htm#TDT
-TDateTime   fpcrtl_date();
-#define     date                    fpcrtl_date
-#define     Date                    fpcrtl_date
-
-// EFFECTS: Trim strips blank characters (spaces) at the beginning and end of S
-// and returns the resulting string. Only #32 characters are stripped.
-// If the string contains only spaces, an empty string is returned.
-string255   fpcrtl_trim(string255 s);
-#define     trim                    fpcrtl_trim
-#define     Trim                    fpcrtl_trim
-
-Integer     fpcrtl_strToInt(string255 s);
-#define     StrToInt                fpcrtl_strToInt
-#define     strToInt                fpcrtl_strToInt
-
-string255   fpcrtl_extractFileName(string255 f);
-#define     fpcrtl_ExtractFileName  fpcrtl_extractFileName
-
-string255   fpcrtl_strPas(PChar);
-#define     fpcrtl_StrPas           fpcrtl_strPas
-
-
-#endif
--- a/project_files/hwc/rtl/types.h	Tue Nov 13 22:24:30 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-#ifndef _TYPES_H_
-#define _TYPES_H_
-
-#include "pas2c.h"
-
-/*
- * Not very useful currently
- */
-
-typedef double TDate;
-typedef double TTime;
-typedef double TDateTime;
-typedef string255 TMonthNameArray[13];
-typedef string255 TWeekNameArray[8];
-
-typedef struct {
-    Byte CurrencyFormat;
-    Byte NegCurrFormat;
-    Char ThousandSeparator;
-    Char DecimalSeparator;
-    Byte CurrencyDecimals;
-    Char DateSeparator;
-    Char TimeSeparator;
-    Char ListSeparator;
-    string255 CurrencyString;
-    string255 ShortDateFormat;
-    string255 LongDateFormat;
-    string255 TimeAMString;
-    string255 TimePMString;
-    string255 ShortTimeFormat;
-    string255 LongTimeFormat;
-    TMonthNameArray ShortMonthNames;
-    TMonthNameArray LongMonthNames;
-    TWeekNameArray ShortDayNames;
-    TWeekNameArray LongDayNames;
-    Word TwoDigitYearCenturyWindow;
-}TFormatSettings;
-
-#endif