Browse Source

Misc 'no return value' fixes for unreachable code

cyclic-jx-gh331
Sami Vaarala 9 years ago
parent
commit
6a2ebbd6ec
  1. 8
      src/duk_api_stack.c
  2. 1
      src/duk_bi_buffer.c

8
src/duk_api_stack.c

@ -106,9 +106,9 @@ DUK_LOCAL duk_int_t duk__api_coerce_d2i(duk_context *ctx, duk_idx_t index, duk_b
if (require) {
DUK_ERROR(thr, DUK_ERR_TYPE_ERROR, DUK_STR_NOT_NUMBER);
} else {
return 0;
/* not reachable */
}
return 0;
}
DUK_LOCAL duk_uint_t duk__api_coerce_d2ui(duk_context *ctx, duk_idx_t index, duk_bool_t require) {
@ -163,9 +163,9 @@ DUK_LOCAL duk_uint_t duk__api_coerce_d2ui(duk_context *ctx, duk_idx_t index, duk
if (require) {
DUK_ERROR(thr, DUK_ERR_TYPE_ERROR, DUK_STR_NOT_NUMBER);
} else {
return 0;
/* not reachable */
}
return 0;
}
/*

1
src/duk_bi_buffer.c

@ -171,6 +171,7 @@ DUK_LOCAL duk_hbufferobject *duk__require_bufobj_value(duk_context *ctx, duk_idx
}
DUK_ERROR(thr, DUK_ERR_TYPE_ERROR, DUK_STR_NOT_BUFFER);
return NULL; /* not reachable */
}
#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */

Loading…
Cancel
Save