Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make long->int conversions explicit in par.

  • Loading branch information...
commit 56a5779a87319991f0facfbf50ed296f8c14c764 1 parent 629c8d5
Antonio Salazar Cardozo Shadowfiend authored
Showing with 9 additions and 9 deletions.
  1. +1 −1  par/charset.c
  2. +6 −6 par/par.c
  3. +2 −2 par/reformat.c
2  par/charset.c
View
@@ -80,7 +80,7 @@ static int hexdigtoint(wchar_t c)
if (!c) return -1;
p = wcschr(hexdigits, c);
if (!p) return -1;
- n = p - hexdigits;
+ n = (int)(p - hexdigits);
if (n >= 16) n -= 6;
return n;
12 par/par.c
View
@@ -154,7 +154,7 @@ static int digtoint(char c)
if (!c) return -1;
p = strchr(digits,c);
- return p ? p - digits : -1;
+ return p ? (int)(p - digits) : -1;
/* We can't simply return c - '0' because this is ANSI C code, */
/* so it has to work for any character set, not just ones which */
@@ -362,7 +362,7 @@ static wchar_t **readlines(
}
}
else {
- vlnlen = p - ln;
+ vlnlen = (int)(p - ln);
vln = malloc((vlnlen + 1) * sizeof (wchar_t));
if (!vln) {
wcscpy(errmsg,outofmem);
@@ -510,7 +510,7 @@ static void compresuflen(
else
break;
}
- *ppre = end - start;
+ *ppre = (int)(end - start);
knownstart = *lines + *ppre;
for (end = knownstart; *end; ++end);
@@ -537,7 +537,7 @@ static void compresuflen(
}
else
while (end - start >= 2 && *start == L' ' && start[1] == L' ') ++start;
- *psuf = end - start;
+ *psuf = (int)(end - start);
}
@@ -676,7 +676,7 @@ static void setaffixes(
int numin, pre, suf;
const wchar_t *p;
- numin = endline - inlines;
+ numin = (int)(endline - inlines);
if ((*pprefix < 0 || *psuffix < 0) && numin > hang + 1)
compresuflen(inlines + hang, endline, bodychars, body, 0, 0, &pre, &suf);
@@ -685,7 +685,7 @@ static void setaffixes(
if (numin == 1 && quote)
while (*p && csmember (*p, quotechars))
++p;
- *pafp = p - *inlines;
+ *pafp = (int)(p - *inlines);
*pfs = props->s;
if (*pprefix < 0)
4 par/reformat.c
View
@@ -333,7 +333,7 @@ wchar_t **reformat(
dummy.next = dummy.prev = NULL;
dummy.flags = 0;
head = tail = &dummy;
- numin = endline - inlines;
+ numin = (int)(endline - inlines);
if (numin <= 0) {
swprintf(errmsg,errmsg_size,impossibility,4);
goto rfcleanup;
@@ -383,7 +383,7 @@ wchar_t **reformat(
w1->prev = tail;
tail = tail->next = w1;
w1->chrs = p1;
- w1->length = p2 - p1;
+ w1->length = (int)(p2 - p1);
w1->width = getWidth(p1, p2);
w1->flags = 0;
p1 = p2;
Please sign in to comment.
Something went wrong with that request. Please try again.