Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions IFUnicodeURL/IDNSDK/nameprep.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ static const int SCount = 11172; /* LCount * NCount */
static void insert( DWORD * target, size_t * length, size_t offset, DWORD ch )
{
int i;
if (offset < 0 || offset > *length) {return;}
if (offset > *length) {return;}

for (i=(*length); i>offset; i--) {target[i] = target[i-1];}
for (i=(int)(*length); i>offset; i--) {target[i] = target[i-1];}

target[offset] = ch;

Expand Down Expand Up @@ -160,11 +160,11 @@ static int composeHangul( DWORD dwLastCh, DWORD ch, DWORD * pdwOut )

/* 1. check to see if two current characters are L and V */

LIndex = dwLastCh - LBase;
LIndex = (int)(dwLastCh - LBase);

if ( 0 <= LIndex && LIndex < LCount )
{
int VIndex = ch - VBase;
int VIndex = (int)(ch - VBase);
if ( 0 <= VIndex && VIndex < VCount )
{

Expand All @@ -177,11 +177,11 @@ static int composeHangul( DWORD dwLastCh, DWORD ch, DWORD * pdwOut )

/* 2. check to see if two current characters are LV and T */

SIndex = dwLastCh - SBase;
SIndex = (int)(dwLastCh - SBase);

if ( 0 <= SIndex && SIndex < SCount && (SIndex % TCount) == 0 )
{
int TIndex = ch - TBase;
int TIndex = (int)(ch - TBase);
if (0 <= TIndex && TIndex <= TCount)
{

Expand Down Expand Up @@ -212,7 +212,7 @@ static int composeHangul( DWORD dwLastCh, DWORD ch, DWORD * pdwOut )

static int decomposeHangul( DWORD ch, DWORD * pdwOut )
{
int SIndex = ch - SBase;
int SIndex = (int)(ch - SBase);
int L;
int V;
int T;
Expand Down Expand Up @@ -345,15 +345,15 @@ static int doKCDecompose( const DWORD * input, int input_size,
{
ch = buf[j];

cClass = lookup_canonical(ch);
cClass = (int)lookup_canonical(ch);

cursor = output_offset;

if (cClass != 0)
{
for (; cursor > 0; --cursor)
{
nCanonicalItem = lookup_canonical(output[cursor-1]);
nCanonicalItem = (int)lookup_canonical(output[cursor-1]);
if (nCanonicalItem <= cClass) {break;}
}
}
Expand All @@ -363,7 +363,7 @@ static int doKCDecompose( const DWORD * input, int input_size,

if (output_offset > *output_size) {return XCODE_NAMEPREP_BUFFER_OVERFLOW_ERROR;}

*output_size = output_offset;
*output_size = (int)output_offset;

return XCODE_SUCCESS;
}
Expand Down Expand Up @@ -392,7 +392,7 @@ static int doKCCompose( DWORD * output, int * output_size )

startCh = output[0];

lastClass = lookup_canonical(startCh);
lastClass = (int)lookup_canonical(startCh);

if ( lastClass != 0 )
{
Expand All @@ -408,7 +408,7 @@ static int doKCCompose( DWORD * output, int * output_size )

DWORD ch = output[decompPos];

chClass = lookup_canonical(ch);
chClass = (int)lookup_canonical(ch);

nComposeResult = composeHangul( startCh, ch, &nComposeItem );

Expand All @@ -426,7 +426,7 @@ static int doKCCompose( DWORD * output, int * output_size )
composite = 0xffff; /* 65535 */
} else
{
composite = nComposeItem;
composite = (int)nComposeItem;
}

if (composite != 0xffff && (lastClass < chClass || lastClass == 0))
Expand Down
4 changes: 2 additions & 2 deletions IFUnicodeURL/IDNSDK/puny.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ int punycode_encode( unsigned int input_length,
++delta, ++n;
}

*output_length = out;
*output_length = (int)out;
return XCODE_SUCCESS;
}

Expand Down Expand Up @@ -270,7 +270,7 @@ int punycode_decode( unsigned int input_length,
output[i++] = n;
}

*output_length = out;
*output_length = (int)out;
return XCODE_SUCCESS;
}

Expand Down
2 changes: 1 addition & 1 deletion IFUnicodeURL/IDNSDK/toxxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ int Xcode_ToASCII( const UTF16CHAR * puzInputString,
en = 0;
for ( i = 0; i < iOutputSize; i++ )
{
if ( *(dwzOutputString+i) < 0 || *(dwzOutputString+i) > 0x7F )
if ( *(dwzOutputString+i) > 0x7F )
{
int res;
/* 5. Verify that the sequence does NOT begin with the ACE prefix. */
Expand Down
6 changes: 3 additions & 3 deletions IFUnicodeURL/IDNSDK/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ absence of 0..2C, 2E..2F, 3A..40, 5B..60, and 7B..7F.

int is_ldh_character32(const DWORD c)
{
if ( ( c >= 0x0000 && c <= 0x002C ) ||
if ( c <= 0x002C ||
( c == 0x002E || c == 0x002F ) ||
( c >= 0x003A && c <= 0x0040 ) ||
( c >= 0x005B && c <= 0x0060 ) ||
Expand Down Expand Up @@ -479,7 +479,7 @@ UCHAR8 * pszResult, int * piResultLength )

if (high) {return XCODE_UTIL_LONELY_HIGH_SURROGATE;}

*piResultLength = output_offset;
*piResultLength = (int)output_offset;

return XCODE_SUCCESS;
}
Expand Down Expand Up @@ -604,7 +604,7 @@ int * piResultLength )
return XCODE_UTIL_INVALID_8BIT_INPUT;
}

*piResultLength = output_offset;
*piResultLength = (int)output_offset;

return XCODE_SUCCESS;
}
Expand Down
2 changes: 1 addition & 1 deletion IFUnicodeURL/NSURL+IFUnicodeURL.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ - (NSArray *)IFUnicodeURL_splitBeforeCharactersInSet:(NSCharacterSet *)chars
static NSString *ConvertUnicodeDomainString(NSString *hostname, BOOL toAscii)
{
const UTF16CHAR *inputString = (const UTF16CHAR *)[hostname cStringUsingEncoding:NSUTF16StringEncoding];
int inputLength = [hostname lengthOfBytesUsingEncoding:NSUTF16StringEncoding] / sizeof(UTF16CHAR);
int inputLength = (int)([hostname lengthOfBytesUsingEncoding:NSUTF16StringEncoding] / sizeof(UTF16CHAR));

if (toAscii) {
int outputLength = MAX_DOMAIN_SIZE_8;
Expand Down