Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mikee47/IFS
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 36637f4e207e14d2484b9b827c573f1ba54392cd
Choose a base ref
...
head repository: mikee47/IFS
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ec9a902121afaebd882b7627907e8fffa78c7b5a
Choose a head ref
  • 2 commits
  • 6 files changed
  • 1 contributor

Commits on Mar 6, 2024

  1. Use std::make_unique and assignment instead of reset()

    mikee47 committed Mar 6, 2024
    Copy the full SHA
    274e4b7 View commit details

Commits on Mar 15, 2024

  1. Add FCNTL_SET_VOLUME_LABEL (for FAT)

    mikee47 committed Mar 15, 2024
    Copy the full SHA
    ec9a902 View commit details
Showing with 9 additions and 6 deletions.
  1. +1 −1 src/FWFS/ArchiveStream.cpp
  2. +1 −1 src/Helpers.cpp
  3. +4 −0 src/include/IFS/Control.h
  4. +1 −1 src/include/IFS/FWFS/ArchiveStream.h
  5. +1 −2 src/include/IFS/FWFS/BlockEncoder.h
  6. +1 −1 test/modules/Archive.cpp
2 changes: 1 addition & 1 deletion src/FWFS/ArchiveStream.cpp
Original file line number Diff line number Diff line change
@@ -309,7 +309,7 @@ bool ArchiveStream::readFileEntry(const Stat& stat)
// Default behaviour
auto stream = new FileStream(fs);
stream->attach(file, stat.size);
encoder.reset(new BasicEncoder(stream));
encoder = std::make_unique<BasicEncoder>(stream);
}
sendDataHeader();
}
2 changes: 1 addition & 1 deletion src/Helpers.cpp
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ class ArchiveFileSystem : public FWFS::FileSystem
{
auto file = fileSys.open(filename, OpenFlag::Read);
if(file >= 0) {
device.reset(new Storage::FileDevice(filename, fileSys, file));
device = std::make_unique<Storage::FileDevice>(filename, fileSys, file);
partition = device->editablePartitions().add(F("archive"), Storage::Partition::SubType::Data::fwfs, 0U,
device->getSize(), 0);
}
4 changes: 4 additions & 0 deletions src/include/IFS/Control.h
Original file line number Diff line number Diff line change
@@ -40,6 +40,10 @@ enum ControlCode : uint16_t {
* is not stored for empty files.
*/
FCNTL_GET_MD5_HASH = 1,
/**
* @brief Set volume label
*/
FCNTL_SET_VOLUME_LABEL = 2,
/**
* @brief Start of user-defined codes
*
2 changes: 1 addition & 1 deletion src/include/IFS/FWFS/ArchiveStream.h
Original file line number Diff line number Diff line change
@@ -235,7 +235,7 @@ class ArchiveStream : public FsBase, public IDataSourceStream

void createContent()
{
content.reset(new ObjectBuffer);
content = std::make_unique<ObjectBuffer>();
}

int addAttribute(AttributeTag tag, const void* data, size_t size);
3 changes: 1 addition & 2 deletions src/include/IFS/FWFS/BlockEncoder.h
Original file line number Diff line number Diff line change
@@ -56,9 +56,8 @@ class IBlockEncoder
class BasicEncoder : public IBlockEncoder
{
public:
BasicEncoder(IDataSourceStream* stream)
BasicEncoder(IDataSourceStream* stream) : stream(stream)
{
this->stream.reset(stream);
}

IDataSourceStream* getNextStream() override
2 changes: 1 addition & 1 deletion test/modules/Archive.cpp
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ class XorEncoder : public IFS::FWFS::IBlockEncoder
buffer[i] ^= 0xAA;
}

stream.reset(new LimitedMemoryStream(buffer, size, size, false));
stream = std::make_unique<LimitedMemoryStream>(buffer, size, size, false);
return stream.get();
}