From 42abcaba54cb52d39bd8be4a3328eb2754c1f62f Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Sat, 13 Apr 2024 13:41:30 +0200 Subject: [PATCH] naming --- src/gui_buttons.c | 2 +- src/pfiles.c | 6 +++--- src/pfiles.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui_buttons.c b/src/gui_buttons.c index 017c61c..53f5dd5 100644 --- a/src/gui_buttons.c +++ b/src/gui_buttons.c @@ -172,4 +172,4 @@ void press_ON( void ) { kbd_on_pressed(); } void release_ON( void ) { kbd_on_released(); } void press_LoadFile( void ) {} -void release_LoadFile( void ) { load_file( "zeldahp.dir" ); } +void release_LoadFile( void ) { load_file_on_stack( "zeldahp.dir" ); } diff --git a/src/pfiles.c b/src/pfiles.c index bb043ff..0e20ed0 100644 --- a/src/pfiles.c +++ b/src/pfiles.c @@ -41,9 +41,9 @@ int file_size( char* name ) sprintf( fullpath, "%s/%s", WorkingPath, name ); printf( "%s\n", fullpath ); f = fopen( fullpath, "r" ); - if ( !f ) { + if ( !f ) return 0; - } + fseek( f, 0, SEEK_END ); // seek to end of file int size = ( int )ftell( f ); // get current file pointer fseek( f, 0, SEEK_SET ); // seek back to beginning of file @@ -52,7 +52,7 @@ int file_size( char* name ) return size; } -void load_file( char* name ) +void load_file_on_stack( char* name ) { FILE* f; byte* buf; diff --git a/src/pfiles.h b/src/pfiles.h index 9310215..5f57e48 100644 --- a/src/pfiles.h +++ b/src/pfiles.h @@ -6,6 +6,6 @@ extern char WorkingPath[ 512 ]; extern int file_size( char* name ); -extern void load_file( char* name ); +extern void load_file_on_stack( char* name ); #endif