Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor Browser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tommy Webb
Tor Browser
Commits
5bb411c8
Commit
5bb411c8
authored
12 years ago
by
Chris Peterson
Browse files
Options
Downloads
Patches
Plain Diff
Bug 796948 - Part 4: Remove unused USE_CPP_WCHAR_FUNCS and literal_string code. r=ehsan
parent
c287713a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
xpcom/string/public/nsCharTraits.h
+0
-85
0 additions, 85 deletions
xpcom/string/public/nsCharTraits.h
xpcom/string/public/nsLiteralString.h
+0
-31
0 additions, 31 deletions
xpcom/string/public/nsLiteralString.h
with
0 additions
and
116 deletions
xpcom/string/public/nsCharTraits.h
+
0
−
85
View file @
5bb411c8
...
...
@@ -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
>
...
...
This diff is collapsed.
Click to expand it.
xpcom/string/public/nsLiteralString.h
+
0
−
31
View file @
5bb411c8
...
...
@@ -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
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment