Browse Source

Fix -Wcast-qual warnings for DDDPRINTs

pull/480/head
Sami Vaarala 9 years ago
parent
commit
df36995118
  1. 3
      src/duk_api_string.c
  2. 7
      src/duk_bi_json.c
  3. 3
      src/duk_hstring_misc.c
  4. 2
      src/duk_numconv.c
  5. 4
      src/duk_regexp_executor.c

3
src/duk_api_string.c

@ -298,7 +298,8 @@ DUK_EXTERNAL void duk_trim(duk_context *ctx, duk_idx_t index) {
DUK_ASSERT(q_end >= q_start);
DUK_DDD(DUK_DDDPRINT("trim: p_start=%p, p_end=%p, q_start=%p, q_end=%p",
(void *) p_start, (void *) p_end, (void *) q_start, (void *) q_end));
(const void *) p_start, (const void *) p_end,
(const void *) q_start, (const void *) q_end));
if (q_start == p_start && q_end == p_end) {
DUK_DDD(DUK_DDDPRINT("nothing was trimmed: avoid interning (hashing etc)"));

7
src/duk_bi_json.c

@ -664,8 +664,8 @@ DUK_LOCAL void duk__dec_number(duk_json_dec_ctx *js_ctx) {
x = *p;
DUK_DDD(DUK_DDDPRINT("parse_number: p_start=%p, p=%p, p_end=%p, x=%ld",
(void *) p_start, (void *) p,
(void *) js_ctx->p_end, (long) x));
(const void *) p_start, (const void *) p,
(const void *) js_ctx->p_end, (long) x));
#if defined(DUK_USE_JSON_DECNUMBER_FASTPATH)
/* This fast path is pretty marginal in practice.
@ -1164,7 +1164,8 @@ DUK_LOCAL duk_bool_t duk__enc_key_quotes_needed(duk_hstring *h_key) {
p = p_start;
DUK_DDD(DUK_DDDPRINT("duk__enc_key_quotes_needed: h_key=%!O, p_start=%p, p_end=%p, p=%p",
(duk_heaphdr *) h_key, (void *) p_start, (void *) p_end, (void *) p));
(duk_heaphdr *) h_key, (const void *) p_start,
(const void *) p_end, (const void *) p));
/* Since we only accept ASCII characters, there is no need for
* actual decoding. A non-ASCII character will be >= 0x80 which

3
src/duk_hstring_misc.c

@ -25,7 +25,8 @@ DUK_INTERNAL duk_ucodepoint_t duk_hstring_char_code_at_raw(duk_hthread *thr, duk
p_end = p_start + DUK_HSTRING_GET_BYTELEN(h);
p = p_start + boff;
DUK_DDD(DUK_DDDPRINT("p_start=%p, p_end=%p, p=%p",
(void *) p_start, (void *) p_end, (void *) p));
(const void *) p_start, (const void *) p_end,
(const void *) p));
/* This may throw an error though not for valid E5 strings. */
cp = duk_unicode_decode_xutf8_checked(thr, &p, p_start, p_end);

2
src/duk_numconv.c

@ -1938,7 +1938,7 @@ DUK_INTERNAL void duk_numconv_parse(duk_context *ctx, duk_small_int_t radix, duk
DUK_DDD(DUK_DDDPRINT("parse digits: p=%p, ch='%c' (%ld), expt=%ld, expt_adj=%ld, "
"dig_whole=%ld, dig_frac=%ld, dig_expt=%ld, dig_lzero=%ld, dig_prec=%ld",
(void *) p, (int) ((ch >= 0x20 && ch <= 0x7e) ? ch : '?'), (long) ch,
(const void *) p, (int) ((ch >= 0x20 && ch <= 0x7e) ? ch : '?'), (long) ch,
(long) expt, (long) expt_adj, (long) dig_whole, (long) dig_frac,
(long) dig_expt, (long) dig_lzero, (long) dig_prec));
DUK__BI_PRINT("f", &nc_ctx->f);

4
src/duk_regexp_executor.c

@ -812,8 +812,8 @@ DUK_LOCAL void duk__regexp_match_helper(duk_hthread *thr, duk_small_int_t force_
DUK_ASSERT(re_ctx.recursion_depth == 0);
DUK_DDD(DUK_DDDPRINT("attempt match at char offset %ld; %p [%p,%p]",
(long) char_offset, (void *) sp, (void *) re_ctx.input,
(void *) re_ctx.input_end));
(long) char_offset, (const void *) sp,
(const void *) re_ctx.input, (const void *) re_ctx.input_end));
/*
* Note:

Loading…
Cancel
Save