From: hgn Date: Fri, 3 Nov 2023 14:45:58 +0000 (+0000) Subject: compiler warnings X-Git-Url: https://harrygodden.com/git/?a=commitdiff_plain;h=3ff626ceee3a5cb7fe9604c63e297815fe14453f;p=carveJwlIkooP6JGAAIwe30JlM.git compiler warnings --- diff --git a/network_compression.h b/network_compression.h index 6ef08f9..d4e3655 100644 --- a/network_compression.h +++ b/network_compression.h @@ -28,7 +28,7 @@ static void bitpack_bytes( bitpack_ctx *ctx, u32 bytes, void *data ){ if( index < ctx->buffer_len ) ext[i] = ctx->buffer[index]; else - ext[i] = 0x00; + return; } } ctx->bytes += bytes; diff --git a/player_walk.c b/player_walk.c index 3645e2d..952db86 100644 --- a/player_walk.c +++ b/player_walk.c @@ -1048,11 +1048,14 @@ static void player__walk_animator_exchange( bitpack_ctx *ctx, void *data ){ bitpack_qf32( ctx, 8, -k_sit_pitch_limit, k_sit_pitch_limit, &animator->pitch ); - bitpack_bytes( ctx, 8, &animator->outro_type ); - if( animator->outro_type ){ - bitpack_bytes(ctx, sizeof(animator->foot_anchor), animator->foot_anchor ); - bitpack_qf32( ctx, 8, 0.0f, 1.0f, &animator->outro_t ); - bitpack_qf32( ctx, 8, 0.0f, 1.0f, &animator->commit_t ); + for( int i=0; i<1; i++ ){ /* without this you get a warning from gcc. lol */ + bitpack_bytes( ctx, 8, &animator->outro_type ); + if( animator->outro_type ){ + bitpack_bytes( ctx, sizeof(animator->foot_anchor), + animator->foot_anchor ); + bitpack_qf32( ctx, 8, 0.0f, 1.0f, &animator->outro_t ); + bitpack_qf32( ctx, 8, 0.0f, 1.0f, &animator->commit_t ); + } } } #endif /* PLAYER_DEVICE_WALK_H */