Skip to content

Commit dc8964a

Browse files
committed
src: fix shadowing warnings
Renames a few variables and parameters to avoid shadowing names.
1 parent f9708bc commit dc8964a

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/CanvasRenderingContext2d.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,8 +745,8 @@ NAN_METHOD(Context2d::GetImageData) {
745745
Local<Int32> shHandle = Nan::New(sh);
746746
Local<Value> argv[argc] = { clampedArray, swHandle, shHandle };
747747

748-
Local<Function> constructor = Nan::GetFunction(Nan::New(ImageData::constructor)).ToLocalChecked();
749-
Local<Object> instance = Nan::NewInstance(constructor, argc, argv).ToLocalChecked();
748+
Local<Function> ctor = Nan::GetFunction(Nan::New(ImageData::constructor)).ToLocalChecked();
749+
Local<Object> instance = Nan::NewInstance(ctor, argc, argv).ToLocalChecked();
750750

751751
info.GetReturnValue().Set(instance);
752752
}

src/backend/Backend.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Backend::~Backend()
1616
}
1717

1818

19-
void Backend::setCanvas(Canvas* canvas)
19+
void Backend::setCanvas(Canvas* _canvas)
2020
{
21-
this->canvas = canvas;
21+
this->canvas = _canvas;
2222
}
2323

2424

@@ -53,19 +53,19 @@ int Backend::getWidth()
5353
{
5454
return this->width;
5555
}
56-
void Backend::setWidth(int width)
56+
void Backend::setWidth(int width_)
5757
{
58-
this->width = width;
58+
this->width = width_;
5959
this->recreateSurface();
6060
}
6161

6262
int Backend::getHeight()
6363
{
6464
return this->height;
6565
}
66-
void Backend::setHeight(int height)
66+
void Backend::setHeight(int height_)
6767
{
68-
this->height = height;
68+
this->height = height_;
6969
this->recreateSurface();
7070
}
7171

src/toBuffer.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010

1111
cairo_status_t
12-
toBuffer(void *c, const uint8_t *data, unsigned len) {
12+
toBuffer(void *c, const uint8_t *odata, unsigned len) {
1313
closure_t *closure = (closure_t *) c;
1414

1515
if (closure->len + len > closure->max_len) {
@@ -26,7 +26,7 @@ toBuffer(void *c, const uint8_t *data, unsigned len) {
2626
closure->max_len = max;
2727
}
2828

29-
memcpy(closure->data + closure->len, data, len);
29+
memcpy(closure->data + closure->len, odata, len);
3030
closure->len += len;
3131

3232
return CAIRO_STATUS_SUCCESS;

0 commit comments

Comments
 (0)