replace VG_STATIC -> static
authorhgn <hgodden00@gmail.com>
Fri, 29 Sep 2023 12:33:33 +0000 (13:33 +0100)
committerhgn <hgodden00@gmail.com>
Fri, 29 Sep 2023 12:33:33 +0000 (13:33 +0100)
20 files changed:
submodules/SDL_GameControllerDB
submodules/anyascii
submodules/qoi
submodules/stb
vg.h
vg_async.h
vg_audio.h
vg_console.h
vg_graph.h
vg_imgui.h
vg_input.h
vg_io.h
vg_lines.h
vg_loader.h
vg_m.h
vg_mem.h
vg_platform.h
vg_profiler.h
vg_shader.h
vg_tex.h

index 6ed8d054340ee8a93a684e11360b66cd8a5c168e..c5b4df0e1061175cb11e3ebbf8045178339864a5 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 6ed8d054340ee8a93a684e11360b66cd8a5c168e
+Subproject commit c5b4df0e1061175cb11e3ebbf8045178339864a5
index 44e971c774d9ec67ca6c1f16c5a476724821ab63..eb5332d0b5e48d58397e6f27475a18e058330d23 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 44e971c774d9ec67ca6c1f16c5a476724821ab63
+Subproject commit eb5332d0b5e48d58397e6f27475a18e058330d23
index b8d77df1e80b652a57f0b7270449b179a6b91f40..dfc056e813c98d307238d35f7f041a725d699dfc 160000 (submodule)
@@ -1 +1 @@
-Subproject commit b8d77df1e80b652a57f0b7270449b179a6b91f40
+Subproject commit dfc056e813c98d307238d35f7f041a725d699dfc
index 8b5f1f37b5b75829fc72d38e7b5d4bcbf8a26d55..5736b15f7ea0ffb08dd38af21067c314d6a3aae9 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 8b5f1f37b5b75829fc72d38e7b5d4bcbf8a26d55
+Subproject commit 5736b15f7ea0ffb08dd38af21067c314d6a3aae9
diff --git a/vg.h b/vg.h
index a89efaf7569fc2f19d5ed55f999f7a6245079b21..4b8956a1989c7cd5ff7ba57d7b65712a606de78a 100644 (file)
--- a/vg.h
+++ b/vg.h
   #endif
 
 /* API */
-VG_STATIC void vg_enter( int argc, char *argv[], const char *window_name );
+static void vg_enter( int argc, char *argv[], const char *window_name );
 
 /* Thread 1 */
-VG_STATIC void vg_preload(void);
-VG_STATIC void vg_load(void);
+static void vg_preload(void);
+static void vg_load(void);
 
 /* Main thread */
-VG_STATIC void vg_launch_opt(void);
-VG_STATIC void vg_start(void);
+static void vg_launch_opt(void);
+static void vg_start(void);
 
-VG_STATIC void vg_framebuffer_resize(int w, int h);
-VG_STATIC void vg_pre_update(void);
-VG_STATIC void vg_fixed_update(void);
-VG_STATIC void vg_post_update(void);
+static void vg_framebuffer_resize(int w, int h);
+static void vg_pre_update(void);
+static void vg_fixed_update(void);
+static void vg_post_update(void);
 
-VG_STATIC void vg_render(void);
-VG_STATIC void vg_gui(void);
+static void vg_render(void);
+static void vg_gui(void);
 
 struct vg{
    /* Engine sync */
@@ -174,7 +174,7 @@ struct vg{
 
    float loader_ring;
 }
-VG_STATIC vg = { .time_rate = 1.0 };
+static vg = { .time_rate = 1.0 };
 const char *vg_get_basepath(void){
    return vg.base_path;
 }
@@ -188,7 +188,7 @@ enum vg_thread_purpose
 
 #include "vg_async.h"
 
-VG_STATIC enum engine_status _vg_engine_status(void)
+static enum engine_status _vg_engine_status(void)
 {
    SDL_AtomicLock( &vg.sl_status );
    enum engine_status status = vg.engine_status;
@@ -197,7 +197,7 @@ VG_STATIC enum engine_status _vg_engine_status(void)
    return status;
 }
 
-VG_STATIC enum vg_thread_purpose vg_thread_purpose(void)
+static enum vg_thread_purpose vg_thread_purpose(void)
 {
    SDL_AtomicLock( &vg.sl_status );
 
@@ -211,7 +211,7 @@ VG_STATIC enum vg_thread_purpose vg_thread_purpose(void)
    }
 }
 
-VG_STATIC void vg_assert_thread( enum vg_thread_purpose required ){
+static void vg_assert_thread( enum vg_thread_purpose required ){
    enum vg_thread_purpose purpose = vg_thread_purpose();
 
    if( purpose != required ){
@@ -219,12 +219,12 @@ VG_STATIC void vg_assert_thread( enum vg_thread_purpose required ){
    }
 }
 
-VG_STATIC void _vg_opengl_sync_init(void)
+static void _vg_opengl_sync_init(void)
 {
    vg.sem_loader = SDL_CreateSemaphore(1);
 }
 
-VG_STATIC void vg_checkgl( const char *src_info );
+static void vg_checkgl( const char *src_info );
 #define VG_STRINGIT( X ) #X
 #define VG_CHECK_GL_ERR() vg_checkgl( __FILE__ ":L" VG_STRINGIT(__LINE__) )
 
@@ -242,11 +242,11 @@ VG_STATIC void vg_checkgl( const char *src_info );
 #include "vg_opt.h"
 
 /* Diagnostic */
-VG_STATIC struct vg_profile vg_prof_update = {.name="update()"},
+static struct vg_profile vg_prof_update = {.name="update()"},
                             vg_prof_render = {.name="render()"},
                             vg_prof_swap   = {.name="swap"};
 
-VG_STATIC void vg_checkgl( const char *src_info )
+static void vg_checkgl( const char *src_info )
 {
    int fail = 0;
 
@@ -260,12 +260,12 @@ VG_STATIC void vg_checkgl( const char *src_info )
       vg_fatal_error( "OpenGL Error" );
 }
 
-VG_STATIC void async_vg_bake_shaders( void *payload, u32 size )
+static void async_vg_bake_shaders( void *payload, u32 size )
 {
    vg_shaders_compile();
 }
 
-VG_STATIC void vg_bake_shaders(void)
+static void vg_bake_shaders(void)
 {
    vg_console_reg_cmd( "reload_shaders", vg_shaders_live_recompile, NULL );
    vg_async_call( async_vg_bake_shaders, NULL, 0 );
@@ -287,7 +287,7 @@ void async_internal_complete( void *payload, u32 size )
    SDL_AtomicUnlock( &vg.sl_status );
 }
 
-VG_STATIC void _vg_load_full( void *data )
+static void _vg_load_full( void *data )
 {
    vg_preload();
 
@@ -305,7 +305,7 @@ VG_STATIC void _vg_load_full( void *data )
    vg_load();
 }
 
-VG_STATIC void _vg_process_events(void)
+static void _vg_process_events(void)
 {
    v2_zero( vg.mouse_wheel );
    v2_zero( vg.mouse_delta );
@@ -393,7 +393,7 @@ VG_STATIC void _vg_process_events(void)
    vg.mouse_pos[1] += vg.mouse_delta[1];
 }
 
-VG_STATIC void _vg_gameloop_update(void)
+static void _vg_gameloop_update(void)
 {
    vg_profile_begin( &vg_prof_update );
 
@@ -425,7 +425,7 @@ VG_STATIC void _vg_gameloop_update(void)
    vg_profile_end( &vg_prof_update );
 }
 
-VG_STATIC void _vg_gameloop_render(void)
+static void _vg_gameloop_render(void)
 {
    vg_profile_begin( &vg_prof_render );
 
@@ -487,7 +487,7 @@ VG_STATIC void _vg_gameloop_render(void)
    vg_profile_end( &vg_prof_render );
 }
 
-VG_STATIC int vg_framefilter( double dt )
+static int vg_framefilter( double dt )
 {
    if( (vg.fps_limit <= 0) && (vg.vsync_feature != k_vsync_feature_error) ){
       /* turn on vsync if not enabled */
@@ -553,7 +553,7 @@ VG_STATIC int vg_framefilter( double dt )
    return 0;
 }
 
-VG_STATIC int _vg_crashscreen(void)
+static int _vg_crashscreen(void)
 {
 #if 0
    if( vg_getkey( SDLK_ESCAPE ) )
@@ -575,7 +575,7 @@ VG_STATIC int _vg_crashscreen(void)
    return 0;
 }
 
-VG_STATIC void _vg_gameloop(void){
+static void _vg_gameloop(void){
    //vg.time_fixed_accumulator = 0.75f * (1.0f/60.0f);
 
    vg.time_hp = SDL_GetPerformanceCounter();
@@ -635,7 +635,7 @@ VG_STATIC void _vg_gameloop(void){
    }
 }
 
-VG_STATIC void _vg_process_launch_opts_internal( int argc, char *argv[] )
+static void _vg_process_launch_opts_internal( int argc, char *argv[] )
 {
    char *arg;
    while( vg_argp( argc, argv ) ){
@@ -663,7 +663,7 @@ VG_STATIC void _vg_process_launch_opts_internal( int argc, char *argv[] )
    }
 }
 
-VG_STATIC void _vg_init_window( const char *window_name )
+static void _vg_init_window( const char *window_name )
 {
    vg_info( "SDL_INIT\n" );
 
@@ -816,7 +816,7 @@ VG_STATIC void _vg_init_window( const char *window_name )
 #endif
 }
 
-VG_STATIC void _vg_terminate(void)
+static void _vg_terminate(void)
 {
    /* Shutdown */
    _vg_console_write_persistent();
@@ -834,7 +834,7 @@ VG_STATIC void _vg_terminate(void)
    exit(0);
 }
 
-VG_STATIC void vg_enter( int argc, char *argv[], const char *window_name )
+static void vg_enter( int argc, char *argv[], const char *window_name )
 {
    vg_rand_seed( 461 );
    _vg_process_launch_opts_internal( argc, argv );
@@ -863,7 +863,7 @@ VG_STATIC void vg_enter( int argc, char *argv[], const char *window_name )
    _vg_terminate();
 }
 
-VG_STATIC void vg_fatal_error( const char *fmt, ... )
+static void vg_fatal_error( const char *fmt, ... )
 {
    va_list args;
    va_start( args, fmt );
@@ -888,7 +888,7 @@ VG_STATIC void vg_fatal_error( const char *fmt, ... )
 #else /* VG_GAME */
 
 #include "vg_log.h"
-VG_STATIC void vg_fatal_error( const char *fmt, ... )
+static void vg_fatal_error( const char *fmt, ... )
 {
    va_list args;
    va_start( args, fmt );
index 825cad845fc93d189c12c8c32d61dd20df2936f9..7537aae1e839e5a99aa08f445d9b5efbf54aab81 100644 (file)
@@ -9,7 +9,7 @@
 
 #define VG_GAME
 #include "vg/vg.h"
-VG_STATIC void vg_assert_thread( enum vg_thread_purpose required );
+static void vg_assert_thread( enum vg_thread_purpose required );
 
 typedef struct vg_async_item vg_async_item;
 
@@ -32,13 +32,13 @@ struct vg_async{
 }
 static vg_async;
 
-VG_STATIC enum vg_thread_purpose vg_thread_purpose(void);
-VG_STATIC enum engine_status _vg_engine_status(void);
+static enum vg_thread_purpose vg_thread_purpose(void);
+static enum engine_status _vg_engine_status(void);
 
 /*
  * Allocate an asynchronous call with a bit of memory
  */
-VG_STATIC vg_async_item *vg_async_alloc( u32 size )
+static vg_async_item *vg_async_alloc( u32 size )
 {
    /* ditch out here if engine crashed. this serves as the 'quit checking' */
    if( _vg_engine_status() == k_engine_status_crashed ){
@@ -101,7 +101,7 @@ VG_STATIC vg_async_item *vg_async_alloc( u32 size )
 /*
  * Wait until the current stack of async calls is completely flushed out 
  */
-VG_STATIC void vg_async_stall(void)
+static void vg_async_stall(void)
 {
    vg_assert_thread(k_thread_purpose_loader);
    vg_info( "async_stall: %d\n", SDL_SemValue( vg_async.sem_wait_for_flush ) );
@@ -111,7 +111,7 @@ VG_STATIC void vg_async_stall(void)
 /*
  * Mark the call as being filled and ready to go
  */
-VG_STATIC void vg_async_dispatch( vg_async_item *item, 
+static void vg_async_dispatch( vg_async_item *item, 
                                   void (*runner)( void *payload, u32 size ) )
 {
    vg_assert_thread(k_thread_purpose_loader);
@@ -126,7 +126,7 @@ VG_STATIC void vg_async_dispatch( vg_async_item *item,
 /*
  * Make a simple async call without allocating extra.
  */
-VG_STATIC void vg_async_call( void (*runner)( void *payload, u32 size ), 
+static void vg_async_call( void (*runner)( void *payload, u32 size ), 
                               void *payload, u32 size )
 {
    vg_assert_thread(k_thread_purpose_loader);
@@ -139,7 +139,7 @@ VG_STATIC void vg_async_call( void (*runner)( void *payload, u32 size ),
 /*
  * Run as much of the async buffer as possible
  */
-VG_STATIC void vg_run_async_checked(void)
+static void vg_run_async_checked(void)
 {
    SDL_AtomicLock( &vg_async.sl_index );
 
@@ -175,7 +175,7 @@ VG_STATIC void vg_run_async_checked(void)
    SDL_AtomicUnlock( &vg_async.sl_index );
 }
 
-VG_STATIC void vg_async_init(void)
+static void vg_async_init(void)
 {
    vg_async.sem_wait_for_flush = SDL_CreateSemaphore(0);
    vg_async.buffer = vg_create_linear_allocator( NULL, 50*1024*1024, 
index b0c4823d21c7ed79295fec80dfc78c4b359a4cec..39f494ffa0b843e501c28aaab94db4cfa7dd443e 100644 (file)
@@ -223,7 +223,7 @@ static struct vg_profile
  * These functions are called from the main thread and used to prevent bad 
  * access. TODO: They should be no-ops in release builds.
  */
-VG_STATIC int audio_lock_checker_load(void)
+static int audio_lock_checker_load(void)
 {
    int value;
    SDL_AtomicLock( &vg_audio.sl_checker );
@@ -232,14 +232,14 @@ VG_STATIC int audio_lock_checker_load(void)
    return value;
 }
 
-VG_STATIC void audio_lock_checker_store( int value )
+static void audio_lock_checker_store( int value )
 {
    SDL_AtomicLock( &vg_audio.sl_checker );
    vg_audio.sync_locked = value;
    SDL_AtomicUnlock( &vg_audio.sl_checker );
 }
 
-VG_STATIC void audio_require_lock(void)
+static void audio_require_lock(void)
 {
    if( audio_lock_checker_load() )
       return;
@@ -248,20 +248,20 @@ VG_STATIC void audio_require_lock(void)
    abort();
 }
 
-VG_STATIC void audio_lock(void)
+static void audio_lock(void)
 {
    SDL_AtomicLock( &vg_audio.sl_sync );
    audio_lock_checker_store(1);
 }
 
-VG_STATIC void audio_unlock(void)
+static void audio_unlock(void)
 {
    audio_lock_checker_store(0);
    SDL_AtomicUnlock( &vg_audio.sl_sync );
 }
 
-VG_STATIC void audio_mixer_callback( void *user, u8 *stream, int frame_count );
-VG_STATIC void vg_audio_init(void)
+static void audio_mixer_callback( void *user, u8 *stream, int frame_count );
+static void vg_audio_init(void)
 {
    /* TODO: Move here? */
    vg_console_reg_var( "debug_audio", &vg_audio.debug_ui, 
@@ -310,7 +310,7 @@ VG_STATIC void vg_audio_init(void)
    }
 }
 
-VG_STATIC void vg_audio_free(void)
+static void vg_audio_free(void)
 {
    vg_dsp_free();
    SDL_CloseAudioDevice( vg_audio.sdl_output_device );
@@ -623,7 +623,7 @@ static int audio_channel_load_source( audio_channel *ch )
    return 1;
 }
 
-VG_STATIC void audio_decode_uncompressed_mono( i16 *src, u32 count, float *dst )
+static void audio_decode_uncompressed_mono( i16 *src, u32 count, float *dst )
 {
    for( u32 i=0; i<count; i++ ){
       dst[ i*2 + 0 ] = ((float)src[i]) * (1.0f/32767.0f);
@@ -634,7 +634,7 @@ VG_STATIC void audio_decode_uncompressed_mono( i16 *src, u32 count, float *dst )
 /* 
  * adapted from stb_vorbis.h, since the original does not handle mono->stereo
  */
-VG_STATIC int 
+static int 
 stb_vorbis_get_samples_float_interleaved_stereo( stb_vorbis *f, float *buffer, 
                                                  int len )
 {
@@ -668,7 +668,7 @@ stb_vorbis_get_samples_float_interleaved_stereo( stb_vorbis *f, float *buffer,
 /* 
  * ........ more wrecked code sorry!
  */
-VG_STATIC int 
+static int 
 stb_vorbis_get_samples_i16_downmixed( stb_vorbis *f, i16 *buffer, int len )
 {
    int n = 0,
@@ -935,7 +935,7 @@ static void audio_channel_mix( audio_channel *ch, float *buffer )
    vg_profile_end( &_vg_prof_audio_mix );
 }
 
-VG_STATIC void audio_mixer_callback( void *user, u8 *stream, int byte_count )
+static void audio_mixer_callback( void *user, u8 *stream, int byte_count )
 {
    /*
     * Copy data and move edit flags to commit flags
@@ -1153,7 +1153,7 @@ VG_STATIC void audio_mixer_callback( void *user, u8 *stream, int byte_count )
    audio_unlock();
 }
 
-VG_STATIC void audio_clip_load( audio_clip *clip, void *lin_alloc )
+static void audio_clip_load( audio_clip *clip, void *lin_alloc )
 {
    if( lin_alloc == NULL )
       lin_alloc = vg_audio.audio_pool;
@@ -1254,13 +1254,13 @@ VG_STATIC void audio_clip_load( audio_clip *clip, void *lin_alloc )
    }
 }
 
-VG_STATIC void audio_clip_loadn( audio_clip *arr, int count, void *lin_alloc )
+static void audio_clip_loadn( audio_clip *arr, int count, void *lin_alloc )
 {
    for( int i=0; i<count; i++ )
       audio_clip_load( &arr[i], lin_alloc );
 }
 
-VG_STATIC void audio_require_clip_loaded( audio_clip *clip )
+static void audio_require_clip_loaded( audio_clip *clip )
 {
    if( clip->data && clip->size )
       return;
@@ -1273,7 +1273,7 @@ VG_STATIC void audio_require_clip_loaded( audio_clip *clip )
  * Debugging
  */
 
-VG_STATIC void audio_debug_ui( m4x4f mtx_pv )
+static void audio_debug_ui( m4x4f mtx_pv )
 {
    if( !vg_audio.debug_ui )
       return;
index 25bad63d3c37186534f201ae40dceaed5876ad76..1024b82ac468b0b6e6c08d557e7561e965ffc387 100644 (file)
@@ -73,29 +73,29 @@ struct vg_console{
 }
 static vg_console;
 
-VG_STATIC void _vg_console_draw( void );
+static void _vg_console_draw( void );
 void           _vg_console_println( const char *str );
-VG_STATIC int  _vg_console_list( int argc, char const *argv[] );
-VG_STATIC void _vg_console_init(void);
-VG_STATIC void _vg_console_write_persistent(void);
-VG_STATIC void _vg_console_free(void);
-VG_STATIC void  vg_execute_console_input( const char *cmd );
+static int  _vg_console_list( int argc, char const *argv[] );
+static void _vg_console_init(void);
+static void _vg_console_write_persistent(void);
+static void _vg_console_free(void);
+static void  vg_execute_console_input( const char *cmd );
 
 /*
  * Console interface
  */
-VG_STATIC void console_history_get( char* buf, int entry_num );
-VG_STATIC int _vg_console_enabled(void);
-VG_STATIC void console_proc_key( SDL_Keysym ev );
+static void console_history_get( char* buf, int entry_num );
+static int _vg_console_enabled(void);
+static void console_proc_key( SDL_Keysym ev );
 
 /*
  * Implementation
  */
-VG_STATIC int _vg_console_enabled(void){ 
+static int _vg_console_enabled(void){ 
        return vg_console.enabled; 
 }
 
-VG_STATIC 
+static 
 void vg_console_reg_var( const char *alias, void *ptr, enum vg_var_dtype type, 
                          u32 flags )
 {
@@ -115,7 +115,7 @@ void vg_console_reg_var( const char *alias, void *ptr, enum vg_var_dtype type,
    vg_info( "Console variable '%s' registered\n", alias );
 }
 
-VG_STATIC 
+static 
 void vg_console_reg_cmd( const char *alias,
                          int (*function)(int argc, const char *argv[]),
                          void (*poll_suggest)(int argc, const char *argv[]) )
@@ -132,7 +132,7 @@ void vg_console_reg_cmd( const char *alias,
    vg_info( "Console function '%s' registered\n", alias );
 }
 
-VG_STATIC int _vg_console_list( int argc, char const *argv[] ){
+static int _vg_console_list( int argc, char const *argv[] ){
        for( int i=0; i<vg_console.function_count; i ++ ){
                struct vg_cmd *cmd = &vg_console.functions[ i ];
                vg_info( "* %s\n", cmd->name );
@@ -194,7 +194,7 @@ int _ccmd_vg_console_defaults( int argc, const char *argv[] ){
    return 0;
 }
 
-VG_STATIC void _vg_console_init(void){
+static void _vg_console_init(void){
    vg_console_reg_cmd( "list", _vg_console_list, NULL );
    vg_console_reg_cmd( "crash", _test_break, NULL );
    vg_console_reg_cmd( "exec", _vg_console_exec, NULL );
@@ -208,11 +208,11 @@ VG_STATIC void _vg_console_init(void){
                        );
 }
 
-VG_STATIC void vg_console_load_autos(void){
+static void vg_console_load_autos(void){
    _vg_console_exec( 1, (const char *[]){ "auto.conf" } );
 }
 
-VG_STATIC void _vg_console_write_persistent(void){
+static void _vg_console_write_persistent(void){
        FILE *fp = fopen( "cfg/auto.conf", "w" );
        
        for( int i=0; i<vg_console.var_count; i ++ ){
@@ -236,7 +236,7 @@ VG_STATIC void _vg_console_write_persistent(void){
        fclose( fp );
 }
 
-VG_STATIC void _vg_console_free(void)
+static void _vg_console_free(void)
 {
        _vg_console_write_persistent();
 }
@@ -246,7 +246,7 @@ VG_STATIC void _vg_console_free(void)
  * returns number of tokens
  * dst must be as long as src
  */
-VG_STATIC int vg_console_tokenize( const char *src, char *dst, 
+static int vg_console_tokenize( const char *src, char *dst, 
                                    const char *args[8] )
 {
        int arg_count = 0,
@@ -281,7 +281,7 @@ VG_STATIC int vg_console_tokenize( const char *src, char *dst,
    return arg_count;
 }
 
-VG_STATIC vg_var *vg_console_match_var( const char *kw )
+static vg_var *vg_console_match_var( const char *kw )
 {
        for( int i=0; i<vg_console.var_count; i ++ ){
                struct vg_var *cv = &vg_console.vars[ i ];
@@ -293,7 +293,7 @@ VG_STATIC vg_var *vg_console_match_var( const char *kw )
    return NULL;
 }
 
-VG_STATIC vg_cmd *vg_console_match_cmd( const char *kw )
+static vg_cmd *vg_console_match_cmd( const char *kw )
 {
        for( int i=0; i<vg_console.function_count; i ++ ){
                struct vg_cmd *cmd = &vg_console.functions[ i ];
@@ -305,7 +305,7 @@ VG_STATIC vg_cmd *vg_console_match_cmd( const char *kw )
    return NULL;
 }
 
-VG_STATIC void vg_execute_console_input( const char *cmd )
+static void vg_execute_console_input( const char *cmd )
 {
        char temp[512];
        char const *args[8];
@@ -426,7 +426,7 @@ u32 str_lcs( const char *s1, const char *s2 ){
 }
 
 /* str must not fuckoff ever! */
-VG_STATIC void console_suggest_score_text( const char *str, const char *input,
+static void console_suggest_score_text( const char *str, const char *input,
                                            int minscore )
 {
    /* filter duplicates */
@@ -462,7 +462,7 @@ VG_STATIC void console_suggest_score_text( const char *str, const char *input,
    }
 }
 
-VG_STATIC void console_update_suggestions(void)
+static void console_update_suggestions(void)
 {
    if( vg_ui.focused_control_type != k_ui_control_textbox ||
        vg_ui.textbuf != vg_console.input )
@@ -534,7 +534,7 @@ VG_STATIC void console_update_suggestions(void)
 /*
  * Suggestion controls
  */
-VG_STATIC void _console_fetch_suggestion(void)
+static void _console_fetch_suggestion(void)
 {
    char *target = &vg_console.input[ vg_console.suggestion_pastepos ];
 
@@ -554,7 +554,7 @@ VG_STATIC void _console_fetch_suggestion(void)
    }
 }
 
-VG_STATIC void _console_suggest_store_normal(void)
+static void _console_suggest_store_normal(void)
 {
    if( vg_console.suggestion_select == -1 ){
       char *target = &vg_console.input[ vg_console.suggestion_pastepos ];
@@ -562,7 +562,7 @@ VG_STATIC void _console_suggest_store_normal(void)
    }
 }
 
-VG_STATIC void _console_suggest_next(void)
+static void _console_suggest_next(void)
 {
    if( vg_console.suggestion_count ){
       _console_suggest_store_normal();
@@ -576,7 +576,7 @@ VG_STATIC void _console_suggest_next(void)
    }
 }
 
-VG_STATIC void _console_suggest_prev(void)
+static void _console_suggest_prev(void)
 {
    if( vg_console.suggestion_count ){
       _console_suggest_store_normal();
@@ -590,14 +590,14 @@ VG_STATIC void _console_suggest_prev(void)
    }
 }
 
-VG_STATIC void _vg_console_on_update( char *buf, u32 len )
+static void _vg_console_on_update( char *buf, u32 len )
 {
    if( buf == vg_console.input ){
       console_update_suggestions();
    }
 }
 
-VG_STATIC void console_history_get( char* buf, int entry_num )
+static void console_history_get( char* buf, int entry_num )
 {
        if( !vg_console.history_count )
                return;
@@ -608,7 +608,7 @@ VG_STATIC void console_history_get( char* buf, int entry_num )
        strcpy( buf, vg_console.history[ pick ] );
 }
 
-VG_STATIC void _vg_console_on_up( char *buf, u32 len )
+static void _vg_console_on_up( char *buf, u32 len )
 {
    if( buf == vg_console.input ){
       vg_console.history_pos = 
@@ -633,7 +633,7 @@ VG_STATIC void _vg_console_on_up( char *buf, u32 len )
    }
 }
 
-VG_STATIC void _vg_console_on_down( char *buf, u32 len )
+static void _vg_console_on_down( char *buf, u32 len )
 {
    if( buf == vg_console.input ){
       vg_console.history_pos = VG_MAX( 0, vg_console.history_pos-1 );
@@ -645,7 +645,7 @@ VG_STATIC void _vg_console_on_down( char *buf, u32 len )
    }
 }
 
-VG_STATIC void _vg_console_on_enter( char *buf, u32 len )
+static void _vg_console_on_enter( char *buf, u32 len )
 {
    if( buf == vg_console.input ){
       if( !strlen( vg_console.input ) ) 
@@ -675,7 +675,7 @@ VG_STATIC void _vg_console_on_enter( char *buf, u32 len )
    }
 }
 
-VG_STATIC void _vg_console_draw(void)
+static void _vg_console_draw(void)
 {
        if( !vg_console.enabled ) return;
 
index fac19848cb5a7e5f6020873eea2d40a63fb612d9..ec7f97406004910ec2fd34e12efd260131555ec7 100644 (file)
@@ -13,7 +13,7 @@ struct vg_graph
    GLuint vao, vbo, ebo;
 };
 
-VG_STATIC void vg_graph_init( struct vg_graph *graph )
+static void vg_graph_init( struct vg_graph *graph )
 {
    vg_acquire_thread_sync();
    {
@@ -40,7 +40,7 @@ VG_STATIC void vg_graph_init( struct vg_graph *graph )
    }
 }
 
-VG_STATIC void vg_graph_add_sample( struct vg_graph *graph )
+static void vg_graph_add_sample( struct vg_graph *graph )
 {
    
 }
index e58977b41f25fa09d57b7bc844d3ea68666b0016..4433b2a2d9b650d7cdd576618297d7bd0baa37f5 100644 (file)
@@ -358,7 +358,7 @@ static struct vg_shader _shader_ui_image = {
    }
 };
 
-VG_STATIC void _vg_ui_init(void){
+static void _vg_ui_init(void){
    if( !vg_shader_compile( &_shader_ui ) ||
        !vg_shader_compile( &_shader_ui_image ) ) 
       vg_fatal_error( "Failed to compile ui shader" );
@@ -475,7 +475,7 @@ static void rect_copy( ui_rect a, ui_rect b ){
       b[i] = a[i];
 }
 
-VG_STATIC void ui_flush( enum ui_shader shader ){
+static void ui_flush( enum ui_shader shader ){
    u32 vertex_offset = vg_ui.vert_start*sizeof(ui_vert),
        vertex_count  = vg_ui.cur_vert-vg_ui.vert_start,
        vertex_size   = vertex_count*sizeof(ui_vert),
@@ -2046,7 +2046,7 @@ static void _ui_proc_key( SDL_Keysym ev ){
 /*
  * Callback for text entry mode
  */
-VG_STATIC void ui_proc_utf8( const char *text ){
+static void ui_proc_utf8( const char *text ){
    if( vg_ui.focused_control_type == k_ui_control_textbox ){
       const char *ptr = text;
 
index ecf2432a98cb05ff8ca30053d5e0414a416515bd..e9ae65b1971c9d714e174e19e1a7bc0b1552f9b2 100644 (file)
@@ -7,7 +7,7 @@
 
 #define VG_MAX_CONTROLLERS 4
 
-VG_STATIC float controller_deadzone = 0.05f;
+static float controller_deadzone = 0.05f;
 
 struct{
    const u8 *sdl_keys;
@@ -35,7 +35,7 @@ struct{
 }
 static vg_input = { .active_controller_index = -2 };
 
-VG_STATIC u8 vg_getkey( SDL_Keycode kc )
+static u8 vg_getkey( SDL_Keycode kc )
 {
    SDL_Scancode sc = SDL_GetScancodeFromKey( kc );
    return vg_input.sdl_keys[sc];
@@ -44,7 +44,7 @@ VG_STATIC u8 vg_getkey( SDL_Keycode kc )
 /*
  * takes SDL device index, and tries to open that on any free channel
  */
-VG_STATIC int vg_open_gamecontroller( Sint32 index )
+static int vg_open_gamecontroller( Sint32 index )
 {
    struct vg_controller *controller = NULL;
    int vg_id = 0;
@@ -113,7 +113,7 @@ VG_STATIC int vg_open_gamecontroller( Sint32 index )
    }
 }
 
-VG_STATIC void vg_input_device_event( SDL_Event *ev )
+static void vg_input_device_event( SDL_Event *ev )
 {
    if( ev->type == SDL_CONTROLLERDEVICEADDED ){
       int is_controller = SDL_IsGameController( ev->cdevice.which );
@@ -154,7 +154,7 @@ VG_STATIC void vg_input_device_event( SDL_Event *ev )
    }
 }
 
-VG_STATIC void vg_input_controller_event( SDL_Event *ev )
+static void vg_input_controller_event( SDL_Event *ev )
 {
    if( ev->type == SDL_CONTROLLERAXISMOTION ){
       for( int i=0; i<VG_MAX_CONTROLLERS; i++ ){
@@ -230,7 +230,7 @@ VG_STATIC void vg_input_controller_event( SDL_Event *ev )
    }
 }
 
-VG_STATIC void vg_process_inputs(void)
+static void vg_process_inputs(void)
 {
    int count;
    vg_input.sdl_keys = SDL_GetKeyboardState( &count );
@@ -256,7 +256,7 @@ VG_STATIC void vg_process_inputs(void)
    }
 }
 
-VG_STATIC void async_vg_input_init( void *payload, u32 size )
+static void async_vg_input_init( void *payload, u32 size )
 {
    VG_VAR_F32( controller_deadzone, flags=VG_VAR_PERSISTENT );
 
@@ -276,12 +276,12 @@ VG_STATIC void async_vg_input_init( void *payload, u32 size )
    }
 }
 
-VG_STATIC void vg_input_init(void)
+static void vg_input_init(void)
 {
    vg_async_call( async_vg_input_init, NULL, 0 );
 }
 
-VG_STATIC void vg_input_free(void)
+static void vg_input_free(void)
 {
    for( int i=0; i<VG_MAX_CONTROLLERS; i++ ){
       struct vg_controller *controller = &vg_input.controllers[i];
diff --git a/vg_io.h b/vg_io.h
index 5a37fb3c4ead2d15a4f7564a0bf384c0577e835e..87562ace408a919ba0d02afdc4c0262ac3e64893 100644 (file)
--- a/vg_io.h
+++ b/vg_io.h
@@ -144,7 +144,7 @@ static void vg_dir_close( vg_dir *dir ){
   #endif
 #endif
 
-VG_STATIC void vg_file_print_invalid( FILE *fp )
+static void vg_file_print_invalid( FILE *fp )
 {
    if( feof( fp )) {
       vg_error( "mdl_open: header too short\n" );
@@ -159,7 +159,7 @@ VG_STATIC void vg_file_print_invalid( FILE *fp )
 }
 
 /* read entire binary file */
-VG_STATIC void *vg_file_read( void *lin_alloc, const char *path, u32 *size )
+static void *vg_file_read( void *lin_alloc, const char *path, u32 *size )
 {
        FILE *f = fopen( path, "rb" );
        if( f ){
@@ -203,7 +203,7 @@ VG_STATIC void *vg_file_read( void *lin_alloc, const char *path, u32 *size )
 }
 
 /* read entire file and append a null on the end */
-VG_STATIC char *vg_file_read_text( void *lin_alloc, const char *path, u32 *sz )
+static char *vg_file_read_text( void *lin_alloc, const char *path, u32 *sz )
 {
    u32 size;
    char *str = vg_file_read( lin_alloc, path, &size );
@@ -220,7 +220,7 @@ VG_STATIC char *vg_file_read_text( void *lin_alloc, const char *path, u32 *sz )
 }
 
 
-VG_STATIC int vg_asset_write( const char *path, void *data, i64 size ){
+static int vg_asset_write( const char *path, void *data, i64 size ){
        FILE *f = fopen( path, "wb" );
        if( f ){
                fwrite( data, size, 1, f );
@@ -233,7 +233,7 @@ VG_STATIC int vg_asset_write( const char *path, void *data, i64 size ){
 }
 
 /* TODO: error handling if read fails */
-VG_STATIC int vg_file_copy( const char *src, const char *dst, void *lin_alloc )
+static int vg_file_copy( const char *src, const char *dst, void *lin_alloc )
 {
    vg_info( "vg_file_copy( %s -> %s )\n", src, dst );
    u32 size;
@@ -241,7 +241,7 @@ VG_STATIC int vg_file_copy( const char *src, const char *dst, void *lin_alloc )
    return vg_asset_write( dst, data, size );
 }
 
-VG_STATIC const char *vg_path_filename( const char *path )
+static const char *vg_path_filename( const char *path )
 {
    const char *base = path;
    
index c44f0713cd9eab045fd92736b5bf96b742f693eb..569ae169739507e88419233708bbe83597227f1a 100644 (file)
@@ -68,7 +68,7 @@ struct{
 }
 static vg_lines;
 
-VG_STATIC void async_vg_lines_init( void *payload, u32 payload_size ){
+static void async_vg_lines_init( void *payload, u32 payload_size ){
    glGenVertexArrays( 1, &vg_lines.vao );
    glGenBuffers( 1, &vg_lines.vbo );
    glBindVertexArray( vg_lines.vao );
@@ -108,7 +108,7 @@ VG_STATIC void async_vg_lines_init( void *payload, u32 payload_size ){
    vg_lines.allow_input = 1;
 }
 
-VG_STATIC void vg_lines_init(void){
+static void vg_lines_init(void){
    vg_async_call( async_vg_lines_init, NULL, 0 );
 
    vg_console_reg_var( "vg_lines", &vg_lines.draw, k_var_dtype_i32, 
@@ -117,7 +117,7 @@ VG_STATIC void vg_lines_init(void){
 
 }
 
-VG_STATIC void vg_lines_drawall( void ){
+static void vg_lines_drawall( void ){
        glUseProgram( _shader_lines.id );
 
    glUniformMatrix4fv( glGetUniformLocation( _shader_lines.id, "uPv" ), 
@@ -141,7 +141,7 @@ VG_STATIC void vg_lines_drawall( void ){
    vg_linear_clear( vg_lines.vertex_buffer );
 }
 
-VG_STATIC void vg_line2( line_co from, line_co to, u32 fc, u32 tc ){
+static void vg_line2( line_co from, line_co to, u32 fc, u32 tc ){
    if( !vg_lines.allow_input ) return;
    if( !vg_lines.draw ) return;
 
@@ -155,11 +155,11 @@ VG_STATIC void vg_line2( line_co from, line_co to, u32 fc, u32 tc ){
        v[1].colour = tc;
 }
 
-VG_STATIC void vg_line( line_co from, line_co to, u32 colour ){
+static void vg_line( line_co from, line_co to, u32 colour ){
        vg_line2( from, to, colour, colour );
 }
 
-VG_STATIC void vg_line_arrow( line_co co, line_co dir, float size, u32 colour ){
+static void vg_line_arrow( line_co co, line_co dir, float size, u32 colour ){
    v3f p1, tx, ty, p2, p3;
    v3_muladds( co, dir, size, p1 );
    v3_tangent_basis( dir, tx, ty );
@@ -173,7 +173,7 @@ VG_STATIC void vg_line_arrow( line_co co, line_co dir, float size, u32 colour ){
    vg_line( p1, p3, colour );
 }
 
-VG_STATIC void vg_line_box_verts( boxf box, v3f verts[8] ){
+static void vg_line_box_verts( boxf box, v3f verts[8] ){
    for( u32 i=0; i<8; i++ ){
       for( u32 j=0; j<3; j++ ){
          verts[i][j] = i&(0x1<<j)? box[1][j]: box[0][j];
@@ -181,14 +181,14 @@ VG_STATIC void vg_line_box_verts( boxf box, v3f verts[8] ){
    }
 }
 
-VG_STATIC void vg_line_mesh( v3f verts[], u32 indices[][2], u32 indice_count,
+static void vg_line_mesh( v3f verts[], u32 indices[][2], u32 indice_count,
                              u32 colour ){
    for( u32 i=0; i<indice_count; i++ ){
       vg_line( verts[indices[i][0]], verts[indices[i][1]], colour );
    }
 }
 
-VG_STATIC void vg_line_boxf( boxf box, u32 colour ){
+static void vg_line_boxf( boxf box, u32 colour ){
    v3f verts[8];
    vg_line_box_verts( box, verts );
    u32 indices[][2] = {{0,1},{1,3},{3,2},{2,0},
@@ -198,7 +198,7 @@ VG_STATIC void vg_line_boxf( boxf box, u32 colour ){
    vg_line_mesh( verts, indices, vg_list_size(indices), colour );
 }
 
-VG_STATIC void vg_line_boxf_transformed( m4x3f m, boxf box, u32 colour ){
+static void vg_line_boxf_transformed( m4x3f m, boxf box, u32 colour ){
    v3f verts[8];
    vg_line_box_verts( box, verts );
 
@@ -213,7 +213,7 @@ VG_STATIC void vg_line_boxf_transformed( m4x3f m, boxf box, u32 colour ){
    vg_line_mesh( verts, indices, vg_list_size(indices), colour );
 }
 
-VG_STATIC void vg_line_cross(v3f pos,u32 colour, float scale){
+static void vg_line_cross(v3f pos,u32 colour, float scale){
    v3f p0, p1;
    v3_add( (v3f){ scale,0.0f,0.0f}, pos, p0 );
    v3_add( (v3f){-scale,0.0f,0.0f}, pos, p1 );
@@ -226,7 +226,7 @@ VG_STATIC void vg_line_cross(v3f pos,u32 colour, float scale){
    vg_line( p0, p1, colour );
 }
 
-VG_STATIC void vg_line_point( v3f pt, float size, u32 colour ){
+static void vg_line_point( v3f pt, float size, u32 colour ){
    boxf box =
    {
       { pt[0]-size, pt[1]-size, pt[2]-size },
@@ -237,7 +237,7 @@ VG_STATIC void vg_line_point( v3f pt, float size, u32 colour ){
 }
 
 
-VG_STATIC void vg_line_sphere( m4x3f m, float radius, u32 colour ){
+static void vg_line_sphere( m4x3f m, float radius, u32 colour ){
    v3f ly = { 0.0f, 0.0f, radius },
        lx = { 0.0f, radius, 0.0f },
        lz = { 0.0f, 0.0f, radius };
@@ -269,7 +269,7 @@ VG_STATIC void vg_line_sphere( m4x3f m, float radius, u32 colour ){
    }
 }
 
-VG_STATIC void vg_line_capsule( m4x3f m, float radius, float h, u32 colour ){
+static void vg_line_capsule( m4x3f m, float radius, float h, u32 colour ){
    v3f ly = { 0.0f, 0.0f, radius },
        lx = { 0.0f, radius, 0.0f },
        lz = { 0.0f, 0.0f, radius };
index 62fbe21192726c0b0084ae461356baa71ff72dd2..cdd29ebc302d80266e6041865d706571b296b68f 100644 (file)
@@ -14,8 +14,8 @@
 #include "vg/vg.h"
 #include "vg/vg_shader.h"
 
-VG_STATIC void vg_loader_start( void(*pfn)(void *data), void *data );
-VG_STATIC void vg_loader_step( void( *fn_load )(void), void( *fn_free )(void) );
+static void vg_loader_start( void(*pfn)(void *data), void *data );
+static void vg_loader_step( void( *fn_load )(void), void( *fn_free )(void) );
 
 static struct vg_shader _shader_loader = 
 {
@@ -90,7 +90,7 @@ static struct vg_loader
 }
 vg_loader;
 
-VG_STATIC void _vg_loader_init(void)
+static void _vg_loader_init(void)
 {
    float quad[] = { 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f,
                     0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f };
@@ -110,7 +110,7 @@ VG_STATIC void _vg_loader_init(void)
       vg_fatal_error( "failed to compile shader" );
 }
 
-VG_STATIC void _vg_loader_free(void)
+static void _vg_loader_free(void)
 {
    vg_info( "vg_loader_free\n" );
    glDeleteVertexArrays( 1, &vg_loader.vao );
@@ -126,7 +126,7 @@ VG_STATIC void _vg_loader_free(void)
    }
 }
 
-VG_STATIC void _vg_render_log(void)
+static void _vg_render_log(void)
 {
 #if 0
    ui_begin( vg.window_x, vg.window_y );
@@ -161,7 +161,7 @@ VG_STATIC void _vg_render_log(void)
 #endif
 }
 
-VG_STATIC void _vg_loader_render_ring( float opacity )
+static void _vg_loader_render_ring( float opacity )
 {
    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -176,7 +176,7 @@ VG_STATIC void _vg_loader_render_ring( float opacity )
    glDrawArrays( GL_TRIANGLES, 0, 6 );
 }
 
-VG_STATIC void _vg_loader_render(void)
+static void _vg_loader_render(void)
 {
    glViewport( 0,0, vg.window_x, vg.window_y );
    glBindFramebuffer( GL_FRAMEBUFFER, 0 );
@@ -188,9 +188,9 @@ VG_STATIC void _vg_loader_render(void)
 }
 
 
-VG_STATIC void vg_load_full(void);
+static void vg_load_full(void);
 
-VG_STATIC int _vg_loader_thread( void *pfn ){
+static int _vg_loader_thread( void *pfn ){
    if( setjmp( vg.env_loader_exit ) )
       return 0;
 
@@ -214,7 +214,7 @@ static int vg_loader_availible(void){
    return 0;
 }
 
-VG_STATIC void vg_loader_start( void(*pfn)(void *data), void *data )
+static void vg_loader_start( void(*pfn)(void *data), void *data )
 {
    SDL_SemWait( vg.sem_loader );
 
@@ -225,7 +225,7 @@ VG_STATIC void vg_loader_start( void(*pfn)(void *data), void *data )
 /*
  * Schedule something to be ran now, freed later. Checks in with engine status
  */
-VG_STATIC void vg_loader_step( void( *fn_load )(void), void( *fn_free )(void) )
+static void vg_loader_step( void( *fn_load )(void), void( *fn_free )(void) )
 {
    if( fn_load )
       fn_load();
diff --git a/vg_m.h b/vg_m.h
index 090c4873ed723ad90244e8786842d047fa808a32..c753be797bc9e1da62b96c29ead2e8e800f7f0b9 100644 (file)
--- a/vg_m.h
+++ b/vg_m.h
@@ -1589,7 +1589,7 @@ static f32 ray_plane( v4f plane, v3f co, v3f dir ){
  * These closest point tests were learned from Real-Time Collision Detection by 
  * Christer Ericson 
  */
-VG_STATIC f32 closest_segment_segment( v3f p1, v3f q1, v3f p2, v3f q2, 
+static f32 closest_segment_segment( v3f p1, v3f q1, v3f p2, v3f q2, 
    f32 *s, f32 *t, v3f c1, v3f c2)
 {
    v3f d1,d2,r;
@@ -1666,7 +1666,7 @@ VG_STATIC f32 closest_segment_segment( v3f p1, v3f q1, v3f p2, v3f q2,
    return v3_length2( v0 );
 }
 
-VG_STATIC int point_inside_aabb( boxf box, v3f point )
+static int point_inside_aabb( boxf box, v3f point )
 {
    if((point[0]<=box[1][0]) && (point[1]<=box[1][1]) && (point[2]<=box[1][2]) &&
       (point[0]>=box[0][0]) && (point[1]>=box[0][1]) && (point[2]>=box[0][2]) )
@@ -1675,13 +1675,13 @@ VG_STATIC int point_inside_aabb( boxf box, v3f point )
       return 0;
 }
 
-VG_STATIC void closest_point_aabb( v3f p, boxf box, v3f dest )
+static void closest_point_aabb( v3f p, boxf box, v3f dest )
 {
    v3_maxv( p, box[0], dest );
    v3_minv( dest, box[1], dest );
 }
 
-VG_STATIC void closest_point_obb( v3f p, boxf box, 
+static void closest_point_obb( v3f p, boxf box, 
                                   m4x3f mtx, m4x3f inv_mtx, v3f dest )
 {
    v3f local;
@@ -1690,7 +1690,7 @@ VG_STATIC void closest_point_obb( v3f p, boxf box,
    m4x3_mulv( mtx, local, dest );
 }
 
-VG_STATIC f32 closest_point_segment( v3f a, v3f b, v3f point, v3f dest )
+static f32 closest_point_segment( v3f a, v3f b, v3f point, v3f dest )
 {
    v3f v0, v1;
    v3_sub( b, a, v0 );
@@ -1702,7 +1702,7 @@ VG_STATIC f32 closest_point_segment( v3f a, v3f b, v3f point, v3f dest )
    return t;
 }
 
-VG_STATIC void closest_on_triangle( v3f p, v3f tri[3], v3f dest )
+static void closest_on_triangle( v3f p, v3f tri[3], v3f dest )
 {
    v3f ab, ac, ap;
    f32 d1, d2;
@@ -1798,7 +1798,7 @@ enum contact_type
    k_contact_type_edge
 };
 
-VG_STATIC enum contact_type closest_on_triangle_1( v3f p, v3f tri[3], v3f dest )
+static enum contact_type closest_on_triangle_1( v3f p, v3f tri[3], v3f dest )
 {
    v3f ab, ac, ap;
    f32 d1, d2;
index 12a04f986eecce50d2d1fd917b48dd2e725e8703..be11ddd2ef4ce43741b1d23f89eb1718c9a4680f 100644 (file)
--- a/vg_mem.h
+++ b/vg_mem.h
@@ -9,7 +9,7 @@
 #include <stdlib.h>
 #include <malloc.h>
 
-VG_STATIC void vg_print_backtrace(void);
+static void vg_print_backtrace(void);
 
 #define VG_MAX_ALLOCATIONS 128
 #define VG_FUZZ_ALLOCATIONS
@@ -64,46 +64,46 @@ struct vg_linear_allocator
 };
 #pragma pack(pop)
 
-VG_STATIC u32 vg_align8( u32 s );
-VG_STATIC u32 vg_align4( u32 s );
+static u32 vg_align8( u32 s );
+static u32 vg_align4( u32 s );
 
 /* allocate something from a linear allocator */
 __attribute__((warn_unused_result))
-VG_STATIC void *_vg_linear_alloc( void *buffer, u32 size, 
+static void *_vg_linear_alloc( void *buffer, u32 size, 
                                   const char *constr_name );
 
 /* resize latest block of memory from linear */
 __attribute__((warn_unused_result))
-VG_STATIC void *vg_linear_resize( void *buffer, void *data, u32 newsize );
+static void *vg_linear_resize( void *buffer, void *data, u32 newsize );
 
 /* its possible to delete just the last item */
-VG_STATIC void vg_linear_del( void *buffer, void *data );
+static void vg_linear_del( void *buffer, void *data );
 
 /* extend latest block of memory from linear */
 __attribute__((warn_unused_result))
-VG_STATIC void *_vg_linear_extend( void *buffer, void *data, u32 extra,
+static void *_vg_linear_extend( void *buffer, void *data, u32 extra,
                                    const char *constr_name );
 
 /* get the current usage of allocator */
-VG_STATIC u32 vg_linear_get_cur( void *buffer );
+static u32 vg_linear_get_cur( void *buffer );
 
 /* get the capacity of allocator. */
-VG_STATIC u32 vg_linear_get_capacity( void *buffer );
+static u32 vg_linear_get_capacity( void *buffer );
 
 /* get the remaining size of the allocator */
-VG_STATIC u32 vg_linear_remaining( void *buffer );
+static u32 vg_linear_remaining( void *buffer );
 
 /* yeet all memory from linear allocator */
-VG_STATIC void vg_linear_clear( void *buffer );
+static void vg_linear_clear( void *buffer );
 
 /* request all the memory we need in advance */
-VG_STATIC void vg_set_mem_quota( u32 size );
+static void vg_set_mem_quota( u32 size );
 
 /* essentially init() */
-VG_STATIC void vg_alloc_quota(void);
+static void vg_alloc_quota(void);
 
 /* print out tree of current memory used. only works with libc mode */
-VG_STATIC void vg_mem_log( void *lin_alloc, int depth, const char *name );
+static void vg_mem_log( void *lin_alloc, int depth, const char *name );
 
 #define VG_MEM_MCSTR(S) VG_MEM_MCSTR2(S)
 #define VG_MEM_MCSTR2(S) #S
@@ -119,20 +119,20 @@ VG_STATIC void vg_mem_log( void *lin_alloc, int depth, const char *name );
  * ----------------------------------------
  */
 
-VG_STATIC void vg_fatal_error( const char *fmt, ... );
+static void vg_fatal_error( const char *fmt, ... );
 
 #if 0
-VG_STATIC void vg_error(const char *fmt, ...);
-VG_STATIC void vg_info(const char *fmt, ...);
+static void vg_error(const char *fmt, ...);
+static void vg_info(const char *fmt, ...);
 #endif
 
-VG_STATIC u32 vg_align8( u32 s )
+static u32 vg_align8( u32 s )
 {
    u32 m = (s + 7) >> 3;
    return m << 3;
 }
 
-VG_STATIC u32 vg_align4( u32 s )
+static u32 vg_align4( u32 s )
 {
    u32 m = (s + 3) >> 2;
    return m << 2;
@@ -149,7 +149,7 @@ static vg_linear_allocator *vg_linear_header( void *data )
 
 /* allocate something from a linear allocator */
 __attribute__((warn_unused_result))
-VG_STATIC void *_vg_linear_alloc( void *buffer, u32 size, 
+static void *_vg_linear_alloc( void *buffer, u32 size, 
                                   const char *constr_name )
 {
    if( size % 8 ){
@@ -214,7 +214,7 @@ VG_STATIC void *_vg_linear_alloc( void *buffer, u32 size,
 
 /* resize latest block of memory from linear */
 __attribute__((warn_unused_result))
-VG_STATIC void *vg_linear_resize( void *buffer, void *data, u32 newsize )
+static void *vg_linear_resize( void *buffer, void *data, u32 newsize )
 {
    vg_linear_allocator *alloc = vg_linear_header( buffer );
 
@@ -249,7 +249,7 @@ VG_STATIC void *vg_linear_resize( void *buffer, void *data, u32 newsize )
 }
 
 /* its possible to delete just the last item */
-VG_STATIC void vg_linear_del( void *buffer, void *data )
+static void vg_linear_del( void *buffer, void *data )
 {
    vg_linear_allocator *alloc = vg_linear_header( buffer );
 
@@ -274,7 +274,7 @@ VG_STATIC void vg_linear_del( void *buffer, void *data )
 
 /* extend latest block of memory from linear */
 __attribute__((warn_unused_result))
-VG_STATIC void *_vg_linear_extend( void *buffer, void *data, u32 extra,
+static void *_vg_linear_extend( void *buffer, void *data, u32 extra,
                                    const char *constr_name )
 {
    if( !data )
@@ -290,28 +290,28 @@ VG_STATIC void *_vg_linear_extend( void *buffer, void *data, u32 extra,
 }
 
 /* get the current usage of allocator */
-VG_STATIC u32 vg_linear_get_cur( void *buffer )
+static u32 vg_linear_get_cur( void *buffer )
 {
    vg_linear_allocator *alloc = vg_linear_header( buffer );
    return alloc->cur;
 }
 
 /* get the capacity of allocator. */
-VG_STATIC u32 vg_linear_get_capacity( void *buffer )
+static u32 vg_linear_get_capacity( void *buffer )
 {
    vg_linear_allocator *alloc = vg_linear_header( buffer );
    return alloc->size;
 }
 
 /* get the remaining size of the allocator */
-VG_STATIC u32 vg_linear_remaining( void *buffer )
+static u32 vg_linear_remaining( void *buffer )
 {
    vg_linear_allocator *alloc = vg_linear_header( buffer );
    return alloc->size - alloc->cur;
 }
 
 /* yeet all memory from linear allocator */
-VG_STATIC void vg_linear_clear( void *buffer )
+static void vg_linear_clear( void *buffer )
 {
    vg_linear_allocator *alloc = vg_linear_header( buffer );
 
@@ -340,7 +340,7 @@ VG_STATIC void vg_linear_clear( void *buffer )
 }
 
 /* allocate a FIXED SIZE linear allocator */
-VG_STATIC void *_vg_create_linear_allocator( void *lin_alloc, u32 size, 
+static void *_vg_create_linear_allocator( void *lin_alloc, u32 size, 
                                              u16 flags, const char *constr_name)
 {
    assert( sizeof( vg_linear_allocator ) == 32 );
@@ -410,12 +410,12 @@ VG_STATIC void *_vg_create_linear_allocator( void *lin_alloc, u32 size,
 }
 
 /* request all the memory we need in advance */
-VG_STATIC void vg_set_mem_quota( u32 size )
+static void vg_set_mem_quota( u32 size )
 {
    vg_mem.quota = size;
 }
 
-VG_STATIC void vg_alloc_quota(void)
+static void vg_alloc_quota(void)
 {
    u32 size_scratch = 10*1024*1024;
    u32 size = VG_MAX( vg_mem.quota, size_scratch );
@@ -428,7 +428,7 @@ VG_STATIC void vg_alloc_quota(void)
                                                  "Scratch buffer" );
 }
 
-VG_STATIC void vg_mem_log( void *lin_alloc, int depth, const char *name )
+static void vg_mem_log( void *lin_alloc, int depth, const char *name )
 {
    if( vg_mem.use_libc_malloc ){
       vg_linear_allocator *alloc = vg_linear_header( lin_alloc );
index 1b0317c0c30b0b43ff971fa97c01370eb89987de..30751f2817ec0dde038948a89d2b68182d65d5f3 100644 (file)
@@ -1,12 +1,6 @@
 #ifndef VG_PLATFORM_H
 #define VG_PLATFORM_H
 
-#ifdef VG_RELEASE
- #define VG_STATIC static
-#else
- #define VG_STATIC
-#endif
-
 //#include "vg.h"
 #include "vg_stdint.h"
 
@@ -57,8 +51,8 @@ enum strncpy_behaviour{
    k_strncpy_overflow_fatal = 2
 };
 
-VG_STATIC void vg_fatal_error( const char *fmt, ... );
-VG_STATIC u32 vg_strncpy( const char *src, char *dst, u32 len,
+static void vg_fatal_error( const char *fmt, ... );
+static u32 vg_strncpy( const char *src, char *dst, u32 len,
                           enum strncpy_behaviour behaviour )
 {
    for( u32 i=0; i<len; i++ ){
@@ -86,7 +80,7 @@ struct vg_str{
    u32 i, len;
 };
 
-VG_STATIC void vg_strnull( vg_str *str, char *buffer, u32 len )
+static void vg_strnull( vg_str *str, char *buffer, u32 len )
 {
    str->buffer = buffer;
    str->buffer[0] = '\0';
@@ -94,7 +88,7 @@ VG_STATIC void vg_strnull( vg_str *str, char *buffer, u32 len )
    str->len = len;
 }
 
-VG_STATIC void vg_strcat( vg_str *str, const char *append )
+static void vg_strcat( vg_str *str, const char *append )
 {
    if( !append ) return;
    for( u32 i=0; str->i < str->len; i++, str->i ++ ){
@@ -104,7 +98,7 @@ VG_STATIC void vg_strcat( vg_str *str, const char *append )
    }
 }
 
-VG_STATIC int vg_strgood( vg_str *str )
+static int vg_strgood( vg_str *str )
 {
    if( str->i == str->len ){
       if( str->buffer[str->i -1] == '\0' ) return 1;
@@ -113,7 +107,7 @@ VG_STATIC int vg_strgood( vg_str *str )
    else return 1;
 }
 
-VG_STATIC char *vg_strch( vg_str *str, char c )
+static char *vg_strch( vg_str *str, char c )
 {
    char *ptr = NULL;
    for( u32 i=0; i<str->i; i++ ){
@@ -124,7 +118,7 @@ VG_STATIC char *vg_strch( vg_str *str, char c )
    return ptr;
 }
 
-VG_STATIC u32 vg_strdjb2( const char *str )
+static u32 vg_strdjb2( const char *str )
 {
    u32 hash = 5381, c;
 
@@ -134,7 +128,7 @@ VG_STATIC u32 vg_strdjb2( const char *str )
    return hash;
 }
 
-VG_STATIC int vg_strdjb2_eq( const char *s1, u32 h1, 
+static int vg_strdjb2_eq( const char *s1, u32 h1, 
                              const char *s2, u32 h2 )
 {
    if( h1 == h2 ){
index dedea02ca887fb9ef6ca9bbddf2b8cd510a68201..67808a7a6d42d898f42e747d0be49f0a4528b8aa 100644 (file)
@@ -26,12 +26,12 @@ struct vg_profile
    u64 start;
 };
 
-VG_STATIC void vg_profile_begin( struct vg_profile *profile )
+static void vg_profile_begin( struct vg_profile *profile )
 {
    profile->start = SDL_GetPerformanceCounter();
 }
 
-VG_STATIC void vg_profile_increment( struct vg_profile *profile )
+static void vg_profile_increment( struct vg_profile *profile )
 {
    profile->buffer_current ++;
 
@@ -44,7 +44,7 @@ VG_STATIC void vg_profile_increment( struct vg_profile *profile )
    profile->samples[ profile->buffer_current ] = 0;
 }
 
-VG_STATIC void vg_profile_end( struct vg_profile *profile )
+static void vg_profile_end( struct vg_profile *profile )
 {
    u64 time_end = SDL_GetPerformanceCounter(),
        delta    = time_end - profile->start;
@@ -58,7 +58,7 @@ VG_STATIC void vg_profile_end( struct vg_profile *profile )
    }
 }
 
-VG_STATIC void vg_profile_drawn( struct vg_profile **profiles, u32 count,
+static void vg_profile_drawn( struct vg_profile **profiles, u32 count,
                               float budget, ui_rect panel, u32 colour_offset )
 {
    if( !vg_profiler )
@@ -135,7 +135,7 @@ VG_STATIC void vg_profile_drawn( struct vg_profile **profiles, u32 count,
    }
 }
 
-VG_STATIC void vg_profiler_init(void)
+static void vg_profiler_init(void)
 {
    VG_VAR_I32( vg_profiler, flags=VG_VAR_PERSISTENT );
 }
index 3334922f53ac452bf1d2fdc9f9a7a32f4226f7f9..6537ec9c659064c42f4ca86a6c82627209cef962 100644 (file)
@@ -40,7 +40,7 @@ struct
 }
 static vg_shaders;
 
-VG_STATIC GLuint vg_shader_subshader( const char *src, GLint gliShaderType )
+static GLuint vg_shader_subshader( const char *src, GLint gliShaderType )
 {
        GLint shader = glCreateShader( gliShaderType );
 
@@ -69,7 +69,7 @@ VG_STATIC GLuint vg_shader_subshader( const char *src, GLint gliShaderType )
        return shader;
 }
 
-VG_STATIC int vg_shader_compile( struct vg_shader *shader )
+static int vg_shader_compile( struct vg_shader *shader )
 {
        GLuint program, vert, frag;
 
@@ -167,7 +167,7 @@ VG_STATIC int vg_shader_compile( struct vg_shader *shader )
        return 1;
 }
 
-VG_STATIC void vg_free_shader( struct vg_shader *shader )
+static void vg_free_shader( struct vg_shader *shader )
 {
    if( shader->compiled )
    {
@@ -176,7 +176,7 @@ VG_STATIC void vg_free_shader( struct vg_shader *shader )
    }
 }
 
-VG_STATIC void vg_shaders_compile(void)
+static void vg_shaders_compile(void)
 {
        vg_info( "Compiling shaders\n" );
 
@@ -188,7 +188,7 @@ VG_STATIC void vg_shaders_compile(void)
        }
 }
 
-VG_STATIC int vg_shaders_live_recompile(int argc, const char *argv[])
+static int vg_shaders_live_recompile(int argc, const char *argv[])
 {
    vg_info( "Recompiling shaders\n" );
    for( int i=0; i<vg_shaders.count; i ++ )
@@ -200,7 +200,7 @@ VG_STATIC int vg_shaders_live_recompile(int argc, const char *argv[])
    return 0;
 }
 
-VG_STATIC void vg_shader_register( struct vg_shader *shader )
+static void vg_shader_register( struct vg_shader *shader )
 {
    if( vg_shaders.count == vg_list_size(vg_shaders.shaders) )
       vg_fatal_error( "Too many shaders" );
index ac5920a480c126f806eabe453dc9f4dfe86eee84..7b2142c371bc62d654c1db9e6b2b6020d822c738 100644 (file)
--- a/vg_tex.h
+++ b/vg_tex.h
@@ -126,7 +126,7 @@ struct texture_load_info{
    u8 *rgba;
 };
 
-VG_STATIC void async_vg_tex2d_upload( void *payload, u32 size )
+static void async_vg_tex2d_upload( void *payload, u32 size )
 {
    if( vg_thread_purpose() != k_thread_purpose_main ){
       vg_fatal_error( "Catastrophic programming error.\n" );
@@ -170,7 +170,7 @@ VG_STATIC void async_vg_tex2d_upload( void *payload, u32 size )
    }
 }
 
-VG_STATIC void vg_tex2d_replace_with_error( GLuint *dest )
+static void vg_tex2d_replace_with_error( GLuint *dest )
 {
    u32 hdr_size = vg_align8(sizeof(struct texture_load_info));
 
@@ -186,7 +186,7 @@ VG_STATIC void vg_tex2d_replace_with_error( GLuint *dest )
    vg_async_dispatch( call, async_vg_tex2d_upload );
 }
 
-VG_STATIC 
+static 
 void vg_tex2d_load_qoi_async( const u8 *bytes, u32 size, 
                               u32 flags, GLuint *dest )
 {
@@ -320,7 +320,7 @@ void vg_tex2d_load_qoi_async( const u8 *bytes, u32 size,
    vg_async_dispatch( call, async_vg_tex2d_upload );
 }
 
-VG_STATIC 
+static 
 void vg_tex2d_load_qoi_async_file( const char *path, u32 flags, GLuint *dest )
 {
    vg_linear_clear( vg_mem.scratch );