Skip to content

Commit

Permalink
silence warnings on MSVC 64-bit
Browse files Browse the repository at this point in the history
  • Loading branch information
pauloscustodio committed Nov 23, 2023
1 parent f90bf96 commit ff68861
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/utstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ UTSTRING_UNUSED static void _utstring_BuildTableR(
{
long i, j;

i = P_NeedleLen - 1;
i = (long)P_NeedleLen - 1;
j = i + 1;
P_KMP_Table[i + 1] = j;
while (i >= 0)
Expand Down Expand Up @@ -292,8 +292,8 @@ UTSTRING_UNUSED static long _utstring_findR(
long V_FindPosition = -1;

/* Search from right to left. */
j = (P_HaystackLen - 1);
i = (P_NeedleLen - 1);
j = ((long)P_HaystackLen - 1);
i = ((long)P_NeedleLen - 1);
while ( (j >= 0) && (j >= i) )
{
while ( (i < (int)P_NeedleLen) && (P_Needle[i] != P_Haystack[j]) )
Expand Down Expand Up @@ -328,13 +328,13 @@ UTSTRING_UNUSED static long utstring_find(

if (P_StartPosition < 0)
{
V_StartPosition = s->i + P_StartPosition;
V_StartPosition = (long)s->i + P_StartPosition;
}
else
{
V_StartPosition = P_StartPosition;
}
V_HaystackLen = s->i - V_StartPosition;
V_HaystackLen = (long)s->i - V_StartPosition;
if ( (V_HaystackLen >= (long) P_NeedleLen) && (P_NeedleLen > 0) )
{
V_KMP_Table = (long *)malloc(sizeof(long) * (P_NeedleLen + 1));
Expand Down Expand Up @@ -374,7 +374,7 @@ UTSTRING_UNUSED static long utstring_findR(

if (P_StartPosition < 0)
{
V_StartPosition = s->i + P_StartPosition;
V_StartPosition = (long)s->i + P_StartPosition;
}
else
{
Expand Down

0 comments on commit ff68861

Please sign in to comment.