Ticket #1977: type accuracy of WEdit members and mceditor functions.
(line_is_blank): return gboolean instead of int. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Этот коммит содержится в:
родитель
b3258da868
Коммит
dc9df84693
@ -316,7 +316,7 @@ void book_mark_dec (WEdit * edit, int line);
|
||||
void book_mark_serialize (WEdit * edit, int color);
|
||||
void book_mark_restore (WEdit * edit, int color);
|
||||
|
||||
int line_is_blank (WEdit * edit, long line);
|
||||
gboolean line_is_blank (WEdit * edit, long line);
|
||||
gboolean is_break_char (char c);
|
||||
int edit_indent_width (WEdit * edit, long p);
|
||||
void edit_insert_indent (WEdit * edit, int indent);
|
||||
|
@ -735,24 +735,31 @@ is_in_indent (WEdit * edit)
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/** check whether line in editor is blank or not
|
||||
*
|
||||
* @param edit editor object
|
||||
* @param offset position in file
|
||||
*
|
||||
* @return TRUE if line in blank, FALSE otherwise
|
||||
*/
|
||||
|
||||
static int
|
||||
static gboolean
|
||||
is_blank (WEdit * edit, long offset)
|
||||
{
|
||||
long s, f;
|
||||
int c;
|
||||
|
||||
s = edit_bol (edit, offset);
|
||||
f = edit_eol (edit, offset) - 1;
|
||||
while (s <= f)
|
||||
{
|
||||
c = edit_get_byte (edit, s++);
|
||||
if (!isspace (c))
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
return 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/** returns the offset of line i */
|
||||
|
||||
@ -3220,8 +3227,15 @@ edit_move_to_prev_col (WEdit * edit, long p)
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/** check whether line in editor is blank or not
|
||||
*
|
||||
* @param edit editor object
|
||||
* @param line number of line
|
||||
*
|
||||
* @return TRUE if line in blank, FALSE otherwise
|
||||
*/
|
||||
|
||||
int
|
||||
gboolean
|
||||
line_is_blank (WEdit * edit, long line)
|
||||
{
|
||||
return is_blank (edit, edit_find_line (edit, line));
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user