From e6f42527113a688e6d52bfc23e767beb01734fbe Mon Sep 17 00:00:00 2001
From: Andreas Mohr <and@gmx.li>
Date: Sun, 28 Feb 2016 19:54:42 +0000
Subject: [PATCH] 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>
---
src/editor/edit.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/editor/edit.c b/src/editor/edit.c
index 4b4d1db..ee9afec 100644
a
|
b
|
edit_cursor_to_eol (WEdit * edit) |
872 | 872 | static unsigned long |
873 | 873 | my_type_of (int c) |
874 | 874 | { |
875 | | int x, r = 0; |
| 875 | unsigned long x, r = 0; |
876 | 876 | const char *p, *q; |
877 | 877 | const char option_chars_move_whole_word[] = |
878 | 878 | "!=&|<>^~ !:;, !'!`!.?!\"!( !) !{ !} !Aa0 !+-*/= |<> ![ !] !\\#! "; |
… |
… |
edit_insert_column_from_file (WEdit * edit, int file, off_t * start_pos, off_t * |
1681 | 1681 | long *col1, long *col2) |
1682 | 1682 | { |
1683 | 1683 | off_t cursor; |
1684 | | int col; |
| 1684 | long col; |
1685 | 1685 | off_t blocklen = -1, width = 0; |
1686 | 1686 | unsigned char *data; |
1687 | 1687 | |
… |
… |
edit_push_undo_action (WEdit * edit, long c) |
2355 | 2355 | && spm1 != edit->undo_stack_bottom |
2356 | 2356 | && ((sp - 2) & edit->undo_stack_size_mask) != edit->undo_stack_bottom) |
2357 | 2357 | { |
2358 | | int d; |
| 2358 | long d; |
2359 | 2359 | if (edit->undo_stack[spm1] < 0) |
2360 | 2360 | { |
2361 | 2361 | d = edit->undo_stack[(sp - 2) & edit->undo_stack_size_mask]; |
… |
… |
edit_push_redo_action (WEdit * edit, long c) |
2434 | 2434 | && spm1 != edit->redo_stack_bottom |
2435 | 2435 | && ((sp - 2) & edit->redo_stack_size_mask) != edit->redo_stack_bottom) |
2436 | 2436 | { |
2437 | | int d; |
| 2437 | long d; |
2438 | 2438 | if (edit->redo_stack[spm1] < 0) |
2439 | 2439 | { |
2440 | 2440 | d = edit->redo_stack[(sp - 2) & edit->redo_stack_size_mask]; |
… |
… |
edit_move_to_prev_col (WEdit * edit, off_t p) |
2965 | 2965 | fake_half_tabs = HALF_TAB_SIZE * space_width; |
2966 | 2966 | if (fake_half_tabs != 0 && edit->curs_col % fake_half_tabs != 0) |
2967 | 2967 | { |
2968 | | int q; |
| 2968 | long q; |
2969 | 2969 | |
2970 | 2970 | q = edit->curs_col; |
2971 | 2971 | edit->curs_col -= (edit->curs_col % fake_half_tabs); |