mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 22:44:49 +00:00
ICU-21664 Fix set but unused warning in locid.cpp
This commit is contained in:
parent
4c35e59bdc
commit
1d560c37e5
1 changed files with 2 additions and 22 deletions
|
@ -297,13 +297,12 @@ Locale::Locale( const char * newLanguage,
|
|||
else
|
||||
{
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
int32_t size = 0;
|
||||
int32_t lsize = 0;
|
||||
int32_t csize = 0;
|
||||
int32_t vsize = 0;
|
||||
int32_t ksize = 0;
|
||||
|
||||
// Calculate the size of the resulting string.
|
||||
// Check the sizes of the input strings.
|
||||
|
||||
// Language
|
||||
if ( newLanguage != NULL )
|
||||
|
@ -313,7 +312,6 @@ Locale::Locale( const char * newLanguage,
|
|||
setToBogus();
|
||||
return;
|
||||
}
|
||||
size = lsize;
|
||||
}
|
||||
|
||||
CharString togo(newLanguage, lsize, status); // start with newLanguage
|
||||
|
@ -326,7 +324,6 @@ Locale::Locale( const char * newLanguage,
|
|||
setToBogus();
|
||||
return;
|
||||
}
|
||||
size += csize;
|
||||
}
|
||||
|
||||
// _Variant
|
||||
|
@ -350,21 +347,6 @@ Locale::Locale( const char * newLanguage,
|
|||
}
|
||||
}
|
||||
|
||||
if( vsize > 0 )
|
||||
{
|
||||
size += vsize;
|
||||
}
|
||||
|
||||
// Separator rules:
|
||||
if ( vsize > 0 )
|
||||
{
|
||||
size += 2; // at least: __v
|
||||
}
|
||||
else if ( csize > 0 )
|
||||
{
|
||||
size += 1; // at least: _v
|
||||
}
|
||||
|
||||
if ( newKeywords != NULL)
|
||||
{
|
||||
ksize = (int32_t)uprv_strlen(newKeywords);
|
||||
|
@ -372,11 +354,9 @@ Locale::Locale( const char * newLanguage,
|
|||
setToBogus();
|
||||
return;
|
||||
}
|
||||
size += ksize + 1;
|
||||
}
|
||||
|
||||
// NOW we have the full locale string..
|
||||
// Now, copy it back.
|
||||
// We've checked the input sizes, now build up the full locale string..
|
||||
|
||||
// newLanguage is already copied
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue