History

Make narrowing conversions

Thus making clang happy, and leaving the possibility of checking things at run-tmie via extended STTI macro in the future.

malc committed 6 years ago

Commit ab6725c1 parent ed40d8a1 file · +7 −5Browse files

Unified · Split

link.c+7−5
@@ -93,6 +93,8 @@ extern char **environ; · 92 unmodified lines
9393 #define ML(d) extern value ml_##d; value ml_##d
9494 #define ML0(d) extern void ml_##d; void ml_##d
9595
96+#define STTI(st) ((unsigned int) st)
97+
9698 struct slice {
9799 int h;
98100 int texindex;
@@ -1993,8 +1995,8 @@ static void ensureslinks (struct page *page) · 1894 unmodified lines
19931995 }
19941996
19951997 static void highlightslinks (struct page *page, int xoff, int yoff,
1996− int noff, const char *targ, mlsize_t tlen,
1997− const char *chars, mlsize_t clen, int hfsize)
1998+ int noff, const char *targ, unsigned int tlen,
1999+ const char *chars, unsigned int clen, int hfsize)
19982000 {
19992001 char buf[40];
20002002 struct slink *slink;
@@ -2241,8 +2243,8 @@ ML (postprocess (value ptr_v, value hlinks_v, · 240 unmodified lines
22412243 ensureannots (page);
22422244 if (hlmask & 1) highlightlinks (page, xoff, yoff);
22432245 if (hlmask & 2) {
2244− highlightslinks (page, xoff, yoff, noff, targ, tlen,
2245− chars, clen, hfsize);
2246+ highlightslinks (page, xoff, yoff, noff, targ, STTI (tlen),
2247+ chars, STTI (clen), hfsize);
22462248 noff = page->slinkcount;
22472249 }
22482250 if (page->tgen == state.gen) {
@@ -2570,7 +2572,7 @@ ML (getlinkn (value ptr_v, value c_v, value n_v)) · 321 unmodified lines
25702572
25712573 ret_v = Val_int (-1);
25722574 for (int i = 0; i < page->slinkcount; ++i) {
2573− fmt_linkn (buf, c, clen, i);
2575+ fmt_linkn (buf, c, STTI (clen), i);
25742576 if (!strncmp (buf, n, clen)) {
25752577 ret_v = Val_int (i);
25762578 break;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t