[circleci] Fix some of warnings from clang-everything bot (#1211)

* -Wshift-sign-overflow
* -Wmissing-prototypes
This commit is contained in:
Ebrahim Byagowi 2018-10-02 21:39:19 +03:30 committed by GitHub
parent 9f1dee32fb
commit 6353cc1f83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 30 deletions

View File

@ -89,9 +89,9 @@ jobs:
- run: echo "deb http://apt.llvm.org/cosmic/ llvm-toolchain-cosmic main" > /etc/apt/sources.list.d/llvmdev.list - run: echo "deb http://apt.llvm.org/cosmic/ llvm-toolchain-cosmic main" > /etc/apt/sources.list.d/llvmdev.list
- run: echo "deb-src http://apt.llvm.org/cosmic/ llvm-toolchain-cosmic main" > /etc/apt/sources.list.d/llvmdevsrc.list - run: echo "deb-src http://apt.llvm.org/cosmic/ llvm-toolchain-cosmic main" > /etc/apt/sources.list.d/llvmdevsrc.list
- run: apt update || true - run: apt update || true
- run: apt install -y clang lld binutils libtool autoconf automake make pkg-config gtk-doc-tools ragel libfreetype6-dev libglib2.0-dev libcairo2-dev libicu-dev libgraphite2-dev python python-pip - run: apt install -y clang lld binutils libtool autoconf automake make pkg-config gtk-doc-tools ragel libfreetype6-dev libfontconfig1-dev libglib2.0-dev libcairo2-dev libicu-dev libgraphite2-dev python python-pip
- run: pip install fonttools - run: pip install fonttools
- run: CFLAGS="-Weverything -Wno-padded -Wno-cast-qual -Wno-sign-conversion -Wno-conversion -Wno-documentation -Wno-documentation-unknown-command -Wno-reserved-id-macro" CXXFLAGS="-Weverything -Wno-undef -Wno-deprecated-declarations -Wno-weak-vtables -Wno-old-style-cast -Wno-documentation -Wno-documentation-unknown-command -Wno-conversion -Wno-sign-conversion -Wno-c++98-compat -Wno-extra-semi -Wno-c++98-compat-pedantic -Wno-padded -Wno-shift-sign-overflow -Wno-missing-field-initializers -Wno-double-promotion -Wno-reserved-id-macro -Wno-cast-qual -Wno-unused-parameter -Wno-comma -Wno-shadow -Wno-used-but-marked-unused -Wno-format-pedantic -Wno-zero-as-null-pointer-constant -Wno-disabled-macro-expansion -Wno-covered-switch-default -Wno-conditional-uninitialized -Wno-unreachable-code -Wno-unused-macros -Wno-float-equal -Wno-missing-prototypes" CC=clang CXX=clang++ ./autogen.sh --with-freetype --with-glib --with-cairo --with-icu --with-graphite2 - run: CFLAGS="-Weverything -Wno-reserved-id-macro -Wno-conversion -Wno-padded -Wno-sign-conversion -Wno-cast-qual -Wno-documentation -Wno-documentation-unknown-command" CXXFLAGS="-Weverything -Wno-old-style-cast -Wno-documentation -Wno-documentation-unknown-command -Wno-c++98-compat -Wno-cast-qual -Wno-c++98-compat-pedantic -Wno-sign-conversion -Wno-padded -Wno-shorten-64-to-32 -Wno-extra-semi -Wno-reserved-id-macro -Wno-float-conversion -Wno-format-pedantic -Wno-shadow -Wno-conversion -Wno-zero-as-null-pointer-constant -Wno-missing-field-initializers -Wno-double-promotion -Wno-used-but-marked-unused -Wno-unused-macros -Wno-comma -Wno-float-equal -Wno-disabled-macro-expansion -Wno-weak-vtables -Wno-unused-parameter -Wno-covered-switch-default -Wno-unreachable-code -Wno-deprecated-declarations" CC=clang CXX=clang++ ./autogen.sh --with-freetype --with-glib --with-cairo --with-icu --with-graphite2 --with-fontconfig
- run: make -j32 CPPFLAGS="-Werror" - run: make -j32 CPPFLAGS="-Werror"
- run: make check CPPFLAGS="-Werror" || .ci/fail.sh - run: make check CPPFLAGS="-Werror" || .ci/fail.sh

View File

@ -45,7 +45,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
void cbdt_callback (const uint8_t* data, unsigned int length, static void cbdt_callback (const uint8_t* data, unsigned int length,
unsigned int group, unsigned int gid) unsigned int group, unsigned int gid)
{ {
char output_path[255]; char output_path[255];
@ -55,7 +55,7 @@ void cbdt_callback (const uint8_t* data, unsigned int length,
fclose (f); fclose (f);
} }
void sbix_callback (const uint8_t* data, unsigned int length, static void sbix_callback (const uint8_t* data, unsigned int length,
unsigned int group, unsigned int gid) unsigned int group, unsigned int gid)
{ {
char output_path[255]; char output_path[255];
@ -65,7 +65,7 @@ void sbix_callback (const uint8_t* data, unsigned int length,
fclose (f); fclose (f);
} }
void svg_callback (const uint8_t* data, unsigned int length, static void svg_callback (const uint8_t* data, unsigned int length,
unsigned int start_glyph, unsigned int end_glyph) unsigned int start_glyph, unsigned int end_glyph)
{ {
char output_path[255]; char output_path[255];
@ -83,7 +83,7 @@ void svg_callback (const uint8_t* data, unsigned int length,
fclose (f); fclose (f);
} }
void colr_cpal_rendering (cairo_font_face_t *cairo_face, unsigned int upem, unsigned int num_glyphs, static void colr_cpal_rendering (cairo_font_face_t *cairo_face, unsigned int upem, unsigned int num_glyphs,
const OT::COLR *colr, const OT::CPAL *cpal) const OT::COLR *colr, const OT::CPAL *cpal)
{ {
for (unsigned int i = 0; i < num_glyphs; ++i) for (unsigned int i = 0; i < num_glyphs; ++i)
@ -162,7 +162,8 @@ void colr_cpal_rendering (cairo_font_face_t *cairo_face, unsigned int upem, unsi
} }
} }
void dump_glyphs (cairo_font_face_t *cairo_face, unsigned int upem, unsigned int num_glyphs) static void dump_glyphs (cairo_font_face_t *cairo_face, unsigned int upem,
unsigned int num_glyphs)
{ {
// Dump every glyph available on the font // Dump every glyph available on the font
return; // disabled for now return; // disabled for now

View File

@ -274,6 +274,9 @@ void free_static_ucdn_funcs (void)
#endif #endif
extern "C" HB_INTERNAL extern "C" HB_INTERNAL
hb_unicode_funcs_t *
hb_ucdn_get_unicode_funcs (void);
hb_unicode_funcs_t * hb_unicode_funcs_t *
hb_ucdn_get_unicode_funcs (void) hb_ucdn_get_unicode_funcs (void)
{ {

View File

@ -28,7 +28,7 @@
#include "hb-ot-os2-unicode-ranges.hh" #include "hb-ot-os2-unicode-ranges.hh"
void static void
test (hb_codepoint_t cp, unsigned int bit) test (hb_codepoint_t cp, unsigned int bit)
{ {
if (OT::hb_get_unicode_range_bit (cp) != bit) if (OT::hb_get_unicode_range_bit (cp) != bit)
@ -41,7 +41,7 @@ test (hb_codepoint_t cp, unsigned int bit)
} }
} }
void static void
test_get_unicode_range_bit (void) test_get_unicode_range_bit (void)
{ {
test (0x0000, 0); test (0x0000, 0);

View File

@ -6,7 +6,8 @@
#include "hb-subset.h" #include "hb-subset.h"
void trySubset (hb_face_t *face, static void
trySubset (hb_face_t *face,
const hb_codepoint_t text[], const hb_codepoint_t text[],
int text_length, int text_length,
bool drop_hints, bool drop_hints,
@ -28,7 +29,8 @@ void trySubset (hb_face_t *face,
hb_subset_input_destroy (input); hb_subset_input_destroy (input);
} }
void trySubset (hb_face_t *face, static void
trySubset (hb_face_t *face,
const hb_codepoint_t text[], const hb_codepoint_t text[],
int text_length) int text_length)
{ {

View File

@ -71,7 +71,7 @@ struct color_t
{ {
static color_t from_ansi (unsigned int x) static color_t from_ansi (unsigned int x)
{ {
color_t c = {(0xFF<<24) | ((0xFF*(x&1))<<16) | ((0xFF*((x >> 1)&1))<<8) | (0xFF*((x >> 2)&1))}; color_t c = {(0xFFu<<24) | ((0xFFu*(x&1))<<16) | ((0xFFu*((x >> 1)&1))<<8) | (0xFFu*((x >> 2)&1))};
return c; return c;
} }
unsigned int to_ansi (void) unsigned int to_ansi (void)
@ -223,7 +223,7 @@ struct biimage_t
uint8_t * const data; uint8_t * const data;
}; };
const char * static const char *
block_best (const biimage_t &bi, bool *inverse) block_best (const biimage_t &bi, bool *inverse)
{ {
assert (bi.width <= CELL_W); assert (bi.width <= CELL_W);