Skip to content

Commit

Permalink
rename nonsensical 'p' to 'encoder'
Browse files Browse the repository at this point in the history
  • Loading branch information
pkrumins committed Aug 18, 2010
1 parent 41a8f79 commit afe8709
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/fixed_png_stack.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -178,16 +178,16 @@ FixedPngStack::EIO_PngEncode(eio_req *req)
FixedPngStack *png = (FixedPngStack *)enc_req->png_obj; FixedPngStack *png = (FixedPngStack *)enc_req->png_obj;


try { try {
PngEncoder p(png->data, png->width, png->height, png->buf_type); PngEncoder encoder(png->data, png->width, png->height, png->buf_type);
p.encode(); encoder.encode();
enc_req->png_len = p.get_png_len(); enc_req->png_len =encoder.get_png_len();
enc_req->png = (char *)malloc(sizeof(*enc_req->png)*enc_req->png_len); enc_req->png = (char *)malloc(sizeof(*enc_req->png)*enc_req->png_len);
if (!enc_req->png) { if (!enc_req->png) {
enc_req->error = strdup("malloc in FixedPngStack::EIO_PngEncode failed."); enc_req->error = strdup("malloc in FixedPngStack::EIO_PngEncode failed.");
return 0; return 0;
} }
else { else {
memcpy(enc_req->png, p.get_png(), enc_req->png_len); memcpy(enc_req->png,encoder.get_png(), enc_req->png_len);
} }
} }
catch (const char *err) { catch (const char *err) {
Expand Down
8 changes: 4 additions & 4 deletions src/png.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -107,16 +107,16 @@ Png::EIO_PngEncode(eio_req *req)
Png *png = (Png *)enc_req->png_obj; Png *png = (Png *)enc_req->png_obj;


try { try {
PngEncoder p((unsigned char *)png->data->data(), png->width, png->height, png->buf_type); PngEncoder encoder((unsigned char *)png->data->data(), png->width, png->height, png->buf_type);
p.encode(); encoder.encode();
enc_req->png_len = p.get_png_len(); enc_req->png_len = encoder.get_png_len();
enc_req->png = (char *)malloc(sizeof(*enc_req->png)*enc_req->png_len); enc_req->png = (char *)malloc(sizeof(*enc_req->png)*enc_req->png_len);
if (!enc_req->png) { if (!enc_req->png) {
enc_req->error = strdup("malloc in Png::EIO_PngEncode failed."); enc_req->error = strdup("malloc in Png::EIO_PngEncode failed.");
return 0; return 0;
} }
else { else {
memcpy(enc_req->png, p.get_png(), enc_req->png_len); memcpy(enc_req->png, encoder.get_png(), enc_req->png_len);
} }
} }
catch (const char *err) { catch (const char *err) {
Expand Down

0 comments on commit afe8709

Please sign in to comment.