Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephane Gouache committed Apr 19, 2024
1 parent 1467e70 commit ad33be3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ find_package(fmt CONFIG REQUIRED)
find_package(google_cloud_cpp_storage CONFIG REQUIRED)
find_package(spdlog CONFIG REQUIRED)

add_library(khiopsdriver_file_gcs MODULE src/gcsplugin.cpp)
add_library(khiopsdriver_file_gcs MODULE src/gcsplugin.h src/gcsplugin.cpp)

target_link_libraries(khiopsdriver_file_gcs
PRIVATE CURL::libcurl google-cloud-cpp::storage google-cloud-cpp::storage_protos google-cloud-cpp::experimental-storage-grpc spdlog::spdlog_header_only)
Expand Down
7 changes: 4 additions & 3 deletions src/gcsplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ bool ParseGcsUri(const std::string& gcs_uri, std::string& bucket_name, std::stri
void FallbackToDefaultBucket(std::string& bucket_name) {
if (!bucket_name.empty())
return;
if (!globalBucketName.empty())
if (!globalBucketName.empty()) {
bucket_name = globalBucketName;

return;
}
spdlog::critical("No bucket specified, and GCS_BUCKET_NAME is not set!");
}

Expand Down Expand Up @@ -180,7 +181,7 @@ int driver_exist(const char *filename)
{
spdlog::debug("exist {}", filename);

std::string file_uri = filename;
std::string file_uri = str(filename);
if (file_uri.back() == '/') {
return driver_dirExists(filename);
} else {
Expand Down
11 changes: 5 additions & 6 deletions src/khiopsplugintest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ int main(int argc, char* argv[])
library_handle = load_shared_library(argv[1]);
if (!library_handle)
{
std::cerr << fmt::format("Error while loading library {}\n", argv[1]);
std::cerr << fmt::format("Error while loading library {}", argv[1]);
#ifdef __unix_or_mac__
std::cerr << fmt::format(" (%s).\n", dlerror());
std::cerr << fmt::format(" ({}).\n", dlerror());
#else
std::cerr << fmt::format(" (0x%x).\n", GetLastError());
std::cerr << fmt::format(" ({}).\n", GetLastError());
#endif
std::cerr << "Check LD_LIBRARY_PATH or set the library with its full path\n";
exit(EXIT_FAILURE);
Expand Down Expand Up @@ -194,10 +194,9 @@ void* get_shared_library_function(void* library_handle, const char* function_nam
{
global_error = 1;
#ifdef __unix_or_mac__
std::cerr << fmt::format("Unable to load %s (%s)\n", function_name, dlerror());
std::cerr << fmt::format("Unable to load {} ({})\n", function_name, dlerror());
#else
std::cerr << fmt::format("Unable to load %s", function_name);
std::cerr << fmt::format("(0x%x)\n", GetLastError());
std::cerr << fmt::format("Unable to load {} ({})\n", function_name, GetLastError());
#endif
}
return ptr;
Expand Down

0 comments on commit ad33be3

Please sign in to comment.