diff --git a/oss-internship-2020/gdal/raster_to_gtiff/gtiff_converter.cc b/oss-internship-2020/gdal/raster_to_gtiff/gtiff_converter.cc index 7cbd34d..b858440 100644 --- a/oss-internship-2020/gdal/raster_to_gtiff/gtiff_converter.cc +++ b/oss-internship-2020/gdal/raster_to_gtiff/gtiff_converter.cc @@ -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(data_.bands[0].data_type) @@ -61,7 +60,7 @@ absl::Status RasterToGTiffProcessor::Main() { absl::StatusOr 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()); diff --git a/oss-internship-2020/libpng/examples/example1.cc b/oss-internship-2020/libpng/examples/example1.cc index d9991f2..e3ad71c 100644 --- a/oss-internship-2020/libpng/examples/example1.cc +++ b/oss-internship-2020/libpng/examples/example1.cc @@ -44,10 +44,9 @@ absl::Status LibPNGMain(const std::string& infile, const std::string& outfile) { sapi::v::Array 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)); @@ -55,7 +54,7 @@ absl::Status LibPNGMain(const std::string& infile, const std::string& outfile) { 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)); diff --git a/oss-internship-2020/libpng/tests/basic_test.cc b/oss-internship-2020/libpng/tests/basic_test.cc index 176479b..24d546a 100644 --- a/oss-internship-2020/libpng/tests/basic_test.cc +++ b/oss-internship-2020/libpng/tests/basic_test.cc @@ -64,9 +64,8 @@ TEST(SandboxTest, ReadWrite) { << "image version changed"; sapi::v::Array 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()) @@ -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()) diff --git a/oss-internship-2020/libuv/examples/idle-basic.cc b/oss-internship-2020/libuv/examples/idle-basic.cc index f4ed3ad..8b758cd 100644 --- a/oss-internship-2020/libuv/examples/idle-basic.cc +++ b/oss-internship-2020/libuv/examples/idle-basic.cc @@ -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));