Skip to content
Open
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
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
cmake_minimum_required(VERSION 3.2)
project(maconv)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")

# Compile vendor libraries.
add_subdirectory("vendors/libhfs")
Expand Down
6 changes: 3 additions & 3 deletions src/conv/binhex.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace conv {


// Return true if a file is in BinHex format.
bool IsFileBinHex(fs::FileReader &reader)
bool IsFileBinHex(fs::FileReader &/* reader */)
{
// TODO.

Expand All @@ -37,15 +37,15 @@ bool IsFileBinHex(fs::FileReader &reader)


// Read and decode a BinHex file.
void ReadBinHex(fs::FileReader &reader, fs::File &file)
void ReadBinHex(fs::FileReader &/* reader */, fs::File &/* file */)
{
// TODO.
}



// Write a BinHex file.
void WriteBinHex(fs::File &file, fs::FileWriter &writer)
void WriteBinHex(fs::File &/* file */, fs::FileWriter &/* writer */)
{
// TODO.
}
Expand Down
2 changes: 1 addition & 1 deletion src/disk/extract.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static void ExtractFork(hfsfile *hfile, const hfsdirent &ent, fs::File &file,
bool is_res)
{
// Allocate buffer.
int size = is_res ? ent.u.file.rsize : ent.u.file.dsize;
long unsigned int size = is_res ? ent.u.file.rsize : ent.u.file.dsize;
auto buffer = std::make_unique<uint8_t[]>(size);

// Read the data.
Expand Down
3 changes: 2 additions & 1 deletion src/formats/file_signature.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ SignToMac signs_to_mac[] = {


// File signature array.
/*
SignToUnix signs_to_unix[] = {

};

*/


// Call Unix "file" command on a path.
Expand Down
11 changes: 6 additions & 5 deletions src/formats/file_signature.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ struct SignToMac {
// Maching type: extension or file command.
enum Type { Extension, FileCmd } type;

// Help strings (and count)
int help_len;
const char **helps;

// MAC creator and type.
const char *creator;
const char *mac;

// Help strings (and count)
int help_len;
const char **helps;

constexpr SignToMac(Type t, const char *c, const char *m, const char **hs, int hl)
: type{t}, creator{c}, mac{m}, help_len{hl}, helps{hs} {}
};
Expand All @@ -57,8 +57,9 @@ struct SignToUnix {
extern SignToMac signs_to_mac[];

// File signature array.
/*
extern SignToUnix signs_to_unix[];

*/


// Get the MAC type (and creator) for a specific file.
Expand Down
4 changes: 2 additions & 2 deletions src/formats/formats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace maconv {


// Prefered conversion format.
ConvData prefered_conv = { ConvData::NotFound };
ConvData prefered_conv = { ConvData::NotFound, NULL };


// All available converters.
Expand Down Expand Up @@ -69,7 +69,7 @@ ConvData GetConverter(const std::string &name)
return ConvData { ConvData::Double, &format };
}

return ConvData { ConvData::NotFound };
return ConvData { ConvData::NotFound, NULL };
}


Expand Down
3 changes: 1 addition & 2 deletions src/fs/file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,12 @@ int ReadLocalFile(const std::string &filename, fs::DataPtr &ptr)


// Get file infotmation from a local file.
void GetLocalInfo(const std::string &filename, fs::File &file, bool is_res)
void GetLocalInfo(const std::string & /*filename */, fs::File &/* file */, bool /* is_res */)
{
// TODO.
}



// Set file infotmation to a local file.
void SetLocalInfo(fs::File &file, const std::string &filename, bool is_res)
{
Expand Down
2 changes: 1 addition & 1 deletion src/fs/file_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ struct FileReader {

uint8_t *data; // Input data.
uint32_t file_size; // Total size of the file.
std::string filename; // Name of the file to read.

utils::RawDataStreamBuf stream_buf; // Stream buffer from raw data buffer.
std::istream stream; // Stream for reading data.
std::string filename; // Name of the file to read.
};


Expand Down
4 changes: 2 additions & 2 deletions src/stuffit/methods.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void CompressionMethod::Extract(const StuffitCompInfo &info, uint8_t *data,
total_size = 0;

// Uncompress the data chunk by chunks.
for (uint32_t len = 0; true;) {
for (int32_t len = 0; true;) {
len = ReadBytes(buffer.get() + total_size, capacity - total_size);
if (len == -1)
break;
Expand All @@ -89,7 +89,7 @@ void CompressionMethod::Extract(const StuffitCompInfo &info, uint8_t *data,

// Extract data from the compressed fork.
void NoneMethod::Extract(const StuffitCompInfo &info, uint8_t *data,
std::vector<fs::DataPtr> &mem_pool)
std::vector<fs::DataPtr> &/* mem_pool */)
{
total_size = info.size ? info.size : info.comp_size;
uncompressed = data + info.offset;
Expand Down
2 changes: 1 addition & 1 deletion src/stuffit/methods.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct CompressionMethod {


// Read the next bytes.
virtual int32_t ReadBytes(uint8_t *data, uint32_t length) { return -1; }
virtual int32_t ReadBytes(uint8_t * /* data */, uint32_t /* length */) { return -1; }

// Initialize the algorithm.
virtual void Initialize() {}
Expand Down
2 changes: 1 addition & 1 deletion vendors/libhfs/btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ int bt_space(btree *bt, unsigned int nrecs)
* DESCRIPTION: recursively locate a node and insert a record
*/
static
int insertx(node *np, byte *record, int *reclen)
int insertx(node *np, byte *record, unsigned int *reclen)
{
node child;
byte *rec;
Expand Down
2 changes: 1 addition & 1 deletion vendors/libhfs/volume.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ int v_freeblocks(hfsvol *vol, const ExtDescriptor *blocks)
* DESCRIPTION: translate a pathname; return catalog information
*/
int v_resolve(hfsvol **vol, const char *path,
CatDataRec *data, long *parid, char *fname, node *np)
CatDataRec *data, unsigned long *parid, char *fname, node *np)
{
unsigned long dirid;
char name[HFS_MAX_FLEN + 1], *nptr;
Expand Down
2 changes: 1 addition & 1 deletion vendors/libhfs/volume.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ int v_putextrec(const ExtDataRec *, node *);
int v_allocblocks(hfsvol *, ExtDescriptor *);
int v_freeblocks(hfsvol *, const ExtDescriptor *);

int v_resolve(hfsvol **, const char *, CatDataRec *, long *, char *, node *);
int v_resolve(hfsvol **, const char *, CatDataRec *, unsigned long *, char *, node *);

int v_adjvalence(hfsvol *, unsigned long, int, int);
int v_mkdir(hfsvol *, unsigned long, const char *);
Expand Down