medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit a4571a57126c1b3f3f235ad0ddd3db8f08076c1e
parent cbc23d3503666c2eae1f4a2d9038bdff30ba3101
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Thu Dec 29 00:58:49 +0200

Some #pragma once's

Diffstat:
array.h | 5+----
assets.h | 5+----
autogdb.h | 5+----
bsp.h | 5+----
bsp_renderer.h | 5+----
btt.h | 5+----
darwin_audio_output.h | 5+----
darwin_semaphore.h | 5+----
game.h | 5+----
gl.h | 5+----
gpubtt.h | 5+----
hashtable.h | 5+----
heightmap.h | 5+----
http.h | 5+----
immediate.h | 5+----
int_conversions.h | 5+----
intrinsics.h | 5+----
keys.h | 5+----
linear_algebra.h | 7++-----
linux_audio_output.h | 5+----
linux_semaphore.h | 5+----
log.h | 5+----
memory_arena.h | 5+----
mixer.h | 5+----
nonblocking_fixed_spsc_queue.h | 5+----
platform_atomic.h | 4+---
26 files changed, 27 insertions(+), 104 deletions(-)
diff --git a/array.h b/array.h @@ -1,5 +1,4 @@ -#ifndef _ARRAY_H_ -#define _ARRAY_H_ +#pragma once #include <stdlib.h> @@ -143,5 +142,3 @@ inline void visit( const array< T > & a, F f ) { f( a.n ); for( const T & x : a ) f( x ); } - -#endif // _ARRAY_H_ diff --git a/assets.h b/assets.h @@ -1,5 +1,4 @@ -#ifndef _ASSETS_H_ -#define _ASSETS_H_ +#pragma once #include "intrinsics.h" #include "renderer.h" @@ -42,5 +41,3 @@ struct Asset { SoundData sound; }; }; - -#endif // _ASSETS_H_ diff --git a/autogdb.h b/autogdb.h @@ -1,5 +1,4 @@ -#ifndef _AUTOGDB_H_ -#define _AUTOGDB_H_ +#pragma once #include <sys/ptrace.h> #include <sys/wait.h> @@ -113,5 +112,3 @@ static void install_debug_signal_handlers( bool debug_on_sigint ) { signal( SIGABRT, prompt_to_run_gdb ); signal( SIGSEGV, prompt_to_run_gdb ); } - -#endif // _AUTOGDB_H_ diff --git a/bsp.h b/bsp.h @@ -1,5 +1,4 @@ -#ifndef _BSP_H_ -#define _BSP_H_ +#pragma once #include "intrinsics.h" #include "linear_algebra.h" @@ -208,5 +207,3 @@ public: void bsp_init( BSP * bsp, const char * filename ); void bsp_destroy( BSP * bsp ); - -#endif // _BSP_H_ diff --git a/bsp_renderer.h b/bsp_renderer.h @@ -1,5 +1,4 @@ -#ifndef _BSP_RENDERER_H_ -#define _BSP_RENDERER_H_ +#pragma once #include "bsp.h" #include "memory_arena.h" @@ -14,5 +13,3 @@ struct BSPRenderer { void bspr_init( BSPRenderer * bspr, MemoryArena * arena, const BSP * bsp ); void bspr_render( const BSPRenderer * bspr, v3 pos, const RenderState & render_state ); void bspr_destroy( BSPRenderer * bspr ); - -#endif // _BSP_RENDERER_H_ diff --git a/btt.h b/btt.h @@ -1,5 +1,4 @@ -#ifndef _BTT_H_ -#define _BTT_H_ +#pragma once #include "memory_arena.h" #include "heightmap.h" @@ -21,5 +20,3 @@ struct BTTs { }; BTTs btt_from_heightmap( const Heightmap * hm, MemoryArena * arena ); - -#endif // _BTT_H_ diff --git a/darwin_audio_output.h b/darwin_audio_output.h @@ -1,5 +1,4 @@ -#ifndef _DARWIN_AUDIO_OUTPUT_H_ -#define _DARWIN_AUDIO_OUTPUT_H_ +#pragma once #include <AudioToolbox/AudioToolbox.h> @@ -8,5 +7,3 @@ struct AudioOutputDevice { AudioUnit unit; AudioOutputCallback * callback; }; - -#endif // _DARWIN_AUDIO_OUTPUT_H_ diff --git a/darwin_semaphore.h b/darwin_semaphore.h @@ -1,5 +1,4 @@ -#ifndef _DARWIN_SEMAPHORE_H_ -#define _DARWIN_SEMAPHORE_H_ +#pragma once #include <dispatch/dispatch.h> @@ -18,5 +17,3 @@ inline void semaphore_signal( Semaphore * sem ) { inline void semaphore_wait( Semaphore * sem ) { dispatch_semaphore_wait( sem->sem, DISPATCH_TIME_FOREVER ); } - -#endif // _DARWIN_SEMAPHORE_H_ diff --git a/game.h b/game.h @@ -1,5 +1,4 @@ -#ifndef _GAME_H_ -#define _GAME_H_ +#pragma once // TODO: this whole file blows #include "intrinsics.h" @@ -68,5 +67,3 @@ typedef GAME_INIT( GameInit ); #define GAME_FRAME( name ) void name( GameState * game, GameMemory * mem, const GameInput * input, double current_time, float dt ) typedef GAME_FRAME( GameFrame ); - -#endif // _GAME_H_ diff --git a/gl.h b/gl.h @@ -1,9 +1,6 @@ -#ifndef _GL_H_ -#define _GL_H_ +#pragma once struct GLFWwindow; GLFWwindow * gl_init(); void gl_term(); - -#endif // _GL_H_ diff --git a/gpubtt.h b/gpubtt.h @@ -1,5 +1,4 @@ -#ifndef _GPUBTT_H_ -#define _GPUBTT_H_ +#pragma once #include "renderer.h" #include "heightmap.h" @@ -16,5 +15,3 @@ void gpubtt_init( MemoryArena * arena, GPUBTT * gpubtt, BTTs btts, const OffsetHeightmap * ohm, const v3 * normals, const float * horizons ); void gpubtt_destroy( GPUBTT * gpubtt ); void gpubtt_render( const GPUBTT * gpubtt, RenderState render_state ); - -#endif // _GPUBTT_H_ diff --git a/hashtable.h b/hashtable.h @@ -1,5 +1,4 @@ -#ifndef _HASHTABLE_H_ -#define _HASHTABLE_H_ +#pragma once #include "intrinsics.h" @@ -106,5 +105,3 @@ private: u64 keys[ N ]; T values[ N ]; }; - -#endif // _HASHTABLE_H_ diff --git a/heightmap.h b/heightmap.h @@ -1,5 +1,4 @@ -#ifndef _HEIGHTMAP_H_ -#define _HEIGHTMAP_H_ +#pragma once #include "intrinsics.h" #include "array.h" @@ -115,5 +114,3 @@ struct AABB { }; bool ray_vs_quadtree( const HeightmapQuadTree * qt, v3 ray_origin, v3 ray_dir, v3 inv_dir, float * t, v3 * xnormal ); - -#endif // _HEIGHTMAP_H_ diff --git a/http.h b/http.h @@ -1,5 +1,4 @@ -#ifndef _HTTP_H_ -#define _HTTP_H_ +#pragma once #include <string> @@ -21,5 +20,3 @@ enum GetResult { bool dns_first( const char * host, struct sockaddr_storage * address ); GetResult http_get( const struct sockaddr_storage & address, const char * host, const char * path, std::string * body ); - -#endif // _HTTP_H_ diff --git a/immediate.h b/immediate.h @@ -1,5 +1,4 @@ -#ifndef _IMMEDIATE_H_ -#define _IMMEDIATE_H_ +#pragma once #include "linear_algebra.h" #include "renderer.h" @@ -40,5 +39,3 @@ void immediate_render( const ImmediateContext * ctx, Shader shader, Texture text void immediate_render( const ImmediateContext * ctx, const RenderState & render_state ); void immediate_clear( ImmediateContext * ctx ); - -#endif // _IMMEDIATE_H_ diff --git a/int_conversions.h b/int_conversions.h @@ -1,5 +1,4 @@ -#ifndef _INT_CONVERSIONS_H_ -#define _INT_CONVERSIONS_H_ +#pragma once #include "intrinsics.h" #include "platform_inline.h" @@ -87,5 +86,3 @@ forceinline float dequantize11s( s32 q, u32 num_bits ) { ASSERT( result < 0.0f && result >= -1.0f ); return result; } - -#endif // _INT_CONVERSIONS_H_ diff --git a/intrinsics.h b/intrinsics.h @@ -1,5 +1,4 @@ -#ifndef _INTRINSICS_H_ -#define _INTRINSICS_H_ +#pragma once #include <stdio.h> #include <stdlib.h> @@ -210,5 +209,3 @@ DEF_VISIT( float ) DEF_VISIT( double ) #undef DEF_VISIT - -#endif // _INTRINSICS_H_ diff --git a/keys.h b/keys.h @@ -1,5 +1,4 @@ -#ifndef _KEYS_H_ -#define _KEYS_H_ +#pragma once #include "intrinsics.h" @@ -104,5 +103,3 @@ enum KeyNames { KEY_COUNT, }; - -#endif // _KEYS_H_ diff --git a/linear_algebra.h b/linear_algebra.h @@ -1,10 +1,9 @@ +#pragma once + /* * vector/matrix code */ -#ifndef _LINEAR_ALGEBRA_H_ -#define _LINEAR_ALGEBRA_H_ - #include <math.h> #include "intrinsics.h" @@ -746,5 +745,3 @@ forceinline v3u32 mean( v3u32 mins, v3u32 maxs ) { } #include "visitors/linear_algebra.h" - -#endif // _LINEAR_ALGEBRA_H_ diff --git a/linux_audio_output.h b/linux_audio_output.h @@ -1,5 +1,4 @@ -#ifndef _LINUX_AUDIO_H_ -#define _LINUX_AUDIO_H_ +#pragma once #include <alsa/asoundlib.h> @@ -10,5 +9,3 @@ struct AudioOutputDevice { Thread thread; AudioOutputCallback * callback; }; - -#endif // _LINUX_AUDIO_H_ diff --git a/linux_semaphore.h b/linux_semaphore.h @@ -1,5 +1,4 @@ -#ifndef _LINUX_SEMAPHORE_H_ -#define _LINUX_SEMAPHORE_H_ +#pragma once #include <err.h> #include <semaphore.h> @@ -22,5 +21,3 @@ inline void semaphore_signal( Semaphore * sem ) { inline void semaphore_wait( Semaphore * sem ) { sem_wait( &sem->sem ); } - -#endif // _LINUX_SEMAPHORE_H_ diff --git a/log.h b/log.h @@ -1,5 +1,4 @@ -#ifndef _LOG_H_ -#define _LOG_H_ +#pragma once #include <stdlib.h> @@ -21,5 +20,3 @@ const char * logger_get_logs_dir(); #define INFO( form, ... ) logger_log( LOGLEVEL_INFO, "[INFO] [thread %u] " form "\n", thread_getid(), ##__VA_ARGS__ ) #define WARN( form, ... ) logger_log( LOGLEVEL_WARNING, "[WARN] [thread %u] " form "\n", thread_getid(), ##__VA_ARGS__ ) #define FATAL( form, ... ) do { logger_log( LOGLEVEL_FATAL, "[FATAL] [thread %u] " form "\n", thread_getid(), ##__VA_ARGS__ ); abort(); } while( 0 ) - -#endif // _LOG_H_ diff --git a/memory_arena.h b/memory_arena.h @@ -1,5 +1,4 @@ -#ifndef _MEMORY_ARENA_H_ -#define _MEMORY_ARENA_H_ +#pragma once #include "intrinsics.h" #include "array.h" @@ -44,5 +43,3 @@ MemoryArenaCheckpoint memarena_checkpoint( MemoryArena * arena ); void memarena_restore( MemoryArena * arena, MemoryArenaCheckpoint * cp ); #define MEMARENA_SCOPED_CHECKPOINT( arena ) MemoryArenaAutoCheckpoint CONCAT( mem_cp, __COUNTER__ )( arena, memarena_checkpoint( arena ) ); - -#endif // _MEMORY_ARENA_H_ diff --git a/mixer.h b/mixer.h @@ -1,5 +1,4 @@ -#ifndef _MIXER_H_ -#define _MIXER_H_ +#pragma once #define MAX_CONCURRENT_SOUNDS 1024 @@ -28,5 +27,3 @@ void mixer_stop( PlayingSoundID sound_id ); void mixer_stop_all(); // TODO: seek, set position, set playback speed/pitch - -#endif // _MIXER_H_ diff --git a/nonblocking_fixed_spsc_queue.h b/nonblocking_fixed_spsc_queue.h @@ -1,5 +1,4 @@ -#ifndef _NONBLOCKING_FIXED_SPSC_QUEUE_H_ -#define _NONBLOCKING_FIXED_SPSC_QUEUE_H_ +#pragma once #include "intrinsics.h" #include "queue.h" @@ -79,5 +78,3 @@ private: CACHE_LINE_PADDING; nonatomic( size_t ) writer_pos; }; - -#endif // _NONBLOCKING_FIXED_SPSC_QUEUE_H_ diff --git a/platform_atomic.h b/platform_atomic.h @@ -1,5 +1,4 @@ -#ifndef _PLATFORM_ATOMIC_H_ -#define _PLATFORM_ATOMIC_H_ +#pragma once #include "intrinsics.h" #include "platform.h" @@ -137,4 +136,3 @@ struct atomic_u64 { #define compare_exchange_seqcst( atom, before, after ) ( atom )->compare_exchange_strong( *( before ), after, std::memory_order_seq_cst, std::memory_order_seq_cst ) #endif // RL_TEST -#endif // _PLATFORM_ATOMIC_H_