Browse Source

Replacing most C library dependencies with equivalent dependencies in C++.

David Piuva 1 year ago
parent
commit
906b9fef5a
39 changed files with 45 additions and 45 deletions
  1. 1 1
      Source/DFPSR/api/bufferAPI.h
  2. 1 1
      Source/DFPSR/api/stringAPI.h
  3. 1 1
      Source/DFPSR/api/timeAPI.cpp
  4. 1 1
      Source/DFPSR/api/types.h
  5. 1 1
      Source/DFPSR/base/SafePointer.h
  6. 3 3
      Source/DFPSR/base/allocator.cpp
  7. 1 1
      Source/DFPSR/base/endian.h
  8. 1 1
      Source/DFPSR/base/simd.h
  9. 1 1
      Source/DFPSR/collection/List.h
  10. 1 1
      Source/DFPSR/collection/collections.h
  11. 1 1
      Source/DFPSR/font/Font.cpp
  12. 1 1
      Source/DFPSR/gui/BackendWindow.h
  13. 1 1
      Source/DFPSR/gui/FlexRegion.h
  14. 1 1
      Source/DFPSR/gui/VisualComponent.cpp
  15. 1 1
      Source/DFPSR/gui/VisualTheme.cpp
  16. 1 1
      Source/DFPSR/gui/components/Button.cpp
  17. 1 1
      Source/DFPSR/gui/components/Label.cpp
  18. 1 1
      Source/DFPSR/image/Color.h
  19. 1 1
      Source/DFPSR/image/Image.h
  20. 1 1
      Source/DFPSR/image/ImageLoader.h
  21. 1 1
      Source/DFPSR/image/PackOrder.h
  22. 1 1
      Source/DFPSR/machine/VirtualMachine.h
  23. 1 1
      Source/DFPSR/math/FPlane3D.h
  24. 2 2
      Source/DFPSR/math/IRect.h
  25. 2 2
      Source/DFPSR/math/vectorMethods.h
  26. 1 1
      Source/DFPSR/render/Camera.h
  27. 1 1
      Source/DFPSR/render/ITriangle2D.h
  28. 1 1
      Source/DFPSR/render/ProjectedPoint.h
  29. 1 1
      Source/DFPSR/render/model/Model.h
  30. 1 1
      Source/DFPSR/render/renderCore.h
  31. 2 2
      Source/DFPSR/render/shader/RgbaMultiply.h
  32. 1 1
      Source/DFPSR/render/shader/Shader.h
  33. 1 1
      Source/DFPSR/render/shader/fillerTemplates.h
  34. 1 1
      Source/DFPSR/render/shader/shaderMethods.h
  35. 2 2
      Source/DFPSR/render/shader/shaderTypes.h
  36. 1 1
      Source/SDK/SpriteEngine/lightAPI.h
  37. 1 1
      Source/SDK/SpriteEngine/spriteAPI.h
  38. 1 1
      Source/SDK/sandbox/sandbox.cpp
  39. 1 1
      Source/SDK/sandbox/tool.cpp

+ 1 - 1
Source/DFPSR/api/bufferAPI.h

@@ -24,7 +24,7 @@
 #ifndef DFPSR_API_BUFFER
 #define DFPSR_API_BUFFER
 
-#include <stdint.h>
+#include <cstdint>
 #include <memory>
 #include <functional>
 #include "../base/SafePointer.h"

+ 1 - 1
Source/DFPSR/api/stringAPI.h

@@ -24,7 +24,7 @@
 #ifndef DFPSR_API_STRING
 #define DFPSR_API_STRING
 
-#include <stdint.h>
+#include <cstdint>
 #include <string>
 #include <iostream>
 #include <sstream>

+ 1 - 1
Source/DFPSR/api/timeAPI.cpp

@@ -24,7 +24,7 @@
 #include "timeAPI.h"
 #include <chrono>
 #include <thread>
-#include <stdint.h>
+#include <cstdint>
 
 static bool started = false;
 static std::chrono::time_point<std::chrono::steady_clock> startTime;

+ 1 - 1
Source/DFPSR/api/types.h

@@ -25,7 +25,7 @@
 #ifndef DFPSR_API_TYPES
 #define DFPSR_API_TYPES
 
-#include <stdint.h>
+#include <cstdint>
 #include <memory>
 #include "../image/Color.h"
 #include "../math/IRect.h"

+ 1 - 1
Source/DFPSR/base/SafePointer.h

@@ -43,7 +43,7 @@
 
 #include <cstring>
 #include <cassert>
-#include <stdint.h>
+#include <cstdint>
 
 // Disabled in release mode
 #ifndef NDEBUG

+ 3 - 3
Source/DFPSR/base/allocator.cpp

@@ -3,9 +3,9 @@
 // or by defining DISABLE_ALLOCATOR (usually with a -DDISABLE_ALLOCATOR compiler flag).
 #ifndef DISABLE_ALLOCATOR
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
 #include <mutex>
 
 static std::mutex allocationLock;

+ 1 - 1
Source/DFPSR/base/endian.h

@@ -36,7 +36,7 @@
 
 #ifndef DFPSR_ENDIAN
 #define DFPSR_ENDIAN
-	#include <stdint.h>
+	#include <cstdint>
 	// TODO: Detect endianness automatically
 	#ifdef DSR_BIG_ENDIAN
 		// TODO: Not yet tested on a big-endian machine!

+ 1 - 1
Source/DFPSR/base/simd.h

@@ -81,7 +81,7 @@
 
 #ifndef DFPSR_SIMD
 #define DFPSR_SIMD
-	#include <stdint.h>
+	#include <cstdint>
 	#include <cassert>
 	#include "SafePointer.h"
 	#include "../math/FVector.h"

+ 1 - 1
Source/DFPSR/collection/List.h

@@ -26,7 +26,7 @@
 #define DFPSR_COLLECTION_LIST
 
 #include "collections.h"
-#include <stdint.h>
+#include <cstdint>
 #include <vector>
 #include <algorithm>
 

+ 1 - 1
Source/DFPSR/collection/collections.h

@@ -27,7 +27,7 @@
 #ifndef DFPSR_COLLECTIONS
 #define DFPSR_COLLECTIONS
 
-#include <stdint.h>
+#include <cstdint>
 
 namespace dsr {
 

+ 1 - 1
Source/DFPSR/font/Font.cpp

@@ -21,7 +21,7 @@
 //    3. This notice may not be removed or altered from any source
 //    distribution.
 
-#include <stdint.h>
+#include <cstdint>
 #include "Font.h"
 #include "../api/imageAPI.h"
 #include "../api/drawAPI.h"

+ 1 - 1
Source/DFPSR/gui/BackendWindow.h

@@ -24,7 +24,7 @@
 #ifndef DFPSR_BACKEND_WINDOW
 #define DFPSR_BACKEND_WINDOW
 
-#include <stdint.h>
+#include <cstdint>
 #include <memory>
 #include "InputEvent.h"
 #include "../image/ImageRgbaU8.h"

+ 1 - 1
Source/DFPSR/gui/FlexRegion.h

@@ -24,7 +24,7 @@
 #ifndef DFPSR_GUI_FLEXREGION
 #define DFPSR_GUI_FLEXREGION
 
-#include <stdint.h>
+#include <cstdint>
 #include "../math/IVector.h"
 #include "../math/IRect.h"
 #include "../math/scalar.h"

+ 1 - 1
Source/DFPSR/gui/VisualComponent.cpp

@@ -21,7 +21,7 @@
 //    3. This notice may not be removed or altered from any source
 //    distribution.
 
-#include <stdint.h>
+#include <cstdint>
 #include "VisualComponent.h"
 #include "../image/internal/imageInternal.h"
 

+ 1 - 1
Source/DFPSR/gui/VisualTheme.cpp

@@ -21,7 +21,7 @@
 //    3. This notice may not be removed or altered from any source
 //    distribution.
 
-#include <stdint.h>
+#include <cstdint>
 #include "VisualTheme.h"
 #include "../api/fileAPI.h"
 #include "../api/imageAPI.h"

+ 1 - 1
Source/DFPSR/gui/components/Button.cpp

@@ -22,7 +22,7 @@
 //    distribution.
 
 #include "Button.h"
-#include <math.h>
+#include <cmath>
 
 using namespace dsr;
 

+ 1 - 1
Source/DFPSR/gui/components/Label.cpp

@@ -22,7 +22,7 @@
 //    distribution.
 
 #include "Label.h"
-#include <math.h>
+#include <cmath>
 
 using namespace dsr;
 

+ 1 - 1
Source/DFPSR/image/Color.h

@@ -24,7 +24,7 @@
 #ifndef DFPSR_IMAGE_COLOR
 #define DFPSR_IMAGE_COLOR
 
-#include <stdint.h>
+#include <cstdint>
 #include "../api/stringAPI.h"
 
 namespace dsr {

+ 1 - 1
Source/DFPSR/image/Image.h

@@ -25,7 +25,7 @@
 #define DFPSR_IMAGE
 
 #include <cassert>
-#include <stdint.h>
+#include <cstdint>
 #include "../base/SafePointer.h"
 #include "../api/bufferAPI.h"
 #include "../math/scalar.h"

+ 1 - 1
Source/DFPSR/image/ImageLoader.h

@@ -26,7 +26,7 @@
 
 #include "ImageRgbaU8.h"
 #include "../base/text.h"
-#include <stdio.h>
+#include <cstdio>
 
 namespace dsr {
 

+ 1 - 1
Source/DFPSR/image/PackOrder.h

@@ -24,7 +24,7 @@
 #ifndef DFPSR_IMAGE_PACK_ORDER
 #define DFPSR_IMAGE_PACK_ORDER
 
-#include <stdint.h>
+#include <cstdint>
 #include "../api/types.h"
 #include "../base/simd.h"
 #include "../base/endian.h"

+ 1 - 1
Source/DFPSR/machine/VirtualMachine.h

@@ -24,7 +24,7 @@
 #ifndef DFPSR_VIRTUAL_MACHINE
 #define DFPSR_VIRTUAL_MACHINE
 
-#include <stdint.h>
+#include <cstdint>
 #include "../math/FixedPoint.h"
 #include "../collection/Array.h"
 #include "../collection/List.h"

+ 1 - 1
Source/DFPSR/math/FPlane3D.h

@@ -24,7 +24,7 @@
 #ifndef DFPSR_GEOMETRY_FPLANE3D
 #define DFPSR_GEOMETRY_FPLANE3D
 
-#include <math.h>
+#include <cmath>
 #include "FVector.h"
 
 namespace dsr {

+ 2 - 2
Source/DFPSR/math/IRect.h

@@ -24,8 +24,8 @@
 #ifndef DFPSR_GEOMETRY_IRECT
 #define DFPSR_GEOMETRY_IRECT
 
-#include <stdint.h>
-#include <math.h>
+#include <cstdint>
+#include <cmath>
 #include <algorithm>
 #include "IVector.h"
 

+ 2 - 2
Source/DFPSR/math/vectorMethods.h

@@ -24,9 +24,9 @@
 #ifndef DFPSR_GEOMETRY_VECTOR_METHODS
 #define DFPSR_GEOMETRY_VECTOR_METHODS
 
-#include <stdint.h>
+#include <cstdint>
 #include <cassert>
-#include <math.h>
+#include <cmath>
 #include "../api/stringAPI.h"
 
 // Since using templates for vector operands may include unwanted function

+ 1 - 1
Source/DFPSR/render/Camera.h

@@ -24,7 +24,7 @@
 #ifndef DFPSR_RENDER_CAMERA
 #define DFPSR_RENDER_CAMERA
 
-#include <stdint.h>
+#include <cstdint>
 #include <cassert>
 #include "../math/FVector.h"
 #include "../math/LVector.h"

+ 1 - 1
Source/DFPSR/render/ITriangle2D.h

@@ -24,7 +24,7 @@
 #ifndef DFPSR_RENDER_ITRIANGLE2D
 #define DFPSR_RENDER_ITRIANGLE2D
 
-#include <stdint.h>
+#include <cstdint>
 #include <cassert>
 #include "ProjectedPoint.h"
 #include "../math/FVector.h"

+ 1 - 1
Source/DFPSR/render/ProjectedPoint.h

@@ -24,7 +24,7 @@
 #ifndef DFPSR_RENDER_PROJECTEDPOINT
 #define DFPSR_RENDER_PROJECTEDPOINT
 
-#include <stdint.h>
+#include <cstdint>
 #include "../math/FVector.h"
 #include "../math/LVector.h"
 

+ 1 - 1
Source/DFPSR/render/model/Model.h

@@ -24,7 +24,7 @@
 #ifndef DFPSR_RENDER_MODEL_POLYGONMODEL
 #define DFPSR_RENDER_MODEL_POLYGONMODEL
 
-#include <stdint.h>
+#include <cstdint>
 #include "../../api/types.h"
 #include "../../collection/List.h"
 #include "../../api/stringAPI.h"

+ 1 - 1
Source/DFPSR/render/renderCore.h

@@ -24,7 +24,7 @@
 #ifndef DFPSR_RENDER_MODEL_RENDERCORE
 #define DFPSR_RENDER_MODEL_RENDERCORE
 
-#include <stdint.h>
+#include <cstdint>
 #include "Camera.h"
 #include "shader/Shader.h"
 #include "../image/ImageRgbaU8.h"

+ 2 - 2
Source/DFPSR/render/shader/RgbaMultiply.h

@@ -24,8 +24,8 @@
 #ifndef DFPSR_RENDER_SHADER_RGBA_MULTIPLY
 #define DFPSR_RENDER_SHADER_RGBA_MULTIPLY
 
-#include <stdio.h>
-#include <stdint.h>
+#include <cstdio>
+#include <cstdint>
 #include <cassert>
 #include <algorithm>
 #include "Shader.h"

+ 1 - 1
Source/DFPSR/render/shader/Shader.h

@@ -24,7 +24,7 @@
 #ifndef DFPSR_RENDER_RENDERING
 #define DFPSR_RENDER_RENDERING
 
-#include <stdint.h>
+#include <cstdint>
 #include "../../image/PackOrder.h"
 #include "../../image/ImageRgbaU8.h"
 #include "../../image/ImageF32.h"

+ 1 - 1
Source/DFPSR/render/shader/fillerTemplates.h

@@ -24,7 +24,7 @@
 #ifndef DFPSR_RENDER_FILLER_TEMPLATES
 #define DFPSR_RENDER_FILLER_TEMPLATES
 
-#include <stdint.h>
+#include <cstdint>
 #include "../../image/PackOrder.h"
 #include "../../image/ImageRgbaU8.h"
 #include "../../image/ImageF32.h"

+ 1 - 1
Source/DFPSR/render/shader/shaderMethods.h

@@ -24,7 +24,7 @@
 #ifndef DFPSR_RENDER_SHADER_METHODS
 #define DFPSR_RENDER_SHADER_METHODS
 
-#include <stdint.h>
+#include <cstdint>
 #include "../../math/FVector.h"
 #include "../../math/scalar.h"
 #include "../../base/simd3D.h"

+ 2 - 2
Source/DFPSR/render/shader/shaderTypes.h

@@ -24,8 +24,8 @@
 #ifndef DFPSR_RENDER_SHADER_TYPES
 #define DFPSR_RENDER_SHADER_TYPES
 
-#include <stdint.h>
-#include <stdio.h>
+#include <cstdint>
+#include <cstdio>
 #include "../../base/simd.h"
 #include "../../image/PackOrder.h"
 

+ 1 - 1
Source/SDK/SpriteEngine/lightAPI.h

@@ -2,7 +2,7 @@
 #ifndef DFPSR_DEFERRED_LIGHT_ENGINE
 #define DFPSR_DEFERRED_LIGHT_ENGINE
 
-#include <assert.h>
+#include <cassert>
 #include "../../DFPSR/includeFramework.h"
 #include "orthoAPI.h"
 

+ 1 - 1
Source/SDK/SpriteEngine/spriteAPI.h

@@ -5,7 +5,7 @@
 #include "../../DFPSR/includeFramework.h"
 #include "orthoAPI.h"
 #include "lightAPI.h"
-#include <assert.h>
+#include <cassert>
 #include <limits>
 
 namespace dsr {

+ 1 - 1
Source/SDK/sandbox/sandbox.cpp

@@ -96,7 +96,7 @@ LATER:
 #include "../../DFPSR/includeFramework.h"
 #include "../SpriteEngine/spriteAPI.h"
 #include "../SpriteEngine/importer.h"
-#include <assert.h>
+#include <cassert>
 #include <limits>
 
 using namespace dsr;

+ 1 - 1
Source/SDK/sandbox/tool.cpp

@@ -1,5 +1,5 @@
 
-#include <assert.h>
+#include <cassert>
 #include <limits>
 #include <functional>
 #include "../../DFPSR/includeFramework.h"