diff options
author | Thomas White <taw@bitwiz.org.uk> | 2018-03-07 20:12:20 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2018-03-07 20:12:20 +0100 |
commit | b432a0ac4562b4ddc1a877d044fdd9490189699d (patch) | |
tree | 42c11f0ebc75104dca959f144f438c92263d17df | |
parent | f4c56706bc083f9792420fb1af2ae8cdf9651bb7 (diff) |
Remove len_bytes from add_run
-rw-r--r-- | src/frame.c | 5 | ||||
-rw-r--r-- | src/frame.h | 1 | ||||
-rw-r--r-- | src/sc_editor.c | 6 | ||||
-rw-r--r-- | src/sc_interp.c | 4 |
4 files changed, 6 insertions, 10 deletions
diff --git a/src/frame.c b/src/frame.c index ac3103a..261b172 100644 --- a/src/frame.c +++ b/src/frame.c @@ -394,8 +394,7 @@ void set_newline_at_end(Paragraph *para, SCBlock *bl) void add_run(Paragraph *para, SCBlock *scblock, SCBlock *rscblock, - size_t len_bytes, PangoFontDescription *fdesc, - double col[4]) + PangoFontDescription *fdesc, double col[4]) { struct text_run *runs_new; @@ -1615,7 +1614,7 @@ static SCBlock *split_text_paragraph(struct frame *fr, int pn, size_t pos, end = sc_block_append(end, NULL, NULL, strdup(""), NULL); pnew->n_runs = 0; - add_run(pnew, end, end, 0, fr->fontdesc, fr->col); + add_run(pnew, end, end, fr->fontdesc, fr->col); pnew->open = para->open; para->open = 0; diff --git a/src/frame.h b/src/frame.h index 7d9f741..0ccc47b 100644 --- a/src/frame.h +++ b/src/frame.h @@ -138,7 +138,6 @@ extern void check_run(struct frame *fr, int pn); extern void show_edit_pos(struct edit_pos a); extern void add_run(Paragraph *para, SCBlock *scblock, SCBlock *rscblock, - size_t len_bytes, PangoFontDescription *fdesc, double col[4]); extern Paragraph *insert_paragraph(struct frame *fr, int pos); diff --git a/src/sc_editor.c b/src/sc_editor.c index 6e03eb2..366b561 100644 --- a/src/sc_editor.c +++ b/src/sc_editor.c @@ -838,8 +838,8 @@ static void insert_text(char *t, SCEditor *e) fprintf(stderr, "Failed to insert paragraph\n"); return; } - add_run(pnew, ad, ad, strlen(t), - e->cursor_frame->fontdesc, e->cursor_frame->col); + add_run(pnew, ad, ad, e->cursor_frame->fontdesc, + e->cursor_frame->col); wrap_frame(e->cursor_frame, e->pc); @@ -1061,7 +1061,7 @@ static void check_paragraph(struct frame *fr, PangoContext *pc, } scblocks = sc_block_append(scblocks, NULL, NULL, strdup(""), NULL); - add_run(para, scblocks, scblocks, 0, fr->fontdesc, fr->col); + add_run(para, scblocks, scblocks, fr->fontdesc, fr->col); wrap_paragraph(para, pc, fr->w - fr->pad_l - fr->pad_r, 0, 0); } diff --git a/src/sc_interp.c b/src/sc_interp.c index 006046d..5c3cd8c 100644 --- a/src/sc_interp.c +++ b/src/sc_interp.c @@ -946,7 +946,6 @@ static int add_text(struct frame *fr, PangoContext *pc, SCBlock *bl, PangoLanguage *lang, int editable, SCInterpreter *scin) { const char *text = sc_block_contents(bl); - size_t len_bytes; PangoFontDescription *fontdesc; double *col; struct sc_state *st = &scin->state[scin->j]; @@ -958,7 +957,6 @@ static int add_text(struct frame *fr, PangoContext *pc, SCBlock *bl, fontdesc = sc_interp_get_fontdesc(scin); col = sc_interp_get_fgcol(scin); - len_bytes = strlen(text); Paragraph *para = last_open_para(fr); rbl = bl; @@ -966,7 +964,7 @@ static int add_text(struct frame *fr, PangoContext *pc, SCBlock *bl, bl = st->macro_real_block; } - add_run(para, bl, rbl, len_bytes, fontdesc, col); + add_run(para, bl, rbl, fontdesc, col); set_para_spacing(para, st->paraspace); return 0; |