Fixed several comparison warnings

This commit is contained in:
Andrew Murray 2019-04-15 21:01:44 +10:00
parent 0e36b288dd
commit 1897897921
2 changed files with 12 additions and 13 deletions

View File

@ -345,13 +345,11 @@ static size_t
text_layout_raqm(PyObject* string, FontObject* self, const char* dir, PyObject *features, text_layout_raqm(PyObject* string, FontObject* self, const char* dir, PyObject *features,
const char* lang, GlyphInfo **glyph_info, int mask) const char* lang, GlyphInfo **glyph_info, int mask)
{ {
int i = 0; size_t i = 0, count = 0, start = 0;
raqm_t *rq; raqm_t *rq;
size_t count = 0;
raqm_glyph_t *glyphs = NULL; raqm_glyph_t *glyphs = NULL;
raqm_glyph_t_01 *glyphs_01 = NULL; raqm_glyph_t_01 *glyphs_01 = NULL;
raqm_direction_t direction; raqm_direction_t direction;
size_t start = 0;
rq = (*p_raqm.create)(); rq = (*p_raqm.create)();
if (rq == NULL) { if (rq == NULL) {
@ -423,15 +421,15 @@ text_layout_raqm(PyObject* string, FontObject* self, const char* dir, PyObject *
} }
if (features != Py_None) { if (features != Py_None) {
int len; int j, len;
PyObject *seq = PySequence_Fast(features, "expected a sequence"); PyObject *seq = PySequence_Fast(features, "expected a sequence");
if (!seq) { if (!seq) {
goto failed; goto failed;
} }
len = PySequence_Size(seq); len = PySequence_Size(seq);
for (i = 0; i < len; i++) { for (j = 0; j < len; j++) {
PyObject *item = PySequence_Fast_GET_ITEM(seq, i); PyObject *item = PySequence_Fast_GET_ITEM(seq, j);
char *feature = NULL; char *feature = NULL;
Py_ssize_t size = 0; Py_ssize_t size = 0;
PyObject *bytes; PyObject *bytes;
@ -604,12 +602,12 @@ text_layout(PyObject* string, FontObject* self, const char* dir, PyObject *featu
static PyObject* static PyObject*
font_getsize(FontObject* self, PyObject* args) font_getsize(FontObject* self, PyObject* args)
{ {
int i, x, y_max, y_min; int x, y_max, y_min;
FT_Face face; FT_Face face;
int xoffset, yoffset; int xoffset, yoffset;
const char *dir = NULL; const char *dir = NULL;
const char *lang = NULL; const char *lang = NULL;
size_t count; size_t i, count;
GlyphInfo *glyph_info = NULL; GlyphInfo *glyph_info = NULL;
PyObject *features = Py_None; PyObject *features = Py_None;
@ -702,7 +700,8 @@ font_getsize(FontObject* self, PyObject* args)
static PyObject* static PyObject*
font_render(FontObject* self, PyObject* args) font_render(FontObject* self, PyObject* args)
{ {
int i, x, y; int x;
unsigned int y;
Imaging im; Imaging im;
int index, error, ascender; int index, error, ascender;
int load_flags; int load_flags;
@ -717,7 +716,7 @@ font_render(FontObject* self, PyObject* args)
int xx, x0, x1; int xx, x0, x1;
const char *dir = NULL; const char *dir = NULL;
const char *lang = NULL; const char *lang = NULL;
size_t count; size_t i, count;
GlyphInfo *glyph_info; GlyphInfo *glyph_info;
PyObject *features = NULL; PyObject *features = NULL;

View File

@ -194,7 +194,7 @@ static void
j2k_set_cinema_params(Imaging im, int components, opj_cparameters_t *params) j2k_set_cinema_params(Imaging im, int components, opj_cparameters_t *params)
{ {
float rate; float rate;
unsigned n; int n;
/* These settings have been copied from opj_compress in the OpenJPEG /* These settings have been copied from opj_compress in the OpenJPEG
sources. */ sources. */
@ -522,7 +522,7 @@ j2k_encode_entry(Imaging im, ImagingCodecState state)
tile_ndx = 0; tile_ndx = 0;
for (y = 0; y < tiles_y; ++y) { for (y = 0; y < tiles_y; ++y) {
unsigned ty0 = params.cp_ty0 + y * tile_height; int ty0 = params.cp_ty0 + y * tile_height;
unsigned ty1 = ty0 + tile_height; unsigned ty1 = ty0 + tile_height;
unsigned pixy, pixh; unsigned pixy, pixh;
@ -535,7 +535,7 @@ j2k_encode_entry(Imaging im, ImagingCodecState state)
pixh = ty1 - ty0; pixh = ty1 - ty0;
for (x = 0; x < tiles_x; ++x) { for (x = 0; x < tiles_x; ++x) {
unsigned tx0 = params.cp_tx0 + x * tile_width; int tx0 = params.cp_tx0 + x * tile_width;
unsigned tx1 = tx0 + tile_width; unsigned tx1 = tx0 + tile_width;
unsigned pixx, pixw; unsigned pixx, pixw;
unsigned data_size; unsigned data_size;