summaryrefslogtreecommitdiff
path: root/src/blob.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan.goodliffe@octal.co.uk>2022-02-15 17:34:51 +0000
committerDan Goodliffe <dan.goodliffe@octal.co.uk>2022-02-15 17:34:51 +0000
commit4ac149951b2020b4a6dafb0455d3f523e7c9cfe6 (patch)
tree698d4471463b68bc16ce2f291a0eaab86bcb5e13 /src/blob.cpp
parentBump to C++20 for compat with other libs (diff)
downloadnetfs-gitfs-4ac149951b2020b4a6dafb0455d3f523e7c9cfe6.tar.bz2
netfs-gitfs-4ac149951b2020b4a6dafb0455d3f523e7c9cfe6.tar.xz
netfs-gitfs-4ac149951b2020b4a6dafb0455d3f523e7c9cfe6.zip
Fix up all warnings from all the toolsnetfs-gitfs-0.2.2
Diffstat (limited to 'src/blob.cpp')
-rw-r--r--src/blob.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/blob.cpp b/src/blob.cpp
index e3483b8..a5482df 100644
--- a/src/blob.cpp
+++ b/src/blob.cpp
@@ -1,7 +1,14 @@
#include "blob.h"
#include "repo.h"
+#include <Ice/Current.h>
#include <Ice/ObjectAdapter.h>
+#include <algorithm>
+#include <cerrno>
+#include <exceptions.h>
+#include <file.h>
+#include <memory>
#include <sys/stat.h>
+#include <types.h>
GitFS::Blob::Blob(const Repo * const r, std::string && path) :
repo(r), entry(Git::TreeEntryByPath(repo->tree, path)), blob(getBlob()), blobSize(git_blob_rawsize(blob.get())),
@@ -43,13 +50,13 @@ GitFS::Blob::fgetattr(ReqEnv, const ::Ice::Current &)
NetFS::Buffer
GitFS::Blob::read(long long int o, long long int s, const ::Ice::Current &)
{
- const decltype(blobSize) offset(o);
- const decltype(blobSize) size(s);
+ const auto offset {static_cast<BlobSize>(o)};
+ const auto size {static_cast<BlobSize>(s)};
if (offset > blobSize) {
return {};
}
auto len = std::min(blobSize - offset, size);
- return NetFS::Buffer(blobContent + offset, blobContent + offset + len);
+ return {blobContent + offset, blobContent + offset + len};
}
void