summaryrefslogtreecommitdiff
path: root/src/string_bytes.cc
diff options
context:
space:
mode:
authorTrevor Norris <trev.norris@gmail.com>2013-06-09 14:20:01 -0700
committerTrevor Norris <trev.norris@gmail.com>2013-06-11 15:42:49 -0700
commit45a08cb2160d3b94b6fa67d253f522619946a7cf (patch)
tree785188c83fa05dd9d5b10a05f63eb57421592724 /src/string_bytes.cc
parent3b0a759b6baa03bf7d293614bf7a8ee4500794f9 (diff)
downloadandroid-node-v8-45a08cb2160d3b94b6fa67d253f522619946a7cf.tar.gz
android-node-v8-45a08cb2160d3b94b6fa67d253f522619946a7cf.tar.bz2
android-node-v8-45a08cb2160d3b94b6fa67d253f522619946a7cf.zip
lint: add mising isolates and minor style fixes
Diffstat (limited to 'src/string_bytes.cc')
-rw-r--r--src/string_bytes.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/string_bytes.cc b/src/string_bytes.cc
index 748ee56a46..eeaec4447e 100644
--- a/src/string_bytes.cc
+++ b/src/string_bytes.cc
@@ -97,9 +97,9 @@ static const int unbase64_table[] =
#define unbase64(x) unbase64_table[(uint8_t)(x)]
-static inline size_t base64_decode(char *buf,
+static inline size_t base64_decode(char* buf,
size_t len,
- const char *src,
+ const char* src,
const size_t srcLen) {
char a, b, c, d;
char* dst = buf;
@@ -148,9 +148,9 @@ static inline unsigned hex2bin(char c) {
}
-static inline size_t hex_decode(char *buf,
+static inline size_t hex_decode(char* buf,
size_t len,
- const char *src,
+ const char* src,
const size_t srcLen) {
size_t i;
for (i = 0; i < len && i * 2 + 1 < srcLen; ++i) {
@@ -170,7 +170,7 @@ size_t StringBytes::Write(char* buf,
enum encoding encoding,
int* chars_written) {
- HandleScope scope;
+ HandleScope scope(node_isolate);
size_t len = 0;
bool is_buffer = Buffer::HasInstance(val);
@@ -230,7 +230,7 @@ size_t StringBytes::Write(char* buf,
len = str->Write(twobytebuf, 0, buflen, flags);
for (size_t i = 0; i < buflen && i < len; i++) {
- unsigned char *b = reinterpret_cast<unsigned char*>(&twobytebuf[i]);
+ unsigned char* b = reinterpret_cast<unsigned char*>(&twobytebuf[i]);
buf[i] = b[0];
}
@@ -264,7 +264,7 @@ size_t StringBytes::Write(char* buf,
// Will always be at least big enough, but may have some extra
// UTF8 can be as much as 3x the size, Base64 can have 1-2 extra bytes
size_t StringBytes::StorageSize(Handle<Value> val, enum encoding encoding) {
- HandleScope scope;
+ HandleScope scope(node_isolate);
size_t data_size = 0;
bool is_buffer = Buffer::HasInstance(val);
@@ -311,7 +311,7 @@ size_t StringBytes::StorageSize(Handle<Value> val, enum encoding encoding) {
size_t StringBytes::Size(Handle<Value> val, enum encoding encoding) {
- HandleScope scope;
+ HandleScope scope(node_isolate);
size_t data_size = 0;
bool is_buffer = Buffer::HasInstance(val);
@@ -541,11 +541,11 @@ static size_t hex_encode(const char* src, size_t slen, char* dst, size_t dlen) {
Local<Value> StringBytes::Encode(const char* buf,
size_t buflen,
enum encoding encoding) {
- HandleScope scope;
+ HandleScope scope(node_isolate);
assert(buflen <= Buffer::kMaxLength);
if (!buflen && encoding != BUFFER)
- return scope.Close(String::Empty());
+ return scope.Close(String::Empty(node_isolate));
Local<String> val;
switch (encoding) {
@@ -569,8 +569,8 @@ Local<Value> StringBytes::Encode(const char* buf,
case BINARY: {
// TODO(isaacs) use ExternalTwoByteString?
- const unsigned char *cbuf = reinterpret_cast<const unsigned char*>(buf);
- uint16_t * twobytebuf = new uint16_t[buflen];
+ const unsigned char* cbuf = reinterpret_cast<const unsigned char*>(buf);
+ uint16_t* twobytebuf = new uint16_t[buflen];
for (size_t i = 0; i < buflen; i++) {
// XXX is the following line platform independent?
twobytebuf[i] = cbuf[i];