Skip to content

Commit

Permalink
Merge pull request python-pillow#3811 from radarhere/warnings
Browse files Browse the repository at this point in the history
Fixed several warnings
  • Loading branch information
hugovk committed Jun 5, 2019
2 parents 9b4223e + d30264e commit 2f84482
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
19 changes: 9 additions & 10 deletions src/_imagingft.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,13 +345,11 @@ static size_t
text_layout_raqm(PyObject* string, FontObject* self, const char* dir, PyObject *features,
const char* lang, GlyphInfo **glyph_info, int mask)
{
int i = 0;
size_t i = 0, count = 0, start = 0;
raqm_t *rq;
size_t count = 0;
raqm_glyph_t *glyphs = NULL;
raqm_glyph_t_01 *glyphs_01 = NULL;
raqm_direction_t direction;
size_t start = 0;

rq = (*p_raqm.create)();
if (rq == NULL) {
Expand Down Expand Up @@ -423,15 +421,15 @@ text_layout_raqm(PyObject* string, FontObject* self, const char* dir, PyObject *
}

if (features != Py_None) {
int len;
int j, len;
PyObject *seq = PySequence_Fast(features, "expected a sequence");
if (!seq) {
goto failed;
}

len = PySequence_Size(seq);
for (i = 0; i < len; i++) {
PyObject *item = PySequence_Fast_GET_ITEM(seq, i);
for (j = 0; j < len; j++) {
PyObject *item = PySequence_Fast_GET_ITEM(seq, j);
char *feature = NULL;
Py_ssize_t size = 0;
PyObject *bytes;
Expand Down Expand Up @@ -604,12 +602,12 @@ text_layout(PyObject* string, FontObject* self, const char* dir, PyObject *featu
static PyObject*
font_getsize(FontObject* self, PyObject* args)
{
int i, x, y_max, y_min;
int x, y_max, y_min;
FT_Face face;
int xoffset, yoffset;
const char *dir = NULL;
const char *lang = NULL;
size_t count;
size_t i, count;
GlyphInfo *glyph_info = NULL;
PyObject *features = Py_None;

Expand Down Expand Up @@ -702,7 +700,8 @@ font_getsize(FontObject* self, PyObject* args)
static PyObject*
font_render(FontObject* self, PyObject* args)
{
int i, x, y;
int x;
unsigned int y;
Imaging im;
int index, error, ascender;
int load_flags;
Expand All @@ -717,7 +716,7 @@ font_render(FontObject* self, PyObject* args)
int xx, x0, x1;
const char *dir = NULL;
const char *lang = NULL;
size_t count;
size_t i, count;
GlyphInfo *glyph_info;
PyObject *features = NULL;

Expand Down
8 changes: 4 additions & 4 deletions src/libImaging/Draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,10 +771,10 @@ ellipse(Imaging im, int x0, int y0, int x1, int y1,
int w, h;
int x, y;
int cx, cy;
int lx, ly;
int sx, sy;
int lx_inner, ly_inner;
int sx_inner, sy_inner;
int lx = 0, ly = 0;
int sx = 0, sy = 0;
int lx_inner = 0, ly_inner = 0;
int sx_inner = 0, sy_inner = 0;
DRAW* draw;
INT32 ink;
Edge* e;
Expand Down
6 changes: 3 additions & 3 deletions src/libImaging/Jpeg2KEncode.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ static void
j2k_set_cinema_params(Imaging im, int components, opj_cparameters_t *params)
{
float rate;
unsigned n;
int n;

/* These settings have been copied from opj_compress in the OpenJPEG
sources. */
Expand Down Expand Up @@ -522,7 +522,7 @@ j2k_encode_entry(Imaging im, ImagingCodecState state)

tile_ndx = 0;
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 pixy, pixh;

Expand All @@ -535,7 +535,7 @@ j2k_encode_entry(Imaging im, ImagingCodecState state)
pixh = ty1 - ty0;

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 pixx, pixw;
unsigned data_size;
Expand Down

0 comments on commit 2f84482

Please sign in to comment.