Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephane Gouache committed Oct 1, 2024
1 parent b298534 commit da595bf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/s3plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1225,8 +1225,8 @@ UploadOutcome InitiateAppend(Writer& writer, size_t source_bytes_to_copy)
int64_t start_range = 0;
while (source_bytes_to_copy > Writer::buff_min_)
{
const size_t copy_count =
source_bytes_to_copy > Writer::buff_max_ ? Writer::buff_max_ : source_bytes_to_copy;
const int64_t copy_count =

Check warning on line 1228 in src/s3plugin.cpp

View workflow job for this annotation

GitHub Actions / windows-latest-hosted-ninja-vcpkg_submod-autocache

'initializing': conversion from 'size_t' to 'const int64_t', signed/unsigned mismatch
source_bytes_to_copy > Writer::buff_max_ ? Writer::buff_max_ : static_cast<int64_t>(source_bytes_to_copy);

Check warning on line 1229 in src/s3plugin.cpp

View workflow job for this annotation

GitHub Actions / windows-latest-hosted-ninja-vcpkg_submod-autocache

'initializing': conversion from 'size_t' to 'int64_t', signed/unsigned mismatch

// peculiarity of AWS: the range for the copy request has an inclusive end,
// meaning that the bytes numbered start_range to end_range included are copied
Expand Down
13 changes: 8 additions & 5 deletions test/drivertest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,11 @@ int launch_test(const char *inputFilename, int nBufferSize) {
<< boost::uuids::random_generator()() << "/output.txt";
std::stringstream localOutput;
#ifdef _WIN32
localOutput << std::getenv("TEMP") << "\\out-"
<< boost::uuids::random_generator()() << ".txt";
size_t len;
char tempValue[2048];
getenv_s(&len, tempValue, 2048, "TEMP");
localOutput << tempValue << "\\out-" << boost::uuids::random_generator()()
<< ".txt";
#else
localOutput << "/tmp/out-" << boost::uuids::random_generator()() << ".txt";
#endif
Expand Down Expand Up @@ -334,9 +337,9 @@ int copyFileWithFseek(const char *file_name_input, const char *file_name_output,
// Reads the file by steps of nBufferSize and writes to the output file at
// each step
char *buffer = new char[nBufferSize + 1]();
long long int sizeRead = nBufferSize;
long long int sizeWrite;
int cummulativeRead = 0;
long long sizeRead = nBufferSize;
long long sizeWrite;
long long cummulativeRead = 0;
driver_fseek(fileinput, 0, SEEK_SET);
while (sizeRead == nBufferSize && copy_status == kSuccess) {
driver_fseek(fileinput, cummulativeRead, SEEK_SET);
Expand Down

0 comments on commit da595bf

Please sign in to comment.