src/editor/edit.c: Cleanup some compiler warnings

edit.c:909:12: warning: implicit conversion changes signedness: 'int' to 'unsigned long' [-Wsign-conversion]
    return r;
    ~~~~~~ ^
edit.c:1689:11: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
    col = edit_get_col (edit);
        ~ ^~~~~~~~~~~~~~~~~~~
edit.c:2361:17: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
            d = edit->undo_stack[(sp - 2) & edit->undo_stack_size_mask];
              ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
edit.c:2371:17: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
            d = edit->undo_stack[spm1];
              ~ ^~~~~~~~~~~~~~~~~~~~~~
edit.c:2440:17: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
            d = edit->redo_stack[(sp - 2) & edit->redo_stack_size_mask];
              ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
edit.c:2450:17: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
            d = edit->redo_stack[spm1];
              ~ ^~~~~~~~~~~~~~~~~~~~~~
edit.c:2970:27: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                q = edit->curs_col;
                  ~ ~~~~~~^~~~~~~~

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andreas Mohr 2016-02-28 19:54:42 +00:00 committed by Andrew Borodin
parent ae7dacb6f1
commit 561923d643
1 changed files with 5 additions and 5 deletions

View File

@ -872,7 +872,7 @@ edit_cursor_to_eol (WEdit * edit)
static unsigned long
my_type_of (int c)
{
int x, r = 0;
unsigned long x, r = 0;
const char *p, *q;
const char option_chars_move_whole_word[] =
"!=&|<>^~ !:;, !'!`!.?!\"!( !) !{ !} !Aa0 !+-*/= |<> ![ !] !\\#! ";
@ -1681,7 +1681,7 @@ edit_insert_column_from_file (WEdit * edit, int file, off_t * start_pos, off_t *
long *col1, long *col2)
{
off_t cursor;
int col;
long col;
off_t blocklen = -1, width = 0;
unsigned char *data;
@ -2355,7 +2355,7 @@ edit_push_undo_action (WEdit * edit, long c)
&& spm1 != edit->undo_stack_bottom
&& ((sp - 2) & edit->undo_stack_size_mask) != edit->undo_stack_bottom)
{
int d;
long d;
if (edit->undo_stack[spm1] < 0)
{
d = edit->undo_stack[(sp - 2) & edit->undo_stack_size_mask];
@ -2434,7 +2434,7 @@ edit_push_redo_action (WEdit * edit, long c)
&& spm1 != edit->redo_stack_bottom
&& ((sp - 2) & edit->redo_stack_size_mask) != edit->redo_stack_bottom)
{
int d;
long d;
if (edit->redo_stack[spm1] < 0)
{
d = edit->redo_stack[(sp - 2) & edit->redo_stack_size_mask];
@ -2965,7 +2965,7 @@ edit_move_to_prev_col (WEdit * edit, off_t p)
fake_half_tabs = HALF_TAB_SIZE * space_width;
if (fake_half_tabs != 0 && edit->curs_col % fake_half_tabs != 0)
{
int q;
long q;
q = edit->curs_col;
edit->curs_col -= (edit->curs_col % fake_half_tabs);