Skip to content

Commit

Permalink
Genie: Just use size_t in hash_long_name()
Browse files Browse the repository at this point in the history
  • Loading branch information
jjuran committed Mar 2, 2023
1 parent 49e26a8 commit 49dc8d3
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lamp/Genie/Genie/FS/HFS/hashed_long_name.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@

#include "Genie/FS/HFS/hashed_long_name.hh"

// Standard C/C++
#include <cstddef>

// more-libc
#include "more/string.h"

Expand Down Expand Up @@ -38,7 +35,7 @@ static char base32_encode( unsigned x )

void hash_long_name( unsigned char* hashed, const char* long_name, size_t long_length )
{
const std::size_t max_length = 31;
const size_t max_length = 31;

uint8_t* p = hashed;

Expand Down Expand Up @@ -75,11 +72,11 @@ void hash_long_name( unsigned char* hashed, const char* long_name, size_t long_l
// or if the extension (including the dot) exceeds the limit.
const char* base_end = dotted ? dot : end;

const std::size_t base_length = base_end - begin;
const size_t base_length = base_end - begin;

const std::size_t replaced_length = long_length - max_length + inserted_length;
const size_t replaced_length = long_length - max_length + inserted_length;

const std::size_t shortened_base_length = base_length - replaced_length;
const size_t shortened_base_length = base_length - replaced_length;

ASSERT( shortened_base_length >= minimum_remaining_base );

Expand Down

0 comments on commit 49dc8d3

Please sign in to comment.