compiler warnings
authorhgn <hgodden00@gmail.com>
Fri, 3 Nov 2023 14:45:58 +0000 (14:45 +0000)
committerhgn <hgodden00@gmail.com>
Fri, 3 Nov 2023 14:45:58 +0000 (14:45 +0000)
network_compression.h
player_walk.c

index 6ef08f93f69cb7c9de0bc3b9825a0472a4b5ff50..d4e3655a2098d2c9092bf960fc05372a43d0839a 100644 (file)
@@ -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;
index 3645e2dbda6ec1e355fd96243dd06818c5e2a496..952db860a638b5d0218d2c7da0f6a392a34f9eb4 100644 (file)
@@ -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 */