From: Jean-Philippe Bruyère Date: Thu, 20 Mar 2025 16:11:46 +0000 (+0100) Subject: c_str char* cast X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=cb034659a6b6f9bd3a4fa1511958e6ef947ccd54;p=jp%2Fvkvg.git c_str char* cast --- diff --git a/gunit_tests/drawTestBase.cpp b/gunit_tests/drawTestBase.cpp index 71a022c..9fc021f 100644 --- a/gunit_tests/drawTestBase.cpp +++ b/gunit_tests/drawTestBase.cpp @@ -35,7 +35,7 @@ void DrawTestBase::compareWithRefImage() { if (fs::exists(targetPath)) { int w = 0, h = 0, channels = 0; - unsigned char *refImg = stbi_load(targetPath.c_str(), &w, &h, &channels, 4); // force 4 components per pixel + unsigned char *refImg = stbi_load((char*)targetPath.c_str(), &w, &h, &channels, 4); // force 4 components per pixel EXPECT_TRUE(refImg != nullptr) << "Could not load image from " << targetPath << stbi_failure_reason(); EXPECT_EQ(vkvg_surface_get_width(surf),w); EXPECT_EQ(vkvg_surface_get_height(surf),h); @@ -67,13 +67,13 @@ void DrawTestBase::compareWithRefImage() { if (totDiff > 0) { fs::path diffPath = diffDir / ::testing::UnitTest::GetInstance()->current_test_info()->name(); targetPath.replace_extension(".png"); - stbi_write_png(diffPath.c_str(), (int32_t)w, (int32_t)h, 4, diffImg, (int32_t)(4 * w)); + stbi_write_png((char*)diffPath.c_str(), (int32_t)w, (int32_t)h, 4, diffImg, (int32_t)(4 * w)); } free(img); free(diffImg); } else { - vkvg_status_t result = vkvg_surface_write_to_png(surf, targetPath.c_str()); + vkvg_status_t result = vkvg_surface_write_to_png(surf, (char*)targetPath.c_str()); EXPECT_EQ(result, VKVG_STATUS_SUCCESS); GTEST_SKIP() << "Updating reference image: " << targetPath; }