Skip to content

Commit 44cbe03

Browse files
bnoordhuisMyles Borins
authored and
Myles Borins
committed
src: fix runtime/references cpplint warnings
PR-URL: #7462 Reviewed-By: Trevor Norris <[email protected]>
1 parent f530a36 commit 44cbe03

File tree

2 files changed

+34
-33
lines changed

2 files changed

+34
-33
lines changed

src/node_contextify.cc

+7-7
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ class ContextifyScript : public BaseObject {
516516

517517
// Do the eval within this context
518518
Environment* env = Environment::GetCurrent(args);
519-
EvalMachine(env, timeout, display_errors, args, try_catch);
519+
EvalMachine(env, timeout, display_errors, args, &try_catch);
520520
}
521521

522522
// args: sandbox, [options]
@@ -563,7 +563,7 @@ class ContextifyScript : public BaseObject {
563563
timeout,
564564
display_errors,
565565
args,
566-
try_catch)) {
566+
&try_catch)) {
567567
contextify_context->CopyProperties();
568568
}
569569

@@ -683,7 +683,7 @@ class ContextifyScript : public BaseObject {
683683
const int64_t timeout,
684684
const bool display_errors,
685685
const FunctionCallbackInfo<Value>& args,
686-
TryCatch& try_catch) {
686+
TryCatch* try_catch) {
687687
if (!ContextifyScript::InstanceOf(env, args.Holder())) {
688688
env->ThrowTypeError(
689689
"Script methods can only be called on script instances.");
@@ -703,19 +703,19 @@ class ContextifyScript : public BaseObject {
703703
result = script->Run();
704704
}
705705

706-
if (try_catch.HasCaught() && try_catch.HasTerminated()) {
706+
if (try_catch->HasCaught() && try_catch->HasTerminated()) {
707707
V8::CancelTerminateExecution(env->isolate());
708708
env->ThrowError("Script execution timed out.");
709-
try_catch.ReThrow();
709+
try_catch->ReThrow();
710710
return false;
711711
}
712712

713713
if (result.IsEmpty()) {
714714
// Error occurred during execution of the script.
715715
if (display_errors) {
716-
AppendExceptionLine(env, try_catch.Exception(), try_catch.Message());
716+
AppendExceptionLine(env, try_catch->Exception(), try_catch->Message());
717717
}
718-
try_catch.ReThrow();
718+
try_catch->ReThrow();
719719
return false;
720720
}
721721

tools/icu/iculslocs.cc

+27-26
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ void usage() {
105105
PROG);
106106
}
107107

108-
#define ASSERT_SUCCESS(what) \
109-
if (U_FAILURE(status)) { \
108+
#define ASSERT_SUCCESS(status, what) \
109+
if (U_FAILURE(*status)) { \
110110
u_printf("%s:%d: %s: ERROR: %s %s\n", \
111111
__FILE__, \
112112
__LINE__, \
113113
PROG, \
114-
u_errorName(status), \
114+
u_errorName(*status), \
115115
what); \
116116
return 1; \
117117
}
@@ -177,9 +177,9 @@ int localeExists(const char* loc, UBool* exists) {
177177
}
178178
}
179179

180-
void printIndent(const LocalUFILEPointer& bf, int indent) {
180+
void printIndent(const LocalUFILEPointer* bf, int indent) {
181181
for (int i = 0; i < indent + 1; i++) {
182-
u_fprintf(bf.getAlias(), " ");
182+
u_fprintf(bf->getAlias(), " ");
183183
}
184184
}
185185

@@ -189,15 +189,15 @@ void printIndent(const LocalUFILEPointer& bf, int indent) {
189189
* @return 0 for OK, 1 for err
190190
*/
191191
int dumpAllButInstalledLocales(int lev,
192-
LocalUResourceBundlePointer& bund,
193-
LocalUFILEPointer& bf,
194-
UErrorCode& status) {
195-
ures_resetIterator(bund.getAlias());
196-
const UBool isTable = (UBool)(ures_getType(bund.getAlias()) == URES_TABLE);
192+
LocalUResourceBundlePointer* bund,
193+
LocalUFILEPointer* bf,
194+
UErrorCode* status) {
195+
ures_resetIterator(bund->getAlias());
196+
const UBool isTable = (UBool)(ures_getType(bund->getAlias()) == URES_TABLE);
197197
LocalUResourceBundlePointer t;
198-
while (U_SUCCESS(status) && ures_hasNext(bund.getAlias())) {
199-
t.adoptInstead(ures_getNextResource(bund.getAlias(), t.orphan(), &status));
200-
ASSERT_SUCCESS("while processing table");
198+
while (U_SUCCESS(*status) && ures_hasNext(bund->getAlias())) {
199+
t.adoptInstead(ures_getNextResource(bund->getAlias(), t.orphan(), status));
200+
ASSERT_SUCCESS(status, "while processing table");
201201
const char* key = ures_getKey(t.getAlias());
202202
if (VERBOSE > 1) {
203203
u_printf("dump@%d: got key %s\n", lev, key);
@@ -208,22 +208,22 @@ int dumpAllButInstalledLocales(int lev,
208208
}
209209
} else {
210210
printIndent(bf, lev);
211-
u_fprintf(bf.getAlias(), "%s", key);
211+
u_fprintf(bf->getAlias(), "%s", key);
212212
switch (ures_getType(t.getAlias())) {
213213
case URES_STRING: {
214214
int32_t len = 0;
215-
const UChar* s = ures_getString(t.getAlias(), &len, &status);
216-
ASSERT_SUCCESS("getting string");
217-
u_fprintf(bf.getAlias(), ":string {\"");
218-
u_file_write(s, len, bf.getAlias());
219-
u_fprintf(bf.getAlias(), "\"}");
215+
const UChar* s = ures_getString(t.getAlias(), &len, status);
216+
ASSERT_SUCCESS(status, "getting string");
217+
u_fprintf(bf->getAlias(), ":string {\"");
218+
u_file_write(s, len, bf->getAlias());
219+
u_fprintf(bf->getAlias(), "\"}");
220220
} break;
221221
default: {
222222
u_printf("ERROR: unhandled type in dumpAllButInstalledLocales().\n");
223223
return 1;
224224
} break;
225225
}
226-
u_fprintf(bf.getAlias(), "\n");
226+
u_fprintf(bf->getAlias(), "\n");
227227
}
228228
}
229229
return 0;
@@ -250,18 +250,18 @@ int list(const char* toBundle) {
250250

251251
// first, calculate the bundle name.
252252
calculatePackageName(&status);
253-
ASSERT_SUCCESS("calculating package name");
253+
ASSERT_SUCCESS(&status, "calculating package name");
254254

255255
if (VERBOSE) {
256256
u_printf("\"locale\": %s\n", locale);
257257
}
258258

259259
LocalUResourceBundlePointer bund(
260260
ures_openDirect(packageName.data(), locale, &status));
261-
ASSERT_SUCCESS("while opening the bundle");
261+
ASSERT_SUCCESS(&status, "while opening the bundle");
262262
LocalUResourceBundlePointer installedLocales(
263263
ures_getByKey(bund.getAlias(), INSTALLEDLOCALES, NULL, &status));
264-
ASSERT_SUCCESS("while fetching installed locales");
264+
ASSERT_SUCCESS(&status, "while fetching installed locales");
265265

266266
int32_t count = ures_getSize(installedLocales.getAlias());
267267
if (VERBOSE) {
@@ -280,11 +280,12 @@ int list(const char* toBundle) {
280280
"%s:table(nofallback) {\n"
281281
" // First, everything besides InstalledLocales:\n",
282282
locale);
283-
if (dumpAllButInstalledLocales(0, bund, bf, status)) {
283+
if (dumpAllButInstalledLocales(0, &bund, &bf, &status)) {
284284
u_printf("Error dumping prolog for %s\n", toBundle);
285285
return 1;
286286
}
287-
ASSERT_SUCCESS("while writing prolog"); // in case an error was missed
287+
// in case an error was missed
288+
ASSERT_SUCCESS(&status, "while writing prolog");
288289

289290
u_fprintf(bf.getAlias(),
290291
" %s:table { // %d locales in input %s.res\n",
@@ -300,7 +301,7 @@ int list(const char* toBundle) {
300301
for (int32_t i = 0; i < count; i++) {
301302
subkey.adoptInstead(ures_getByIndex(
302303
installedLocales.getAlias(), i, subkey.orphan(), &status));
303-
ASSERT_SUCCESS("while fetching an installed locale's name");
304+
ASSERT_SUCCESS(&status, "while fetching an installed locale's name");
304305

305306
const char* key = ures_getKey(subkey.getAlias());
306307
if (VERBOSE > 1) {

0 commit comments

Comments
 (0)