Avoid shadowing

This commit is contained in:
Rod Sheeter
2017-02-23 10:29:01 -08:00
parent 82a9f3afb2
commit 086bc06ce9
3 changed files with 24 additions and 22 deletions
+5 -5
View File
@@ -65,8 +65,8 @@ inline bool Failure(const char *f, int l, const char *fn) {
// -----------------------------------------------------------------------------
class Buffer {
public:
Buffer(const uint8_t *buffer, size_t len)
: buffer_(buffer),
Buffer(const uint8_t *data, size_t len)
: buffer_(data),
length_(len),
offset_(0) { }
@@ -74,7 +74,7 @@ class Buffer {
return Read(NULL, n_bytes);
}
bool Read(uint8_t *buffer, size_t n_bytes) {
bool Read(uint8_t *data, size_t n_bytes) {
if (n_bytes > 1024 * 1024 * 1024) {
return FONT_COMPRESSION_FAILURE();
}
@@ -82,8 +82,8 @@ class Buffer {
(offset_ > length_ - n_bytes)) {
return FONT_COMPRESSION_FAILURE();
}
if (buffer) {
std::memcpy(buffer, buffer_ + offset_, n_bytes);
if (data) {
std::memcpy(data, buffer_ + offset_, n_bytes);
}
offset_ += n_bytes;
return true;