Replace include guards with pragma once

This commit is contained in:
Jaby 2023-10-05 21:40:04 +02:00
parent 19f8303d99
commit db1bbec06e
42 changed files with 83 additions and 193 deletions

View File

@ -1,5 +1,4 @@
#ifndef __FONT_WRITER_HPP__
#define __FONT_WRITER_HPP__
#pragma once
#include "../assets.hpp"
#include <PSX/GPU/gpu.hpp>
#include <stdint.h>
@ -47,5 +46,3 @@ namespace FontWriter {
Position write(Position pos, const char* text);
};
}
#endif //!__FONT_WRITER_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __PACO_HPP__
#define __PACO_HPP__
#pragma once
#include <PSX/File/Processor/cd_file_processor.hpp>
#include <PSX/GPU/gpu.hpp>
#include <PSX/Timer/frame_timer.hpp>
@ -36,5 +35,3 @@ namespace object {
void render();
};
}
#endif //!__PACO_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __ASSETS_HPP__
#define __ASSETS_HPP__
#pragma once
#include <PSX/File/Processor/cd_file_processor.hpp>
namespace Assets {
@ -8,5 +7,3 @@ namespace Assets {
static constexpr auto FontTIM = SimpleTIM(960, 0, 960, 511);
void load_for_main();
}
#endif //!__ASSETS_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_AUTO_LBA_HPP__
#define __JABYENGINE_AUTO_LBA_HPP__
#pragma once
#include "../Auxiliary/bits.hpp"
namespace JabyEngine {
@ -40,5 +39,3 @@ namespace JabyEngine {
}
};
}
#endif //!__JABYENGINE_AUTO_LBA_HPP__

View File

@ -1,9 +1,6 @@
#ifndef __JABYENGINE_AUTO_LBA_DECLARATION_HPP__
#define __JABYENGINE_AUTO_LBA_DECLARATION_HPP__
#pragma once
extern const volatile JabyEngine::AutoLBAEntry lba[];
#define __declare_lba_header(enum_struct) \
[[gnu::used]] \
const volatile JabyEngine::AutoLBAEntry __section(".header.lbas") lba[static_cast<int>(enum_struct::EndOfRequest)] = {0}
#endif //!__JABYENGINE_AUTO_LBA_DECLARATION_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_ARRAY_RANGE_HPP__
#define __JABYENGINE_ARRAY_RANGE_HPP__
#pragma once
#include "../../stddef.h"
namespace JabyEngine {
@ -40,5 +39,3 @@ namespace JabyEngine {
}
};
}
#endif //!__JABYENGINE_ARRAY_RANGE_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_BITS_HPP__
#define __JABYENGINE_BITS_HPP__
#pragma once
#include "../jabyengine_defines.h"
#include "types.hpp"
@ -154,4 +153,3 @@ namespace JabyEngine {
}
#define __start_end_bit2_start_length(start_bit, end_bit) start_bit, (end_bit - start_bit + 1)
#endif //!__JABYENGINE_BITS_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_CIRCULAR_BUFFER_HPP__
#define __JABYENGINE_CIRCULAR_BUFFER_HPP__
#pragma once
#include "array_range.hpp"
namespace JabyEngine {
@ -60,5 +59,3 @@ namespace JabyEngine {
}
};
}
#endif //!__JABYENGINE_CIRCULAR_BUFFER_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_LZ4_DECOMPRESSOR_HPP__
#define __JABYENGINE_LZ4_DECOMPRESSOR_HPP__
#pragma once
#include "../../stddef.h"
#include "array_range.hpp"
#include "types.hpp"
@ -77,5 +76,3 @@ namespace JabyEngine {
Result process(ArrayRange<const uint8_t> data, bool is_last);
};
}
#endif //!__JABYENGINE_LZ4_DECOMPRESSOR_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_MATH_HELPER_HPP__
#define __JABYENGINE_MATH_HELPER_HPP__
#pragma once
#include "types.hpp"
namespace JabyEngine {
@ -14,5 +13,3 @@ namespace JabyEngine {
return (tenth << 4 | rest);
}
}
#endif //!__JABYENGINE_MATH_HELPER_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_TYPE_TRAITS_HPP__
#define __JABYENGINE_TYPE_TRAITS_HPP__
#pragma once
namespace JabyEngine {
template <class T, T v>
@ -77,5 +76,3 @@ namespace JabyEngine {
// #############################################
}
#endif //! __JABYENGINE_TYPE_TRAITS_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_TYPES_HPP__
#define __JABYENGINE_TYPES_HPP__
#pragma once
namespace JabyEngine {
template<typename T, typename S>
@ -32,5 +31,3 @@ namespace JabyEngine {
Error
};
}
#endif //!__JABYENGINE_TYPES_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_UNALIGNED_READ_HPP__
#define __JABYENGINE_UNALIGNED_READ_HPP__
#pragma once
#include "../../stdint.h"
namespace JabyEngine {
@ -7,5 +6,3 @@ namespace JabyEngine {
return (static_cast<uint16_t>(adr[0]) | static_cast<uint16_t>(adr[1]) << 8);
}
}
#endif //!__JABYENGINE_UNALIGNED_READ_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_CD_FILE_PROCESSOR_HPP__
#define __JABYENGINE_CD_FILE_PROCESSOR_HPP__
#pragma once
#include "../../AutoLBA/auto_lba.hpp"
#include "../../Auxiliary/circular_buffer.hpp"
#include "../../Auxiliary/lz4_decompressor.hpp"
@ -67,5 +66,3 @@ namespace JabyEngine {
}
};
}
#endif //!__JABYENGINE_CD_FILE_PROCESSOR_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_FILE_PROCESSOR_HPP__
#define __JABYENGINE_FILE_PROCESSOR_HPP__
#pragma once
#include "../../Auxiliary/types.hpp"
#include "../file_types.hpp"
@ -56,4 +55,3 @@ namespace JabyEngine {
State create(const uint32_t* data_adr, const SimpleTIM& file);
}
}
#endif // !__JABYENGINE_FILE_PROCESSOR_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_CD_FILE_TYPES_HPP__
#define __JABYENGINE_CD_FILE_TYPES_HPP__
#pragma once
#include "../Overlay/overlay.hpp"
#include "file_types.hpp"
@ -40,4 +39,3 @@ namespace JabyEngine {
}
};
}
#endif //!__JABYENGINE_CD_FILE_TYPES_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_FILE_TYPES_HPP__
#define __JABYENGINE_FILE_TYPES_HPP__
#pragma once
#include "../Auxiliary/bits.hpp"
#include "../GPU/gpu_types.hpp"
#include "../jabyengine_defines.h"
@ -54,4 +53,3 @@ namespace JabyEngine {
typedef CopyTo Overlay;
}
#endif // !__JABYENGINE_FILE_TYPES_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_LINKED_ELEMENTS_HPP__
#define __JABYENGINE_LINKED_ELEMENTS_HPP__
#pragma once
#include "../../Auxiliary/bits.hpp"
namespace JabyEngine {
@ -90,5 +89,3 @@ namespace JabyEngine {
}
}
}
#endif // !__JABYENGINE_LINKED_ELEMENTS_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_PRIMITIVE_GPU_COMMANDS_HPP__
#define __JABYENGINE_PRIMITIVE_GPU_COMMANDS_HPP__
#pragma once
#include "../../System/IOPorts/gpu_io.hpp"
#include "linked_elements.hpp"
#include "primitive_support_types.hpp"
@ -17,5 +16,3 @@ namespace JabyEngine {
};
}
}
#endif // !__JABYENGINE_PRIMITIVE_GPU_COMMANDS_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_PRIMITIVE_LINE_TYPES_HPP__
#define __JABYENGINE_PRIMITIVE_LINE_TYPES_HPP__
#pragma once
#include "linked_elements.hpp"
#include "primitive_support_types.hpp"
@ -108,5 +107,3 @@ namespace JabyEngine {
};
}
}
#endif //!__JABYENGINE_PRIMITIVE_LINE_TYPES_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_PRIMITIVE_POLY_TYPES_HPP__
#define __JABYENGINE_PRIMITIVE_POLY_TYPES_HPP__
#pragma once
#include "linked_elements.hpp"
#include "primitive_support_types.hpp"
@ -367,4 +366,3 @@ namespace JabyEngine {
static_assert(sizeof(POLY_GT4) == 48);
}
}
#endif // !__JABYENGINE_PRIMITIVE_POLY_TYPES_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_PRIMITIVE_RECTANGLE_TYPES_HPP__
#define __JABYENGINE_PRIMITIVE_RECTANGLE_TYPES_HPP__
#pragma once
#include "linked_elements.hpp"
#include "primitive_support_types.hpp"
@ -127,5 +126,3 @@ namespace JabyEngine {
};
}
}
#endif //!__JABYENGINE_PRIMITIVE_RECTANGLE_TYPES_HPP__

View File

@ -1,10 +1,8 @@
#ifndef __JABYENGINE_PRIMITIVE_SUPPORT_TYPES_HPP__
#define __JABYENGINE_PRIMITIVE_SUPPORT_TYPES_HPP__
#pragma once
#include "../../Auxiliary/type_traits.hpp"
#include "../../System/IOPorts/gpu_io.hpp"
#include "../gpu_types.hpp"
namespace JabyEngine {
namespace GPU {
namespace internal {
@ -90,5 +88,3 @@ namespace JabyEngine {
};
}
}
#endif //!__JABYENGINE_PRIMITIVE_SUPPORT_TYPES_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_GPU_HPP__
#define __JABYENGINE_GPU_HPP__
#pragma once
#include "../Auxiliary/type_traits.hpp"
#include "../System/IOPorts/gpu_io.hpp"
#include "gpu_primitives.hpp"
@ -61,4 +60,3 @@ namespace JabyEngine {
uint8_t swap_buffers_vsync(uint8_t syncs, bool clear_screen = true);
}
}
#endif //!__JABYENGINE_GPU_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_GPU_PRIMITIVES_HPP__
#define __JABYENGINE_GPU_PRIMITIVES_HPP__
#pragma once
#include "../Auxiliary/literals.hpp"
#include "Primitives/primitive_gpu_commands.hpp"
#include "Primitives/primitive_line_types.hpp"
@ -313,5 +312,3 @@ namespace JabyEngine {
}
}
}
#endif // !__JABYENGINE_GPU_PRIMITIVES_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_GPU_TYPES_HPP__
#define __JABYENGINE_GPU_TYPES_HPP__
#pragma once
#include "../Auxiliary/bits.hpp"
#include "../jabyengine_defines.h"
@ -223,4 +222,3 @@ namespace JabyEngine {
};
}
}
#endif //!__JABYENGINE_GPU_TYPES_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_OVERLAY__HPP__
#define __JABYENGINE_OVERLAY__HPP__
#pragma once
#include "../AutoLBA/auto_lba.hpp"
namespace JabyEngine {
@ -8,4 +7,3 @@ namespace JabyEngine {
// Can be used to create dummy values to trick LZ4 into compressing an uncompressed overlay
#define __create_dummy_fill(length) static const uint8_t __section(".keep.dummy") __used DummyFilling[length] = {0x0}
}
#endif //!__JABYENGINE_OVERLAY__HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_OVERLAY_DECLARATION__HPP__
#define __JABYENGINE_OVERLAY_DECLARATION__HPP__
#pragma once
// No include here because this header should be included in a namespace and we don't want multiple namespace definitions of OverlayHeader and OverlayLBA
@ -7,4 +6,3 @@
#define __declare_overlay_header(function, enum_struct) \
__declare_lba_header(enum_struct)
#endif //!__JABYENGINE_OVERLAY_DECLARATION__HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_CD_IO_HPP__
#define __JABYENGINE_CD_IO_HPP__
#pragma once
#include "ioport.hpp"
namespace JabyEngine {
@ -233,5 +232,3 @@ namespace JabyEngine {
#undef __declare_index_io_port_const
}
}
#endif //!__JABYENGINE_CD_IO_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_DMA_IO_HPP__
#define __JABYENGINE_DMA_IO_HPP__
#pragma once
#include "ioport.hpp"
namespace JabyEngine {
@ -152,4 +151,3 @@ namespace JabyEngine {
__declare_io_port(, DICR, 0x1F8010F4);
}
}
#endif //!__JABYENGINE_DMA_IO_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_GPU_IO_HPP__
#define __JABYENGINE_GPU_IO_HPP__
#pragma once
#include "ioport.hpp"
#include "../../GPU/gpu_types.hpp"
#include <stdio.h>
@ -224,4 +223,3 @@ namespace JabyEngine {
__declare_io_port(const, GPUSTAT, 0x1F801814);
}
}
#endif //!__JABYENGINE_GPU_IO_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_INTERRUPT_IO_HPP__
#define __JABYENGINE_INTERRUPT_IO_HPP__
#pragma once
#include "ioport.hpp"
namespace JabyEngine {
@ -43,5 +42,3 @@ namespace JabyEngine {
}
};
}
#endif //!__JABYENGINE_INTERRUPT_IO_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_IOPORT_HPP__
#define __JABYENGINE_IOPORT_HPP__
#pragma once
#include "../../Auxiliary/types.hpp"
#include "../../Auxiliary/bits.hpp"
@ -117,4 +116,3 @@ namespace JabyEngine {
#define __declare_io_port(cv, name, adr) __declare_io_port_w_type(cv, struct name, name, adr)
#define __declare_io_port_array(cv, name, size, adr) __declare_array_at(cv, struct name, name, size, adr)
}
#endif //!__JABYENGINE_IOPORT_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_MEMORY_IO_HPP__
#define __JABYENGINE_MEMORY_IO_HPP__
#pragma once
#include "ioport.hpp"
namespace JabyEngine {
@ -20,5 +19,3 @@ namespace JabyEngine {
__declare_io_port(, CD_DELAY, 0x1F801018);
}
}
#endif //!__JABYENGINE_MEMORY_IO_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_SPU_IO_HPP__
#define __JABYENGINE_SPU_IO_HPP__
#pragma once
#include "ioport.hpp"
namespace JabyEngine {
@ -166,4 +165,3 @@ namespace JabyEngine {
__declare_io_port_array(, Voice, VoiceCount, 0x1F801C00);
}
}
#endif //!__JABYENGINE_SPU_IO_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_TIMER_IO_HPP__
#define __JABYENGINE_TIMER_IO_HPP__
#pragma once
#include "ioport.hpp"
namespace JabyEngine {
@ -112,5 +111,3 @@ namespace JabyEngine {
__declare_value_at(, struct Counter2, Counter2, counter_base_adr(2));
}
}
#endif //!__JABYENGINE_TIMER_IO_HPP__

View File

@ -1,8 +1,6 @@
#ifndef __JABYENGINE_SCRATCHPAD_HPP__
#define __JABYENGINE_SCRATCHPAD_HPP__
#pragma once
#include "../jabyengine_defines.h"
namespace JabyEngine {
static __always_inline auto& ScratchPad = reinterpret_cast<uint8_t(&)[1024]>(*reinterpret_cast<uint8_t*>(0x1F800000));
}
#endif //!__JABYENGINE_SCRATCHPAD_HPP__

View File

@ -1,9 +1,6 @@
#ifndef __JABYENGINE__HPP__
#define __JABYENGINE__HPP__
#pragma once
#include "jabyengine_defines.h"
namespace JabyEngine {
typedef void (*MainRoutine)();
}
#endif //!__JABYENGINE__HPP__

View File

@ -1,5 +1,4 @@
#ifndef BOOT_LOADER_HPP
#define BOOT_LOADER_HPP
#pragma once
#include "color_debug.hpp"
#include <PSX/jabyengine.hpp>
@ -26,4 +25,3 @@ namespace JabyEngine {
void __no_return run();
}
#endif //!BOOT_LOADER_HPP

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_CD_INTERNAL_HPP__
#define __JABYENGINE_CD_INTERNAL_HPP__
#pragma once
#include "cd_types.hpp"
namespace JabyEngine {
@ -49,4 +48,3 @@ namespace JabyEngine {
}
}
}
#endif //!__JABYENGINE_CD_INTERNAL_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_INTERNAL_CD_TYPES_HPP__
#define __JABYENGINE_INTERNAL_CD_TYPES_HPP__
#pragma once
#include <PSX/AutoLBA/auto_lba.hpp>
#include <PSX/Auxiliary/math_helper.hpp>
#include <PSX/System/IOPorts/cd_io.hpp>
@ -74,4 +73,3 @@ namespace JabyEngine {
}
}
}
#endif //!__JABYENGINE_INTERNAL_CD_TYPES_HPP__

View File

@ -1,5 +1,4 @@
#ifndef __JABYENGINE_GPU_INTERNAL_HPP__
#define __JABYENGINE_GPU_INTERNAL_HPP__
#pragma once
#include <PSX/GPU/gpu.hpp>
#include <PSX/System/IOPorts/dma_io.hpp>
#include <PSX/System/IOPorts/gpu_io.hpp>
@ -101,5 +100,3 @@ namespace JabyEngine {
}
}
}
#endif //!__JABYENGINE_GPU_INTERNAL_HPP__