Bug 796948 - Part 4: Remove unused USE_CPP_WCHAR_FUNCS and literal_string code. r=ehsan

This commit is contained in:
Chris Peterson 2012-10-29 22:30:19 -07:00
parent acaa8ccaf5
commit 8fc00034ce
2 changed files with 0 additions and 116 deletions

View File

@ -9,18 +9,6 @@
#include <ctype.h>
// for |EOF|, |WEOF|
#define FORCED_CPP_2BYTE_WCHAR_T
// disable special optimizations for now through this hack
#if defined(HAVE_CPP_2BYTE_WCHAR_T) && !defined(FORCED_CPP_2BYTE_WCHAR_T)
#define USE_CPP_WCHAR_FUNCS
#endif
#ifdef USE_CPP_WCHAR_FUNCS
#include <wchar.h>
// for |wmemset|, et al
#endif
#include <string.h>
// for |memcpy|, et al
@ -123,12 +111,7 @@ struct nsCharTraits<PRUnichar>
// integer representation of characters:
#ifdef USE_CPP_WCHAR_FUNCS
typedef wint_t int_type;
#else
typedef int int_type;
#endif
static
char_type
@ -200,23 +183,16 @@ struct nsCharTraits<PRUnichar>
char_type*
assign( char_type* s, size_t n, char_type c )
{
#ifdef USE_CPP_WCHAR_FUNCS
return static_cast<char_type*>(wmemset(s, to_int_type(c), n));
#else
char_type* result = s;
while ( n-- )
assign(*s++, c);
return result;
#endif
}
static
int
compare( const char_type* s1, const char_type* s2, size_t n )
{
#ifdef USE_CPP_WCHAR_FUNCS
return wmemcmp(s1, s2, n);
#else
for ( ; n--; ++s1, ++s2 )
{
if ( !eq(*s1, *s2) )
@ -224,7 +200,6 @@ struct nsCharTraits<PRUnichar>
}
return 0;
#endif
}
static
@ -338,23 +313,16 @@ struct nsCharTraits<PRUnichar>
size_t
length( const char_type* s )
{
#ifdef USE_CPP_WCHAR_FUNCS
return wcslen(s);
#else
size_t result = 0;
while ( !eq(*s++, char_type(0)) )
++result;
return result;
#endif
}
static
const char_type*
find( const char_type* s, size_t n, char_type c )
{
#ifdef USE_CPP_WCHAR_FUNCS
return reinterpret_cast<const char_type*>(wmemchr(s, to_int_type(c), n));
#else
while ( n-- )
{
if ( eq(*s, c) )
@ -363,36 +331,7 @@ struct nsCharTraits<PRUnichar>
}
return 0;
#endif
}
#if 0
// I/O related:
typedef streamoff off_type;
typedef streampos pos_type;
typedef mbstate_t state_type;
static
int_type
eof()
{
#ifdef USE_CPP_WCHAR_FUNCS
return WEOF;
#else
return EOF;
#endif
}
static
int_type
not_eof( int_type c )
{
return eq_int_type(c, eof()) ? ~eof() : c;
}
// static state_type get_state( pos_type );
#endif
};
template <>
@ -596,30 +535,6 @@ struct nsCharTraits<char>
{
return reinterpret_cast<const char_type*>(memchr(s, to_int_type(c), n));
}
#if 0
// I/O related:
typedef streamoff off_type;
typedef streampos pos_type;
typedef mbstate_t state_type;
static
int_type
eof()
{
return EOF;
}
static
int_type
not_eof( int_type c )
{
return eq_int_type(c, eof()) ? ~eof() : c;
}
// static state_type get_state( pos_type );
#endif
};
template <class InputIterator>

View File

@ -14,37 +14,6 @@
#include "nsDependentString.h"
#endif
#if 0
inline
const nsDependentString
literal_string( const nsAString::char_type* aPtr )
{
return nsDependentString(aPtr);
}
inline
const nsDependentString
literal_string( const nsAString::char_type* aPtr, uint32_t aLength )
{
return nsDependentString(aPtr, aLength);
}
inline
const nsDependentCString
literal_string( const nsACString::char_type* aPtr )
{
return nsDependentCString(aPtr);
}
inline
const nsDependentCString
literal_string( const nsACString::char_type* aPtr, uint32_t aLength )
{
return nsDependentCString(aPtr, aLength);
}
#endif
namespace mozilla {
namespace internal {