Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/geode/basic/zip_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <fstream>
#include <string_view>

#include <mz.h>

Check failure on line 30 in src/geode/basic/zip_file.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/basic/zip_file.cpp:30:10 [clang-diagnostic-error]

'mz.h' file not found
#include <mz_strm.h>
#include <mz_strm_mem.h>
#include <mz_zip.h>
Expand All @@ -39,7 +39,7 @@
namespace
{
std::filesystem::path create_directory(
std::string_view file, std::string_view temp_filename )

Check warning on line 42 in src/geode/basic/zip_file.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/basic/zip_file.cpp:42:9 [bugprone-easily-swappable-parameters]

2 adjacent parameters of 'create_directory' of similar type ('std::string_view') are easily swapped by mistake
{
const auto file_string = geode::to_string( file );
auto directory = std::filesystem::path{ file_string }.parent_path()
Expand All @@ -51,13 +51,13 @@

namespace geode
{
class ZipFile::Impl

Check warning on line 54 in src/geode/basic/zip_file.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/basic/zip_file.cpp:54:20 [cppcoreguidelines-special-member-functions]

class 'Impl' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator
{
public:
Impl( std::string_view file, std::string_view archive_temp_filename )
{
directory_ = create_directory( file, archive_temp_filename );
writer_ = mz_zip_writer_create();

Check warning on line 60 in src/geode/basic/zip_file.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/basic/zip_file.cpp:60:13 [cppcoreguidelines-prefer-member-initializer]

'writer_' should be initialized in a member initializer of the constructor
mz_zip_writer_set_compress_method(
writer_, MZ_COMPRESS_METHOD_STORE );
const auto status = mz_zip_writer_open_file(
Expand All @@ -72,7 +72,7 @@

~Impl()
{
if( writer_ )

Check warning on line 75 in src/geode/basic/zip_file.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/basic/zip_file.cpp:75:17 [readability-implicit-bool-conversion]

implicit conversion 'void *' -> 'bool'
{
mz_zip_writer_close( writer_ );
mz_zip_writer_delete( &writer_ );
Expand Down Expand Up @@ -103,7 +103,7 @@
std::filesystem::remove( file_path );
}

std::string directory() const

Check warning on line 106 in src/geode/basic/zip_file.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/basic/zip_file.cpp:106:9 [modernize-use-nodiscard]

function 'directory' should be marked [[nodiscard]]
{
return directory_.string();
}
Expand Down Expand Up @@ -137,11 +137,17 @@
return impl_->directory();
}

class UnzipFile::Impl

Check warning on line 140 in src/geode/basic/zip_file.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/basic/zip_file.cpp:140:22 [cppcoreguidelines-special-member-functions]

class 'Impl' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator
{
public:
Impl( std::string_view file, std::string_view unarchive_temp_filename )

Check warning on line 143 in src/geode/basic/zip_file.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/basic/zip_file.cpp:143:9 [cppcoreguidelines-pro-type-member-init]

constructor does not initialize these fields: zip_data_
{
if( !std::filesystem::exists( file ) )
{
throw OpenGeodeBasicException( nullptr,
OpenGeodeException::TYPE::data,
"[UnzipFile] File to unzip doesn't exist" );
}
directory_ = create_directory( file, unarchive_temp_filename );
if( !load_zip_into_memory( file ) || !open_reader() )
{
Expand All @@ -161,13 +167,13 @@

~Impl()
{
if( reader_ )

Check warning on line 170 in src/geode/basic/zip_file.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/basic/zip_file.cpp:170:17 [readability-implicit-bool-conversion]

implicit conversion 'void *' -> 'bool'
{
mz_zip_reader_close( reader_ );
mz_zip_reader_delete( &reader_ );
reader_ = nullptr;
}
if( memory_stream_ )

Check warning on line 176 in src/geode/basic/zip_file.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/basic/zip_file.cpp:176:17 [readability-implicit-bool-conversion]

implicit conversion 'void *' -> 'bool'
{
mz_stream_close( memory_stream_ );
mz_stream_delete( &memory_stream_ );
Expand All @@ -178,7 +184,7 @@

void extract_all() const
{
constexpr size_t BUF_SIZE = 1024 * 1024; // 1 MB

Check warning on line 187 in src/geode/basic/zip_file.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/basic/zip_file.cpp:187:41 [bugprone-implicit-widening-of-multiplication-result]

performing an implicit widening conversion to type 'const size_t' (aka 'const unsigned long') of a multiplication performed in type 'int'
std::vector< uint8_t > buffer( BUF_SIZE );
int status = mz_zip_reader_goto_first_entry( reader_ );
while( status == MZ_OK )
Expand Down
7 changes: 5 additions & 2 deletions src/geode/mesh/core/grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,11 @@ namespace geode
OpenGeodeMeshException::check_exception( diff == 0 || diff == 1,
nullptr, OpenGeodeException::TYPE::data,
"[Grid::cell_local_vertex] vertex [", vertex_id[0], ",",
vertex_id[1], "] is not part of cell [", cell_id[0], ",",
cell_id[1], "] vertices." );
vertex_id[1],
dimension == 3 ? absl::StrCat( ",", vertex_id[2] ) : "",
"] is not part of cell [", cell_id[0], ",", cell_id[1],
dimension == 3 ? absl::StrCat( ",", cell_id[2] ) : "",
"] vertices." );
result += diff * ( 1 << d );
}
return result;
Expand Down
Loading