Skip to content

Commit

Permalink
Automated Code Change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 614571272
Change-Id: Idb1f52d5f27238949feb1dff03bfaaa0c50de678
  • Loading branch information
okunz authored and copybara-github committed Mar 11, 2024
1 parent d33fe26 commit 3990ff2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
3 changes: 1 addition & 2 deletions oss-internship-2020/gdal/raster_to_gtiff/gtiff_converter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ absl::Status RasterToGTiffProcessor::Main() {
sapi::v::RemotePtr driver_ptr(driver.value());

sapi::v::ConstCStr out_file_full_path_ptr(out_file_full_path_.c_str());
sapi::v::NullPtr create_options;

GDALDataType type = data_.bands.size() > 0
? static_cast<GDALDataType>(data_.bands[0].data_type)
Expand All @@ -61,7 +60,7 @@ absl::Status RasterToGTiffProcessor::Main() {
absl::StatusOr<GDALDatasetH> dataset,
api.GDALCreate(&driver_ptr, out_file_full_path_ptr.PtrBefore(),
data_.width, data_.height, data_.bands.size(), type,
&create_options));
nullptr));

TRANSACTION_FAIL_IF_NOT(dataset.value(), "Error creating dataset");
sapi::v::RemotePtr dataset_ptr(dataset.value());
Expand Down
9 changes: 4 additions & 5 deletions oss-internship-2020/libpng/examples/example1.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,17 @@ absl::Status LibPNGMain(const std::string& infile, const std::string& outfile) {

sapi::v::Array<uint8_t> buffer(PNG_IMAGE_SIZE(*image.mutable_data()));

sapi::v::NullPtr null = sapi::v::NullPtr();
SAPI_ASSIGN_OR_RETURN(result,
api.png_image_finish_read(image.PtrBoth(), &null,
buffer.PtrBoth(), 0, &null));
SAPI_ASSIGN_OR_RETURN(
result, api.png_image_finish_read(image.PtrBoth(), nullptr,
buffer.PtrBoth(), 0, nullptr));
if (!result) {
return absl::InternalError(
absl::StrCat("finish read error: ", image.mutable_data()->message));
}

SAPI_ASSIGN_OR_RETURN(result, api.png_image_write_to_file(
image.PtrBoth(), outfile_var.PtrBefore(), 0,
buffer.PtrBoth(), 0, &null));
buffer.PtrBoth(), 0, nullptr));
if (!result) {
return absl::InternalError(
absl::StrCat("write error: ", image.mutable_data()->message));
Expand Down
10 changes: 5 additions & 5 deletions oss-internship-2020/libpng/tests/basic_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@ TEST(SandboxTest, ReadWrite) {
<< "image version changed";

sapi::v::Array<uint8_t> buffer(PNG_IMAGE_SIZE(*image.mutable_data()));
sapi::v::NullPtr null = sapi::v::NullPtr();
status_or_int = api.png_image_finish_read(image.PtrBoth(), &null,
buffer.PtrBoth(), 0, &null);
status_or_int = api.png_image_finish_read(image.PtrBoth(), nullptr,
buffer.PtrBoth(), 0, nullptr);
ASSERT_THAT(status_or_int, IsOk())
<< "fatal error when invoking png_image_finish_read";
ASSERT_THAT(status_or_int.value(), IsTrue())
Expand All @@ -76,8 +75,9 @@ TEST(SandboxTest, ReadWrite) {
ASSERT_THAT(image.mutable_data()->format, Eq(PNG_FORMAT_RGBA))
<< "image format changed";

status_or_int = api.png_image_write_to_file(
image.PtrBoth(), outfile_var.PtrBefore(), 0, buffer.PtrBoth(), 0, &null);
status_or_int =
api.png_image_write_to_file(image.PtrBoth(), outfile_var.PtrBefore(), 0,
buffer.PtrBoth(), 0, nullptr);
ASSERT_THAT(status_or_int, IsOk())
<< "fatal error when invoking png_image_write_to_file";
ASSERT_THAT(status_or_int.value(), IsTrue())
Expand Down
3 changes: 1 addition & 2 deletions oss-internship-2020/libuv/examples/idle-basic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ absl::Status IdleBasic() {
}

// Close idler
sapi::v::NullPtr null_ptr;
SAPI_RETURN_IF_ERROR(api.sapi_uv_close(&idler, &null_ptr));
SAPI_RETURN_IF_ERROR(api.sapi_uv_close(&idler, nullptr));

// Close loop
SAPI_ASSIGN_OR_RETURN(return_code, api.sapi_uv_loop_close(&loop));
Expand Down

0 comments on commit 3990ff2

Please sign in to comment.