diff --git a/src/OT/Layout/GPOS/CursivePosFormat1.hh b/src/OT/Layout/GPOS/CursivePosFormat1.hh index 7f58fac8b..ff255e090 100644 --- a/src/OT/Layout/GPOS/CursivePosFormat1.hh +++ b/src/OT/Layout/GPOS/CursivePosFormat1.hh @@ -143,7 +143,7 @@ struct CursivePosFormat1 if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "cursive attaching glyph at %d to glyph at %d", + "cursive attaching glyph at %u to glyph at %u", i, j); } @@ -241,7 +241,7 @@ struct CursivePosFormat1 if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "cursive attached glyph at %d to glyph at %d", + "cursive attached glyph at %u to glyph at %u", i, j); } diff --git a/src/OT/Layout/GPOS/MarkArray.hh b/src/OT/Layout/GPOS/MarkArray.hh index cb5e8b268..ff43ffb8c 100644 --- a/src/OT/Layout/GPOS/MarkArray.hh +++ b/src/OT/Layout/GPOS/MarkArray.hh @@ -42,7 +42,7 @@ struct MarkArray : Array16Of /* Array of MarkRecords--in Cove if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "attaching mark glyph at %d to glyph at %d", + "attaching mark glyph at %u to glyph at %u", c->buffer->idx, glyph_pos); } @@ -56,7 +56,7 @@ struct MarkArray : Array16Of /* Array of MarkRecords--in Cove if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "attached mark glyph at %d to glyph at %d", + "attached mark glyph at %u to glyph at %u", c->buffer->idx, glyph_pos); } diff --git a/src/OT/Layout/GPOS/PairPosFormat2.hh b/src/OT/Layout/GPOS/PairPosFormat2.hh index 344e54787..4a1bf1337 100644 --- a/src/OT/Layout/GPOS/PairPosFormat2.hh +++ b/src/OT/Layout/GPOS/PairPosFormat2.hh @@ -220,7 +220,7 @@ struct PairPosFormat2_4 if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "try kerning glyphs at %d,%d", + "try kerning glyphs at %u,%u", c->buffer->idx, skippy_iter.idx); } @@ -231,14 +231,14 @@ struct PairPosFormat2_4 if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "kerned glyphs at %d,%d", + "kerned glyphs at %u,%u", c->buffer->idx, skippy_iter.idx); } if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "tried kerning glyphs at %d,%d", + "tried kerning glyphs at %u,%u", c->buffer->idx, skippy_iter.idx); } diff --git a/src/OT/Layout/GPOS/PairSet.hh b/src/OT/Layout/GPOS/PairSet.hh index 0316ef13c..3befcc379 100644 --- a/src/OT/Layout/GPOS/PairSet.hh +++ b/src/OT/Layout/GPOS/PairSet.hh @@ -112,7 +112,7 @@ struct PairSet if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "try kerning glyphs at %d,%d", + "try kerning glyphs at %u,%u", c->buffer->idx, pos); } @@ -123,14 +123,14 @@ struct PairSet if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "kerned glyphs at %d,%d", + "kerned glyphs at %u,%u", c->buffer->idx, pos); } if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "tried kerning glyphs at %d,%d", + "tried kerning glyphs at %u,%u", c->buffer->idx, pos); } diff --git a/src/OT/Layout/GPOS/SinglePosFormat1.hh b/src/OT/Layout/GPOS/SinglePosFormat1.hh index 382f62999..f7a170f34 100644 --- a/src/OT/Layout/GPOS/SinglePosFormat1.hh +++ b/src/OT/Layout/GPOS/SinglePosFormat1.hh @@ -63,7 +63,7 @@ struct SinglePosFormat1 if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "positioning glyph at %d", + "positioning glyph at %u", c->buffer->idx); } @@ -72,7 +72,7 @@ struct SinglePosFormat1 if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "positioned glyph at %d", + "positioned glyph at %u", c->buffer->idx); } diff --git a/src/OT/Layout/GPOS/SinglePosFormat2.hh b/src/OT/Layout/GPOS/SinglePosFormat2.hh index 718e4da86..e8f2d7c2c 100644 --- a/src/OT/Layout/GPOS/SinglePosFormat2.hh +++ b/src/OT/Layout/GPOS/SinglePosFormat2.hh @@ -73,7 +73,7 @@ struct SinglePosFormat2 if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "positioning glyph at %d", + "positioning glyph at %u", c->buffer->idx); } @@ -84,7 +84,7 @@ struct SinglePosFormat2 if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "positioned glyph at %d", + "positioned glyph at %u", c->buffer->idx); } diff --git a/src/OT/Layout/GSUB/AlternateSet.hh b/src/OT/Layout/GSUB/AlternateSet.hh index 6c50c9717..b4466119b 100644 --- a/src/OT/Layout/GSUB/AlternateSet.hh +++ b/src/OT/Layout/GSUB/AlternateSet.hh @@ -61,7 +61,7 @@ struct AlternateSet { c->buffer->sync_so_far (); c->buffer->message (c->font, - "replacing glyph at %d (alternate substitution)", + "replacing glyph at %u (alternate substitution)", c->buffer->idx); } @@ -70,8 +70,8 @@ struct AlternateSet if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "replaced glyph at %d (alternate substitution)", - c->buffer->idx - 1); + "replaced glyph at %u (alternate substitution)", + c->buffer->idx - 1u); } return_trace (true); diff --git a/src/OT/Layout/GSUB/Ligature.hh b/src/OT/Layout/GSUB/Ligature.hh index cdb35f525..ffe39d52a 100644 --- a/src/OT/Layout/GSUB/Ligature.hh +++ b/src/OT/Layout/GSUB/Ligature.hh @@ -69,7 +69,7 @@ struct Ligature { c->buffer->sync_so_far (); c->buffer->message (c->font, - "replacing glyph at %d (ligature substitution)", + "replacing glyph at %u (ligature substitution)", c->buffer->idx); } @@ -78,8 +78,8 @@ struct Ligature if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "replaced glyph at %d (ligature substitution)", - c->buffer->idx - 1); + "replaced glyph at %u (ligature substitution)", + c->buffer->idx - 1u); } return_trace (true); @@ -138,7 +138,7 @@ struct Ligature { c->buffer->sync_so_far (); c->buffer->message (c->font, - "ligated glyph at %d", + "ligated glyph at %u", pos); } diff --git a/src/OT/Layout/GSUB/ReverseChainSingleSubstFormat1.hh b/src/OT/Layout/GSUB/ReverseChainSingleSubstFormat1.hh index a23e92028..2c2e1aa44 100644 --- a/src/OT/Layout/GSUB/ReverseChainSingleSubstFormat1.hh +++ b/src/OT/Layout/GSUB/ReverseChainSingleSubstFormat1.hh @@ -135,7 +135,7 @@ struct ReverseChainSingleSubstFormat1 if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "replacing glyph at %d (reverse chaining substitution)", + "replacing glyph at %u (reverse chaining substitution)", c->buffer->idx); } @@ -144,7 +144,7 @@ struct ReverseChainSingleSubstFormat1 if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "replaced glyph at %d (reverse chaining substitution)", + "replaced glyph at %u (reverse chaining substitution)", c->buffer->idx); } diff --git a/src/OT/Layout/GSUB/Sequence.hh b/src/OT/Layout/GSUB/Sequence.hh index e2190078b..ae3292f32 100644 --- a/src/OT/Layout/GSUB/Sequence.hh +++ b/src/OT/Layout/GSUB/Sequence.hh @@ -44,7 +44,7 @@ struct Sequence { c->buffer->sync_so_far (); c->buffer->message (c->font, - "replacing glyph at %d (multiple substitution)", + "replacing glyph at %u (multiple substitution)", c->buffer->idx); } @@ -53,8 +53,8 @@ struct Sequence if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "replaced glyph at %d (multiple subtitution)", - c->buffer->idx - 1); + "replaced glyph at %u (multiple subtitution)", + c->buffer->idx - 1u); } return_trace (true); @@ -67,7 +67,7 @@ struct Sequence { c->buffer->sync_so_far (); c->buffer->message (c->font, - "deleting glyph at %d (multiple substitution)", + "deleting glyph at %u (multiple substitution)", c->buffer->idx); } @@ -77,7 +77,7 @@ struct Sequence { c->buffer->sync_so_far (); c->buffer->message (c->font, - "deleted glyph at %d (multiple substitution)", + "deleted glyph at %u (multiple substitution)", c->buffer->idx); } @@ -88,7 +88,7 @@ struct Sequence { c->buffer->sync_so_far (); c->buffer->message (c->font, - "multiplying glyph at %d", + "multiplying glyph at %u", c->buffer->idx); } diff --git a/src/OT/Layout/GSUB/SingleSubstFormat1.hh b/src/OT/Layout/GSUB/SingleSubstFormat1.hh index 1be21b98b..78725352c 100644 --- a/src/OT/Layout/GSUB/SingleSubstFormat1.hh +++ b/src/OT/Layout/GSUB/SingleSubstFormat1.hh @@ -103,7 +103,7 @@ struct SingleSubstFormat1_3 { c->buffer->sync_so_far (); c->buffer->message (c->font, - "replacing glyph at %d (single substitution)", + "replacing glyph at %u (single substitution)", c->buffer->idx); } @@ -112,8 +112,8 @@ struct SingleSubstFormat1_3 if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "replaced glyph at %d (single substitution)", - c->buffer->idx - 1); + "replaced glyph at %u (single substitution)", + c->buffer->idx - 1u); } return_trace (true); diff --git a/src/OT/Layout/GSUB/SingleSubstFormat2.hh b/src/OT/Layout/GSUB/SingleSubstFormat2.hh index 01df71452..17aa08736 100644 --- a/src/OT/Layout/GSUB/SingleSubstFormat2.hh +++ b/src/OT/Layout/GSUB/SingleSubstFormat2.hh @@ -87,7 +87,7 @@ struct SingleSubstFormat2_4 { c->buffer->sync_so_far (); c->buffer->message (c->font, - "replacing glyph at %d (single substitution)", + "replacing glyph at %u (single substitution)", c->buffer->idx); } @@ -96,8 +96,8 @@ struct SingleSubstFormat2_4 if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) { c->buffer->message (c->font, - "replaced glyph at %d (single substitution)", - c->buffer->idx - 1); + "replaced glyph at %u (single substitution)", + c->buffer->idx - 1u); } return_trace (true); diff --git a/src/OT/glyf/SubsetGlyph.hh b/src/OT/glyf/SubsetGlyph.hh index 1a0370c75..c27504833 100644 --- a/src/OT/glyf/SubsetGlyph.hh +++ b/src/OT/glyf/SubsetGlyph.hh @@ -36,7 +36,7 @@ struct SubsetGlyph hb_bytes_t dest_glyph = dest_start.copy (c); dest_glyph = hb_bytes_t (&dest_glyph, dest_glyph.length + dest_end.copy (c).length); unsigned int pad_length = use_short_loca ? padding () : 0; - DEBUG_MSG (SUBSET, nullptr, "serialize %d byte glyph, width %d pad %d", dest_glyph.length, dest_glyph.length + pad_length, pad_length); + DEBUG_MSG (SUBSET, nullptr, "serialize %u byte glyph, width %u pad %u", dest_glyph.length, dest_glyph.length + pad_length, pad_length); HBUINT8 pad; pad = 0; diff --git a/src/OT/glyf/glyf-helpers.hh b/src/OT/glyf/glyf-helpers.hh index 181c33d06..33e4dbe46 100644 --- a/src/OT/glyf/glyf-helpers.hh +++ b/src/OT/glyf/glyf-helpers.hh @@ -25,7 +25,7 @@ _write_loca (IteratorIn&& it, bool short_offsets, IteratorOut&& dest) | hb_map ([=, &offset] (unsigned int padded_size) { offset += padded_size; - DEBUG_MSG (SUBSET, nullptr, "loca entry offset %d", offset); + DEBUG_MSG (SUBSET, nullptr, "loca entry offset %u", offset); return offset >> right_shift; }) | hb_sink (dest) @@ -61,7 +61,7 @@ _add_loca_and_head (hb_subset_plan_t * plan, Iterator padded_offsets, bool use_s if (unlikely (!loca_prime_data)) return false; - DEBUG_MSG (SUBSET, nullptr, "loca entry_size %d num_offsets %d size %d", + DEBUG_MSG (SUBSET, nullptr, "loca entry_size %u num_offsets %u size %u", entry_size, num_offsets, entry_size * num_offsets); if (use_short_loca) diff --git a/src/graph/graph.hh b/src/graph/graph.hh index dc5b6a36f..e26f7d79d 100644 --- a/src/graph/graph.hh +++ b/src/graph/graph.hh @@ -123,7 +123,7 @@ struct graph_t while (a || b) { DEBUG_MSG (SUBSET_REPACK, nullptr, - " 0x%x %s 0x%x", *a, (*a == *b) ? "==" : "!=", *b); + " 0x%x %s 0x%x", (unsigned) *a, (*a == *b) ? "==" : "!=", (unsigned) *b); a++; b++; } @@ -918,12 +918,12 @@ struct graph_t { // Can't duplicate this node, doing so would orphan the original one as all remaining links // to child are from parent. - DEBUG_MSG (SUBSET_REPACK, nullptr, " Not duplicating %d => %d", + DEBUG_MSG (SUBSET_REPACK, nullptr, " Not duplicating %u => %u", parent_idx, child_idx); return -1; } - DEBUG_MSG (SUBSET_REPACK, nullptr, " Duplicating %d => %d", + DEBUG_MSG (SUBSET_REPACK, nullptr, " Duplicating %u => %u", parent_idx, child_idx); unsigned clone_idx = duplicate (child_idx); @@ -981,7 +981,7 @@ struct graph_t */ bool raise_childrens_priority (unsigned parent_idx) { - DEBUG_MSG (SUBSET_REPACK, nullptr, " Raising priority of all children of %d", + DEBUG_MSG (SUBSET_REPACK, nullptr, " Raising priority of all children of %u", parent_idx); // This operation doesn't change ordering until a sort is run, so no need // to invalidate positions. It does not change graph structure so no need diff --git a/src/graph/serialize.hh b/src/graph/serialize.hh index d03a61bd1..040fd1de5 100644 --- a/src/graph/serialize.hh +++ b/src/graph/serialize.hh @@ -153,8 +153,8 @@ void print_overflows (graph_t& graph, const auto& child = graph.vertices_[o.child]; DEBUG_MSG (SUBSET_REPACK, nullptr, " overflow from " - "%4d (%4d in, %4d out, space %2d) => " - "%4d (%4d in, %4d out, space %2d)", + "%4u (%4u in, %4u out, space %2u) => " + "%4u (%4u in, %4u out, space %2u)", o.parent, parent.incoming_edges (), parent.obj.real_links.length + parent.obj.virtual_links.length, @@ -165,7 +165,7 @@ void print_overflows (graph_t& graph, graph.space_for (o.child)); } if (overflows.length > 10) { - DEBUG_MSG (SUBSET_REPACK, nullptr, " ... plus %d more overflows.", overflows.length - 10); + DEBUG_MSG (SUBSET_REPACK, nullptr, " ... plus %u more overflows.", overflows.length - 10); } } diff --git a/src/hb-aat-layout-kerx-table.hh b/src/hb-aat-layout-kerx-table.hh index 0ea18343d..35d7c84c2 100644 --- a/src/hb-aat-layout-kerx-table.hh +++ b/src/hb-aat-layout-kerx-table.hh @@ -891,7 +891,7 @@ struct KerxTable reverse = bool (st->u.header.coverage & st->u.header.Backwards) != HB_DIRECTION_IS_BACKWARD (c->buffer->props.direction); - if (!c->buffer->message (c->font, "start subtable %d", c->lookup_index)) + if (!c->buffer->message (c->font, "start subtable %u", c->lookup_index)) goto skip; if (!seenCrossStream && @@ -923,7 +923,7 @@ struct KerxTable if (reverse) c->buffer->reverse (); - (void) c->buffer->message (c->font, "end subtable %d", c->lookup_index); + (void) c->buffer->message (c->font, "end subtable %u", c->lookup_index); skip: st = &StructAfter (*st); diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh index d9c9b39d7..f41ecc197 100644 --- a/src/hb-aat-layout-morx-table.hh +++ b/src/hb-aat-layout-morx-table.hh @@ -525,7 +525,7 @@ struct LigatureSubtable if (unlikely (!componentData.sanitize (&c->sanitizer))) break; ligature_idx += componentData; - DEBUG_MSG (APPLY, nullptr, "Action store %u last %u", + DEBUG_MSG (APPLY, nullptr, "Action store %d last %d", bool (action & LigActionStore), bool (action & LigActionLast)); if (action & (LigActionStore | LigActionLast)) @@ -1063,7 +1063,7 @@ struct Chain bool (subtable->get_coverage () & ChainSubtable::Backwards) != HB_DIRECTION_IS_BACKWARD (c->buffer->props.direction); - if (!c->buffer->message (c->font, "start chainsubtable %d", c->lookup_index)) + if (!c->buffer->message (c->font, "start chainsubtable %u", c->lookup_index)) goto skip; if (reverse) @@ -1074,7 +1074,7 @@ struct Chain if (reverse) c->buffer->reverse (); - (void) c->buffer->message (c->font, "end chainsubtable %d", c->lookup_index); + (void) c->buffer->message (c->font, "end chainsubtable %u", c->lookup_index); if (unlikely (!c->buffer->successful)) return; diff --git a/src/hb-buffer-verify.cc b/src/hb-buffer-verify.cc index 1cd52b39b..f111b2d8d 100644 --- a/src/hb-buffer-verify.cc +++ b/src/hb-buffer-verify.cc @@ -150,7 +150,7 @@ buffer_verify_unsafe_to_break (hb_buffer_t *buffer, assert (text_start < text_end); if (0) - printf("start %d end %d text start %d end %d\n", start, end, text_start, text_end); + printf("start %u end %u text start %u end %u\n", start, end, text_start, text_end); hb_buffer_clear_contents (fragment); @@ -292,7 +292,7 @@ buffer_verify_unsafe_to_concat (hb_buffer_t *buffer, assert (text_start < text_end); if (0) - printf("start %d end %d text start %d end %d\n", start, end, text_start, text_end); + printf("start %u end %u text start %u end %u\n", start, end, text_start, text_end); #if 0 hb_buffer_flags_t flags = hb_buffer_get_flags (fragment); diff --git a/src/hb-debug.hh b/src/hb-debug.hh index cbe13e521..5fae7ec49 100644 --- a/src/hb-debug.hh +++ b/src/hb-debug.hh @@ -113,7 +113,7 @@ _hb_print_func (const char *func) const char *paren = strchr (func, '('); if (paren) func_len = paren - func; - fprintf (stderr, "%.*s", func_len, func); + fprintf (stderr, "%.*s", (int) func_len, func); } } diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index 9bcdc9c77..b2d80ab87 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -1650,7 +1650,7 @@ static inline void apply_lookup (hb_ot_apply_context_t *c, if (buffer->have_output) c->buffer->sync_so_far (); c->buffer->message (c->font, - "recursing to lookup %u at %d", + "recursing to lookup %u at %u", (unsigned) lookupRecord[i].lookupListIndex, buffer->idx); } diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index e8091ec3e..fb59b897f 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -1913,7 +1913,7 @@ inline void hb_ot_map_t::apply (const Proxy &proxy, auto &lookup = lookups[table_index][i]; unsigned int lookup_index = lookup.index; - if (!buffer->message (font, "start lookup %d feature '%c%c%c%c'", lookup_index, HB_UNTAG (lookup.feature_tag))) continue; + if (!buffer->message (font, "start lookup %u feature '%c%c%c%c'", lookup_index, HB_UNTAG (lookup.feature_tag))) continue; /* c.digest is a digest of all the current glyphs in the buffer * (plus some past glyphs). @@ -1933,9 +1933,9 @@ inline void hb_ot_map_t::apply (const Proxy &proxy, proxy.accels[lookup_index]); } else - (void) buffer->message (font, "skipped lookup %d feature '%c%c%c%c' because no glyph matches", lookup_index, HB_UNTAG (lookup.feature_tag)); + (void) buffer->message (font, "skipped lookup %u feature '%c%c%c%c' because no glyph matches", lookup_index, HB_UNTAG (lookup.feature_tag)); - (void) buffer->message (font, "end lookup %d feature '%c%c%c%c'", lookup_index, HB_UNTAG (lookup.feature_tag)); + (void) buffer->message (font, "end lookup %u feature '%c%c%c%c'", lookup_index, HB_UNTAG (lookup.feature_tag)); } if (stage->pause_func) diff --git a/src/hb-ot-shaper-arabic.cc b/src/hb-ot-shaper-arabic.cc index 2332ae369..256f8f1d1 100644 --- a/src/hb-ot-shaper-arabic.cc +++ b/src/hb-ot-shaper-arabic.cc @@ -556,9 +556,9 @@ apply_stch (const hb_ot_shape_plan_t *plan HB_UNUSED, } i++; // Don't touch i again. - DEBUG_MSG (ARABIC, nullptr, "%s stretch at (%d,%d,%d)", + DEBUG_MSG (ARABIC, nullptr, "%s stretch at (%u,%u,%u)", step == MEASURE ? "measuring" : "cutting", context, start, end); - DEBUG_MSG (ARABIC, nullptr, "rest of word: count=%d width %d", start - context, w_total); + DEBUG_MSG (ARABIC, nullptr, "rest of word: count=%u width %d", start - context, w_total); DEBUG_MSG (ARABIC, nullptr, "fixed tiles: count=%d width=%d", n_fixed, w_fixed); DEBUG_MSG (ARABIC, nullptr, "repeating tiles: count=%d width=%d", n_repeating, w_repeating); @@ -597,7 +597,7 @@ apply_stch (const hb_ot_shape_plan_t *plan HB_UNUSED, if (info[k - 1].arabic_shaping_action() == STCH_REPEATING) repeat += n_copies; - DEBUG_MSG (ARABIC, nullptr, "appending %d copies of glyph %d; j=%d", + DEBUG_MSG (ARABIC, nullptr, "appending %u copies of glyph %u; j=%u", repeat, info[k - 1].codepoint, j); for (unsigned int n = 0; n < repeat; n++) { @@ -675,15 +675,15 @@ reorder_marks_arabic (const hb_ot_shape_plan_t *plan HB_UNUSED, { hb_glyph_info_t *info = buffer->info; - DEBUG_MSG (ARABIC, buffer, "Reordering marks from %d to %d", start, end); + DEBUG_MSG (ARABIC, buffer, "Reordering marks from %u to %u", start, end); unsigned int i = start; for (unsigned int cc = 220; cc <= 230; cc += 10) { - DEBUG_MSG (ARABIC, buffer, "Looking for %d's starting at %d", cc, i); + DEBUG_MSG (ARABIC, buffer, "Looking for %u's starting at %u", cc, i); while (i < end && info_cc(info[i]) < cc) i++; - DEBUG_MSG (ARABIC, buffer, "Looking for %d's stopped at %d", cc, i); + DEBUG_MSG (ARABIC, buffer, "Looking for %u's stopped at %u", cc, i); if (i == end) break; @@ -698,10 +698,10 @@ reorder_marks_arabic (const hb_ot_shape_plan_t *plan HB_UNUSED, if (i == j) continue; - DEBUG_MSG (ARABIC, buffer, "Found %d's from %d to %d", cc, i, j); + DEBUG_MSG (ARABIC, buffer, "Found %u's from %u to %u", cc, i, j); /* Shift it! */ - DEBUG_MSG (ARABIC, buffer, "Shifting %d's: %d %d", cc, i, j); + DEBUG_MSG (ARABIC, buffer, "Shifting %u's: %u %u", cc, i, j); hb_glyph_info_t temp[HB_OT_SHAPE_MAX_COMBINING_MARKS]; assert (j - i <= ARRAY_LENGTH (temp)); buffer->merge_clusters (start, j); diff --git a/src/hb-ot-shaper-indic-machine.hh b/src/hb-ot-shaper-indic-machine.hh index d6c67b81b..7dd47755a 100644 --- a/src/hb-ot-shaper-indic-machine.hh +++ b/src/hb-ot-shaper-indic-machine.hh @@ -446,7 +446,7 @@ static const int indic_syllable_machine_en_main = 31; #define found_syllable(syllable_type) \ HB_STMT_START { \ - if (0) fprintf (stderr, "syllable %d..%d %s\n", ts, te, #syllable_type); \ + if (0) fprintf (stderr, "syllable %u..%u %s\n", ts, te, #syllable_type); \ for (unsigned int i = ts; i < te; i++) \ info[i].syllable() = (syllable_serial << 4) | syllable_type; \ syllable_serial++; \ diff --git a/src/hb-ot-shaper-indic-machine.rl b/src/hb-ot-shaper-indic-machine.rl index 46841884d..f568a8462 100644 --- a/src/hb-ot-shaper-indic-machine.rl +++ b/src/hb-ot-shaper-indic-machine.rl @@ -119,7 +119,7 @@ main := |* #define found_syllable(syllable_type) \ HB_STMT_START { \ - if (0) fprintf (stderr, "syllable %d..%d %s\n", ts, te, #syllable_type); \ + if (0) fprintf (stderr, "syllable %u..%u %s\n", ts, te, #syllable_type); \ for (unsigned int i = ts; i < te; i++) \ info[i].syllable() = (syllable_serial << 4) | syllable_type; \ syllable_serial++; \ diff --git a/src/hb-ot-shaper-khmer-machine.hh b/src/hb-ot-shaper-khmer-machine.hh index fd91ee0ca..848ed231f 100644 --- a/src/hb-ot-shaper-khmer-machine.hh +++ b/src/hb-ot-shaper-khmer-machine.hh @@ -280,7 +280,7 @@ static const int khmer_syllable_machine_en_main = 21; #define found_syllable(syllable_type) \ HB_STMT_START { \ - if (0) fprintf (stderr, "syllable %d..%d %s\n", ts, te, #syllable_type); \ + if (0) fprintf (stderr, "syllable %u..%u %s\n", ts, te, #syllable_type); \ for (unsigned int i = ts; i < te; i++) \ info[i].syllable() = (syllable_serial << 4) | syllable_type; \ syllable_serial++; \ diff --git a/src/hb-ot-shaper-khmer-machine.rl b/src/hb-ot-shaper-khmer-machine.rl index d5d429d67..c226e7797 100644 --- a/src/hb-ot-shaper-khmer-machine.rl +++ b/src/hb-ot-shaper-khmer-machine.rl @@ -103,7 +103,7 @@ main := |* #define found_syllable(syllable_type) \ HB_STMT_START { \ - if (0) fprintf (stderr, "syllable %d..%d %s\n", ts, te, #syllable_type); \ + if (0) fprintf (stderr, "syllable %u..%u %s\n", ts, te, #syllable_type); \ for (unsigned int i = ts; i < te; i++) \ info[i].syllable() = (syllable_serial << 4) | syllable_type; \ syllable_serial++; \ diff --git a/src/hb-ot-shaper-myanmar-machine.hh b/src/hb-ot-shaper-myanmar-machine.hh index 87cded4ed..809f6eefb 100644 --- a/src/hb-ot-shaper-myanmar-machine.hh +++ b/src/hb-ot-shaper-myanmar-machine.hh @@ -429,7 +429,7 @@ static const int myanmar_syllable_machine_en_main = 0; #define found_syllable(syllable_type) \ HB_STMT_START { \ - if (0) fprintf (stderr, "syllable %d..%d %s\n", ts, te, #syllable_type); \ + if (0) fprintf (stderr, "syllable %u..%u %s\n", ts, te, #syllable_type); \ for (unsigned int i = ts; i < te; i++) \ info[i].syllable() = (syllable_serial << 4) | syllable_type; \ syllable_serial++; \ diff --git a/src/hb-ot-shaper-myanmar-machine.rl b/src/hb-ot-shaper-myanmar-machine.rl index db6a44c60..e8d1e788c 100644 --- a/src/hb-ot-shaper-myanmar-machine.rl +++ b/src/hb-ot-shaper-myanmar-machine.rl @@ -118,7 +118,7 @@ main := |* #define found_syllable(syllable_type) \ HB_STMT_START { \ - if (0) fprintf (stderr, "syllable %d..%d %s\n", ts, te, #syllable_type); \ + if (0) fprintf (stderr, "syllable %u..%u %s\n", ts, te, #syllable_type); \ for (unsigned int i = ts; i < te; i++) \ info[i].syllable() = (syllable_serial << 4) | syllable_type; \ syllable_serial++; \ diff --git a/src/hb-ot-shaper-use-machine.hh b/src/hb-ot-shaper-use-machine.hh index f2fbdb725..7249c3335 100644 --- a/src/hb-ot-shaper-use-machine.hh +++ b/src/hb-ot-shaper-use-machine.hh @@ -835,7 +835,7 @@ static const int use_syllable_machine_en_main = 0; #define found_syllable(syllable_type) \ HB_STMT_START { \ - if (0) fprintf (stderr, "syllable %d..%d %s\n", (*ts).second.first, (*te).second.first, #syllable_type); \ + if (0) fprintf (stderr, "syllable %u..%u %s\n", (*ts).second.first, (*te).second.first, #syllable_type); \ for (unsigned i = (*ts).second.first; i < (*te).second.first; ++i) \ info[i].syllable() = (syllable_serial << 4) | syllable_type; \ syllable_serial++; \ diff --git a/src/hb-ot-shaper-use-machine.rl b/src/hb-ot-shaper-use-machine.rl index 8ace1f026..256e46dc5 100644 --- a/src/hb-ot-shaper-use-machine.rl +++ b/src/hb-ot-shaper-use-machine.rl @@ -183,7 +183,7 @@ main := |* #define found_syllable(syllable_type) \ HB_STMT_START { \ - if (0) fprintf (stderr, "syllable %d..%d %s\n", (*ts).second.first, (*te).second.first, #syllable_type); \ + if (0) fprintf (stderr, "syllable %u..%u %s\n", (*ts).second.first, (*te).second.first, #syllable_type); \ for (unsigned i = (*ts).second.first; i < (*te).second.first; ++i) \ info[i].syllable() = (syllable_serial << 4) | syllable_type; \ syllable_serial++; \ diff --git a/src/hb-ot-tag.cc b/src/hb-ot-tag.cc index d0123d8ea..547f9573d 100644 --- a/src/hb-ot-tag.cc +++ b/src/hb-ot-tag.cc @@ -626,7 +626,7 @@ test_langs_sorted () int c = ot_languages2[i].cmp (&ot_languages2[i - 1]); if (c > 0) { - fprintf (stderr, "ot_languages2 not sorted at index %d: %08x %d %08x\n", + fprintf (stderr, "ot_languages2 not sorted at index %u: %08x %d %08x\n", i, ot_languages2[i-1].language, c, ot_languages2[i].language); abort(); } @@ -637,7 +637,7 @@ test_langs_sorted () int c = ot_languages3[i].cmp (&ot_languages3[i - 1]); if (c > 0) { - fprintf (stderr, "ot_languages3 not sorted at index %d: %08x %d %08x\n", + fprintf (stderr, "ot_languages3 not sorted at index %u: %08x %d %08x\n", i, ot_languages3[i-1].language, c, ot_languages3[i].language); abort(); } diff --git a/src/hb-repacker.hh b/src/hb-repacker.hh index 397b3868d..cd57ade07 100644 --- a/src/hb-repacker.hh +++ b/src/hb-repacker.hh @@ -216,7 +216,7 @@ bool _try_isolating_subgraphs (const hb_vector_t& over } DEBUG_MSG (SUBSET_REPACK, nullptr, - "Overflow in space %d (%d roots). Moving %d roots to space %d.", + "Overflow in space %u (%u roots). Moving %u roots to space %u.", space, sorted_graph.num_roots_for_space (space), roots_to_isolate.get_population (), @@ -326,7 +326,7 @@ hb_resolve_graph_overflows (hb_tag_t table_tag, while (!sorted_graph.in_error () && graph::will_overflow (sorted_graph, &overflows) && round < max_rounds) { - DEBUG_MSG (SUBSET_REPACK, nullptr, "=== Overflow resolution round %d ===", round); + DEBUG_MSG (SUBSET_REPACK, nullptr, "=== Overflow resolution round %u ===", round); print_overflows (sorted_graph, overflows); hb_set_t priority_bumped_parents; diff --git a/src/hb-sanitize.hh b/src/hb-sanitize.hh index bd3250e58..eb907c6b2 100644 --- a/src/hb-sanitize.hh +++ b/src/hb-sanitize.hh @@ -240,7 +240,7 @@ struct hb_sanitize_context_t : DEBUG_MSG_LEVEL (SANITIZE, p, this->debug_depth+1, 0, "check_range [%p..%p]" - " (%d bytes) in [%p..%p] -> %s", + " (%u bytes) in [%p..%p] -> %s", p, p + len, len, this->start, this->end, ok ? "OK" : "OUT-OF-RANGE"); @@ -308,7 +308,7 @@ struct hb_sanitize_context_t : this->edit_count++; DEBUG_MSG_LEVEL (SANITIZE, p, this->debug_depth+1, 0, - "may_edit(%u) [%p..%p] (%d bytes) in [%p..%p] -> %s", + "may_edit(%u) [%p..%p] (%u bytes) in [%p..%p] -> %s", this->edit_count, p, p + len, len, this->start, this->end, @@ -353,13 +353,13 @@ struct hb_sanitize_context_t : { if (edit_count) { - DEBUG_MSG_FUNC (SANITIZE, start, "passed first round with %d edits; going for second round", edit_count); + DEBUG_MSG_FUNC (SANITIZE, start, "passed first round with %u edits; going for second round", edit_count); /* sanitize again to ensure no toe-stepping */ edit_count = 0; sane = t->sanitize (this); if (edit_count) { - DEBUG_MSG_FUNC (SANITIZE, start, "requested %d edits in second round; FAILLING", edit_count); + DEBUG_MSG_FUNC (SANITIZE, start, "requested %u edits in second round; FAILLING", edit_count); sane = false; } } diff --git a/src/hb-shape-plan.cc b/src/hb-shape-plan.cc index cabcbd4e7..312eeb653 100644 --- a/src/hb-shape-plan.cc +++ b/src/hb-shape-plan.cc @@ -227,7 +227,7 @@ hb_shape_plan_create2 (hb_face_t *face, const char * const *shaper_list) { DEBUG_MSG_FUNC (SHAPE_PLAN, nullptr, - "face=%p num_features=%d num_coords=%d shaper_list=%p", + "face=%p num_features=%u num_coords=%u shaper_list=%p", face, num_user_features, num_coords, @@ -391,7 +391,7 @@ _hb_shape_plan_execute_internal (hb_shape_plan_t *shape_plan, unsigned int num_features) { DEBUG_MSG_FUNC (SHAPE_PLAN, shape_plan, - "num_features=%d shaper_func=%p, shaper_name=%s", + "num_features=%u shaper_func=%p, shaper_name=%s", num_features, shape_plan->key.shaper_func, shape_plan->key.shaper_name); @@ -520,7 +520,7 @@ hb_shape_plan_create_cached2 (hb_face_t *face, const char * const *shaper_list) { DEBUG_MSG_FUNC (SHAPE_PLAN, nullptr, - "face=%p num_features=%d shaper_list=%p", + "face=%p num_features=%u shaper_list=%p", face, num_user_features, shaper_list); diff --git a/src/hb-subset-plan.hh b/src/hb-subset-plan.hh index 32d1041dd..d7979b8a7 100644 --- a/src/hb-subset-plan.hh +++ b/src/hb-subset-plan.hh @@ -281,7 +281,7 @@ struct hb_subset_plan_t if (HB_DEBUG_SUBSET) { hb_blob_t *source_blob = source->reference_table (tag); - DEBUG_MSG(SUBSET, nullptr, "add table %c%c%c%c, dest %d bytes, source %d bytes", + DEBUG_MSG(SUBSET, nullptr, "add table %c%c%c%c, dest %u bytes, source %u bytes", HB_UNTAG(tag), hb_blob_get_length (contents), hb_blob_get_length (source_blob)); diff --git a/src/hb.hh b/src/hb.hh index 1715bd492..d065d8532 100644 --- a/src/hb.hh +++ b/src/hb.hh @@ -103,6 +103,7 @@ #pragma GCC diagnostic warning "-Wdisabled-optimization" #pragma GCC diagnostic warning "-Wdouble-promotion" #pragma GCC diagnostic warning "-Wformat=2" +#pragma GCC diagnostic warning "-Wformat-signedness" #pragma GCC diagnostic warning "-Wignored-pragma-optimize" #pragma GCC diagnostic warning "-Wlogical-op" #pragma GCC diagnostic warning "-Wmaybe-uninitialized" @@ -114,7 +115,6 @@ /* Ignored currently, but should be fixed at some point. */ #ifndef HB_NO_PRAGMA_GCC_DIAGNOSTIC_IGNORED #pragma GCC diagnostic ignored "-Wconversion" // TODO fix -#pragma GCC diagnostic ignored "-Wformat-signedness" // TODO fix #pragma GCC diagnostic ignored "-Wshadow" // TODO fix #pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations" // TODO fix #pragma GCC diagnostic ignored "-Wunused-parameter" // TODO fix diff --git a/src/main.cc b/src/main.cc index bb18ebe38..edc9872ee 100644 --- a/src/main.cc +++ b/src/main.cc @@ -220,7 +220,7 @@ layered_glyph_dump (hb_font_t *font, hb_draw_funcs_t *funcs, unsigned face_index hb_glyph_extents_t extents = {0}; if (!hb_font_get_glyph_extents (font, gid, &extents)) { - printf ("Skip gid: %d\n", gid); + printf ("Skip gid: %u\n", gid); continue; } @@ -270,7 +270,7 @@ dump_glyphs (hb_font_t *font, hb_draw_funcs_t *funcs, unsigned face_index) hb_glyph_extents_t extents = {0}; if (!hb_font_get_glyph_extents (font, gid, &extents)) { - printf ("Skip gid: %d\n", gid); + printf ("Skip gid: %u\n", gid); continue; } @@ -393,18 +393,18 @@ print_layout_info_using_private_api (hb_blob_t *blob) } unsigned num_faces = hb_face_count (blob); - printf ("%d font(s) found in file\n", num_faces); + printf ("%u font(s) found in file\n", num_faces); for (unsigned n_font = 0; n_font < num_faces; ++n_font) { const OpenTypeFontFace &font = ot.get_face (n_font); - printf ("Font %d of %d:\n", n_font, num_faces); + printf ("Font %u of %u:\n", n_font, num_faces); unsigned num_tables = font.get_table_count (); - printf (" %d table(s) found in font\n", num_tables); + printf (" %u table(s) found in font\n", num_tables); for (unsigned n_table = 0; n_table < num_tables; ++n_table) { const OpenTypeTable &table = font.get_table (n_table); - printf (" Table %2d of %2d: %.4s (0x%08x+0x%08x)\n", n_table, num_tables, + printf (" Table %2u of %2u: %.4s (0x%08x+0x%08x)\n", n_table, num_tables, (const char *) table.tag, (unsigned) table.offset, (unsigned) table.length); @@ -419,11 +419,11 @@ print_layout_info_using_private_api (hb_blob_t *blob) const GSUBGPOS &g = *reinterpret_cast (font_data + table.offset); unsigned num_scripts = g.get_script_count (); - printf (" %d script(s) found in table\n", num_scripts); + printf (" %u script(s) found in table\n", num_scripts); for (unsigned n_script = 0; n_script < num_scripts; ++n_script) { const Script &script = g.get_script (n_script); - printf (" Script %2d of %2d: %.4s\n", n_script, num_scripts, + printf (" Script %2u of %2u: %.4s\n", n_script, num_scripts, (const char *) g.get_script_tag (n_script)); if (!script.has_default_lang_sys ()) @@ -443,41 +443,41 @@ print_layout_info_using_private_api (hb_blob_t *blob) if (!langsys.has_required_feature ()) printf (" No required feature\n"); else - printf (" Required feature index: %d\n", + printf (" Required feature index: %u\n", langsys.get_required_feature_index ()); unsigned num_features = langsys.get_feature_count (); - printf (" %d feature(s) found in language system\n", num_features); + printf (" %u feature(s) found in language system\n", num_features); for (unsigned n_feature = 0; n_feature < num_features; ++n_feature) { - printf (" Feature index %2d of %2d: %d\n", n_feature, num_features, + printf (" Feature index %2u of %2u: %u\n", n_feature, num_features, langsys.get_feature_index (n_feature)); } } } unsigned num_features = g.get_feature_count (); - printf (" %d feature(s) found in table\n", num_features); + printf (" %u feature(s) found in table\n", num_features); for (unsigned n_feature = 0; n_feature < num_features; ++n_feature) { const Feature &feature = g.get_feature (n_feature); unsigned num_lookups = feature.get_lookup_count (); - printf (" Feature %2d of %2d: %c%c%c%c\n", n_feature, num_features, + printf (" Feature %2u of %2u: %c%c%c%c\n", n_feature, num_features, HB_UNTAG (g.get_feature_tag (n_feature))); - printf (" %d lookup(s) found in feature\n", num_lookups); + printf (" %u lookup(s) found in feature\n", num_lookups); for (unsigned n_lookup = 0; n_lookup < num_lookups; ++n_lookup) { - printf (" Lookup index %2d of %2d: %d\n", n_lookup, num_lookups, + printf (" Lookup index %2u of %2u: %u\n", n_lookup, num_lookups, feature.get_lookup_index (n_lookup)); } } unsigned num_lookups = g.get_lookup_count (); - printf (" %d lookup(s) found in table\n", num_lookups); + printf (" %u lookup(s) found in table\n", num_lookups); for (unsigned n_lookup = 0; n_lookup < num_lookups; ++n_lookup) { const Lookup &lookup = g.get_lookup (n_lookup); - printf (" Lookup %2d of %2d: type %d, props 0x%04X\n", n_lookup, num_lookups, + printf (" Lookup %2u of %2u: type %u, props 0x%04X\n", n_lookup, num_lookups, lookup.get_type (), lookup.get_props ()); } @@ -519,7 +519,7 @@ main (int argc, char **argv) hb_blob_t *blob = hb_blob_create_from_file_or_fail (argv[1]); assert (blob); - printf ("Opened font file %s: %d bytes long\n", argv[1], hb_blob_get_length (blob)); + printf ("Opened font file %s: %u bytes long\n", argv[1], hb_blob_get_length (blob)); #ifndef MAIN_CC_NO_PRIVATE_API print_layout_info_using_private_api (blob); #endif diff --git a/src/test-ot-meta.cc b/src/test-ot-meta.cc index 7cf69dbcc..6daacc47d 100644 --- a/src/test-ot-meta.cc +++ b/src/test-ot-meta.cc @@ -54,9 +54,9 @@ main (int argc, char **argv) for (unsigned i = 0; i < count; ++i) { hb_blob_t *entry = hb_ot_meta_reference_entry (face, tags[i]); - printf ("%c%c%c%c, size: %d: %.*s\n", + printf ("%c%c%c%c, size: %u: %.*s\n", HB_UNTAG (tags[i]), hb_blob_get_length (entry), - hb_blob_get_length (entry), hb_blob_get_data (entry, nullptr)); + (int) hb_blob_get_length (entry), hb_blob_get_data (entry, nullptr)); hb_blob_destroy (entry); } free (tags); diff --git a/src/test-unicode-ranges.cc b/src/test-unicode-ranges.cc index 33cac6b71..27b5b9e71 100644 --- a/src/test-unicode-ranges.cc +++ b/src/test-unicode-ranges.cc @@ -32,7 +32,7 @@ test (hb_codepoint_t cp, unsigned int bit) { if (OT::_hb_ot_os2_get_unicode_range_bit (cp) != bit) { - fprintf (stderr, "got incorrect bit (%d) for cp 0x%X. Should have been %d.", + fprintf (stderr, "got incorrect bit (%u) for cp 0x%X. Should have been %u.", OT::_hb_ot_os2_get_unicode_range_bit (cp), cp, bit); diff --git a/src/test.cc b/src/test.cc index d848cf106..f7e4e7ecd 100644 --- a/src/test.cc +++ b/src/test.cc @@ -75,7 +75,7 @@ main (int argc, char **argv) hb_glyph_info_t *info = &infos[i]; hb_glyph_position_t *pos = &positions[i]; - printf ("cluster %d glyph 0x%x at (%d,%d)+(%d,%d)\n", + printf ("cluster %u glyph 0x%x at (%d,%d)+(%d,%d)\n", info->cluster, info->codepoint, pos->x_offset, diff --git a/util/font-options.hh b/util/font-options.hh index 6dd8e3b12..657e26450 100644 --- a/util/font-options.hh +++ b/util/font-options.hh @@ -273,7 +273,7 @@ font_options_t::add_options (option_parser_t *parser) font_size_text = (char *) "Font size (default: upem)"; else { - font_size_text = g_strdup_printf ("Font size (default: %d)", DEFAULT_FONT_SIZE); + font_size_text = g_strdup_printf ("Font size (default: %u)", DEFAULT_FONT_SIZE); parser->free_later (font_size_text); } diff --git a/util/shape-format.hh b/util/shape-format.hh index 18b0b96e1..128a53b55 100644 --- a/util/shape-format.hh +++ b/util/shape-format.hh @@ -124,7 +124,7 @@ shape_format_options_t::serialize_line_no (unsigned int line_no, GString *gs) { if (show_line_num) - g_string_append_printf (gs, "%d: ", line_no); + g_string_append_printf (gs, "%u: ", line_no); } inline void shape_format_options_t::serialize_buffer_of_text (hb_buffer_t *buffer,