using auto* for pointers

This commit is contained in:
Alexandra Latysheva 2020-10-11 10:11:56 +00:00
parent 6945f7304f
commit ab3f992c78
2 changed files with 6 additions and 6 deletions

View File

@ -60,7 +60,7 @@ absl::Status CheckCluster(uint32_t cluster,
if (buffer.GetSize() <= cluster * kClusterSize) {
return absl::InternalError("Buffer overrun\n");
}
auto target = buffer.GetData() + cluster * kClusterSize;
auto* target = buffer.GetData() + cluster * kClusterSize;
if (!std::memcmp(target, expected_cluster.data(), kClusterSize)) {
return absl::OkStatus();
@ -80,7 +80,7 @@ absl::Status CheckRgbPixel(uint32_t pixel, const ChannelLimits& limits,
if (buffer.GetSize() <= pixel * kChannelsInPixel) {
return absl::InternalError("Buffer overrun\n");
}
auto rgb = buffer.GetData() + kChannelsInPixel * pixel;
auto* rgb = buffer.GetData() + kChannelsInPixel * pixel;
if (rgb[0] >= limits.min_red && rgb[0] <= limits.max_red &&
rgb[1] >= limits.min_green && rgb[1] <= limits.max_green &&
@ -104,7 +104,7 @@ absl::Status CheckRgbaPixel(uint32_t pixel, const ChannelLimits& limits,
return absl::InternalError("Buffer overrun\n");
}
auto rgba = buffer[adjusted_pixel];
auto* rgba = buffer[adjusted_pixel];
if (TIFFGetR(rgba) >= static_cast<unsigned>(limits.min_red) &&
TIFFGetR(rgba) <= static_cast<unsigned>(limits.max_red) &&
TIFFGetG(rgba) >= static_cast<unsigned>(limits.min_green) &&

View File

@ -64,7 +64,7 @@ bool CheckCluster(uint32_t cluster, const sapi::v::Array<uint8_t>& buffer,
return true;
}
auto target = buffer.GetData() + cluster * kClusterSize;
auto* target = buffer.GetData() + cluster * kClusterSize;
bool comp =
!(std::memcmp(target, expected_cluster.data(), kClusterSize) == 0);
@ -89,7 +89,7 @@ bool CheckRgbPixel(uint32_t pixel, const ChannelLimits& limits,
return true;
}
auto rgb = buffer.GetData() + pixel * kChannelsInPixel;
auto* rgb = buffer.GetData() + pixel * kChannelsInPixel;
bool comp = !(rgb[0] >= limits.min_red && rgb[0] <= limits.max_red &&
rgb[1] >= limits.min_green && rgb[1] <= limits.max_green &&
rgb[2] >= limits.min_blue && rgb[2] <= limits.max_blue);
@ -115,7 +115,7 @@ bool CheckRgbaPixel(uint32_t pixel, const ChannelLimits& limits,
return true;
}
auto rgba = buffer[adjusted_pixel];
auto* rgba = buffer[adjusted_pixel];
bool comp = !(TIFFGetR(rgba) >= static_cast<unsigned>(limits.min_red) &&
TIFFGetR(rgba) <= static_cast<unsigned>(limits.max_red) &&
TIFFGetG(rgba) >= static_cast<unsigned>(limits.min_green) &&