Browse Source

Suppress "unused xxx" compilation warnings

pull/380/head
Sami Vaarala 9 years ago
parent
commit
fb6b39a4ba
  1. 2
      src/duk_api_internal.h
  2. 2
      src/duk_api_stack.c
  3. 4
      src/duk_error_misc.c
  4. 4
      src/duk_js_compiler.c

2
src/duk_api_internal.h

@ -98,7 +98,9 @@ DUK_INTERNAL_DECL void *duk_get_voidptr(duk_context *ctx, duk_idx_t index);
#endif #endif
DUK_INTERNAL_DECL duk_hstring *duk_to_hstring(duk_context *ctx, duk_idx_t index); DUK_INTERNAL_DECL duk_hstring *duk_to_hstring(duk_context *ctx, duk_idx_t index);
#if defined(DUK_USE_DEBUGGER_SUPPORT) /* only needed by debugger for now */
DUK_INTERNAL_DECL duk_hstring *duk_safe_to_hstring(duk_context *ctx, duk_idx_t index); DUK_INTERNAL_DECL duk_hstring *duk_safe_to_hstring(duk_context *ctx, duk_idx_t index);
#endif
DUK_INTERNAL_DECL duk_int_t duk_to_int_clamped_raw(duk_context *ctx, duk_idx_t index, duk_int_t minval, duk_int_t maxval, duk_bool_t *out_clamped); /* out_clamped=NULL, RangeError if outside range */ DUK_INTERNAL_DECL duk_int_t duk_to_int_clamped_raw(duk_context *ctx, duk_idx_t index, duk_int_t minval, duk_int_t maxval, duk_bool_t *out_clamped); /* out_clamped=NULL, RangeError if outside range */
DUK_INTERNAL_DECL duk_int_t duk_to_int_clamped(duk_context *ctx, duk_idx_t index, duk_int_t minval, duk_int_t maxval); DUK_INTERNAL_DECL duk_int_t duk_to_int_clamped(duk_context *ctx, duk_idx_t index, duk_int_t minval, duk_int_t maxval);

2
src/duk_api_stack.c

@ -2100,12 +2100,14 @@ DUK_EXTERNAL const char *duk_safe_to_lstring(duk_context *ctx, duk_idx_t index,
return duk_get_lstring(ctx, index, out_len); return duk_get_lstring(ctx, index, out_len);
} }
#if defined(DUK_USE_DEBUGGER_SUPPORT) /* only needed by debugger for now */
DUK_EXTERNAL duk_hstring *duk_safe_to_hstring(duk_context *ctx, duk_idx_t index) { DUK_EXTERNAL duk_hstring *duk_safe_to_hstring(duk_context *ctx, duk_idx_t index) {
(void) duk_safe_to_string(ctx, index); (void) duk_safe_to_string(ctx, index);
DUK_ASSERT(duk_is_string(ctx, index)); DUK_ASSERT(duk_is_string(ctx, index));
DUK_ASSERT(duk_get_hstring(ctx, index) != NULL); DUK_ASSERT(duk_get_hstring(ctx, index) != NULL);
return duk_get_hstring(ctx, index); return duk_get_hstring(ctx, index);
} }
#endif
/* XXX: other variants like uint, u32 etc */ /* XXX: other variants like uint, u32 etc */
DUK_INTERNAL duk_int_t duk_to_int_clamped_raw(duk_context *ctx, duk_idx_t index, duk_int_t minval, duk_int_t maxval, duk_bool_t *out_clamped) { DUK_INTERNAL duk_int_t duk_to_int_clamped_raw(duk_context *ctx, duk_idx_t index, duk_int_t minval, duk_int_t maxval, duk_bool_t *out_clamped) {

4
src/duk_error_misc.c

@ -6,9 +6,10 @@
/* /*
* Helper to walk the thread chain and see if there is an active error * Helper to walk the thread chain and see if there is an active error
* catcher. Protected calls aren't considered. * catcher. Protected calls or finally blocks aren't considered catching.
*/ */
#if defined(DUK_USE_DEBUGGER_SUPPORT)
DUK_LOCAL duk_bool_t duk__have_active_catcher(duk_hthread *thr) { DUK_LOCAL duk_bool_t duk__have_active_catcher(duk_hthread *thr) {
/* /*
* XXX: As noted above, a protected API call won't be counted as a * XXX: As noted above, a protected API call won't be counted as a
@ -32,6 +33,7 @@ DUK_LOCAL duk_bool_t duk__have_active_catcher(duk_hthread *thr) {
} }
return 0; return 0;
} }
#endif /* DUK_USE_DEBUGGER_SUPPORT */
/* /*
* Get prototype object for an integer error code. * Get prototype object for an integer error code.

4
src/duk_js_compiler.c

@ -145,7 +145,9 @@ duk_regconst_t duk__ivalue_toregconst_raw(duk_compiler_ctx *comp_ctx,
duk_reg_t forced_reg, duk_reg_t forced_reg,
duk_small_uint_t flags); duk_small_uint_t flags);
DUK_LOCAL_DECL duk_reg_t duk__ivalue_toreg(duk_compiler_ctx *comp_ctx, duk_ivalue *x); DUK_LOCAL_DECL duk_reg_t duk__ivalue_toreg(duk_compiler_ctx *comp_ctx, duk_ivalue *x);
#if 0 /* unused */
DUK_LOCAL_DECL duk_reg_t duk__ivalue_totemp(duk_compiler_ctx *comp_ctx, duk_ivalue *x); DUK_LOCAL_DECL duk_reg_t duk__ivalue_totemp(duk_compiler_ctx *comp_ctx, duk_ivalue *x);
#endif
DUK_LOCAL_DECL void duk__ivalue_toforcedreg(duk_compiler_ctx *comp_ctx, duk_ivalue *x, duk_int_t forced_reg); DUK_LOCAL_DECL void duk__ivalue_toforcedreg(duk_compiler_ctx *comp_ctx, duk_ivalue *x, duk_int_t forced_reg);
DUK_LOCAL_DECL duk_regconst_t duk__ivalue_toregconst(duk_compiler_ctx *comp_ctx, duk_ivalue *x); DUK_LOCAL_DECL duk_regconst_t duk__ivalue_toregconst(duk_compiler_ctx *comp_ctx, duk_ivalue *x);
DUK_LOCAL_DECL duk_regconst_t duk__ivalue_totempconst(duk_compiler_ctx *comp_ctx, duk_ivalue *x); DUK_LOCAL_DECL duk_regconst_t duk__ivalue_totempconst(duk_compiler_ctx *comp_ctx, duk_ivalue *x);
@ -2401,9 +2403,11 @@ DUK_LOCAL duk_reg_t duk__ivalue_toreg(duk_compiler_ctx *comp_ctx, duk_ivalue *x)
return duk__ivalue_toregconst_raw(comp_ctx, x, -1, 0 /*flags*/); return duk__ivalue_toregconst_raw(comp_ctx, x, -1, 0 /*flags*/);
} }
#if 0 /* unused */
DUK_LOCAL duk_reg_t duk__ivalue_totemp(duk_compiler_ctx *comp_ctx, duk_ivalue *x) { DUK_LOCAL duk_reg_t duk__ivalue_totemp(duk_compiler_ctx *comp_ctx, duk_ivalue *x) {
return duk__ivalue_toregconst_raw(comp_ctx, x, -1, DUK__IVAL_FLAG_REQUIRE_TEMP /*flags*/); return duk__ivalue_toregconst_raw(comp_ctx, x, -1, DUK__IVAL_FLAG_REQUIRE_TEMP /*flags*/);
} }
#endif
DUK_LOCAL void duk__ivalue_toforcedreg(duk_compiler_ctx *comp_ctx, duk_ivalue *x, duk_int_t forced_reg) { DUK_LOCAL void duk__ivalue_toforcedreg(duk_compiler_ctx *comp_ctx, duk_ivalue *x, duk_int_t forced_reg) {
DUK_ASSERT(forced_reg >= 0); DUK_ASSERT(forced_reg >= 0);

Loading…
Cancel
Save