From 392be5c469731606629f0c6fdbaa48d1cb2457c8 Mon Sep 17 00:00:00 2001 From: "BADIM-PC\\Vadim" Date: Thu, 23 Nov 2017 13:20:11 +0300 Subject: [PATCH] static inline functions --- src/tic.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tic.c b/src/tic.c index 6246e7d..f32b7a3 100644 --- a/src/tic.c +++ b/src/tic.c @@ -83,17 +83,17 @@ static void update_amp(blip_buffer_t* blip, tic_sound_register_data* data, s32 n blip_add_delta( blip, data->time, delta ); } -inline s32 freq2note(double freq) +static inline s32 freq2note(double freq) { return (s32)round((double)NOTES * log2(freq / BASE_NOTE_FREQ)) + BASE_NOTE_POS; } -inline double note2freq(s32 note) +static inline double note2freq(s32 note) { return pow(2, (note - BASE_NOTE_POS) / (double)NOTES) * BASE_NOTE_FREQ; } -inline s32 freq2period(double freq) +static inline s32 freq2period(double freq) { if(freq == 0.0) return MAX_PERIOD_VALUE; @@ -106,7 +106,7 @@ inline s32 freq2period(double freq) return period; } -inline s32 getAmp(const tic_sound_register* reg, s32 amp) +static inline s32 getAmp(const tic_sound_register* reg, s32 amp) { enum {MaxAmp = (u16)-1 / (MAX_VOLUME * TIC_SOUND_CHANNELS)}; @@ -149,7 +149,7 @@ static void resetPalette(tic_mem* memory) memory->ram.vram.vars.mask.data = TIC_GAMEPAD_MASK; } -static void setPixel(tic_machine* machine, s32 x, s32 y, u8 color) +static inline void setPixel(tic_machine* machine, s32 x, s32 y, u8 color) { if(x < machine->state.clip.l || y < machine->state.clip.t || x >= machine->state.clip.r || y >= machine->state.clip.b) return; @@ -1579,7 +1579,7 @@ static s32 api_save(const tic_cartridge* cart, u8* buffer) } // copied from SDL2 -inline void memset4(void *dst, u32 val, u32 dwords) +static inline void memset4(void *dst, u32 val, u32 dwords) { #if defined(__GNUC__) && defined(i386) s32 u0, u1, u2;