Lines Matching refs:s2

146     move( char_type* s1, const char_type* s2, size_t n )
148 return NS_STATIC_CAST(char_type*, memmove(s1, s2, n * sizeof(char_type)));
153 copy( char_type* s1, const char_type* s2, size_t n )
155 return NS_STATIC_CAST(char_type*, memcpy(s1, s2, n * sizeof(char_type)));
160 copyASCII( char_type* s1, const char* s2, size_t n )
162 for (char_type* s = s1; n--; ++s, ++s2) {
163 NS_ASSERTION(!(*s2 & ~0x7F), "Unexpected non-ASCII character");
164 *s = *s2;
185 compare( const char_type* s1, const char_type* s2, size_t n )
188 return wmemcmp(s1, s2, n);
190 for ( ; n--; ++s1, ++s2 )
192 if ( !eq(*s1, *s2) )
193 return to_int_type(*s1) - to_int_type(*s2);
202 compareASCII( const char_type* s1, const char* s2, size_t n )
204 for ( ; n--; ++s1, ++s2 )
206 NS_ASSERTION(!(*s2 & ~0x7F), "Unexpected non-ASCII character");
207 if ( !eq_int_type(to_int_type(*s1), to_int_type(*s2)) )
208 return to_int_type(*s1) - to_int_type(*s2);
214 // this version assumes that s2 is null-terminated and s1 has length n.
215 // if s1 is shorter than s2 then we return -1; if s1 is longer than s2,
219 compareASCIINullTerminated( const char_type* s1, size_t n, const char* s2 )
221 for ( ; n--; ++s1, ++s2 )
223 if ( !*s2 )
225 NS_ASSERTION(!(*s2 & ~0x7F), "Unexpected non-ASCII character");
226 if ( !eq_int_type(to_int_type(*s1), to_int_type(*s2)) )
227 return to_int_type(*s1) - to_int_type(*s2);
230 if ( *s2 )
262 compareLowerCaseToASCII( const char_type* s1, const char* s2, size_t n )
264 for ( ; n--; ++s1, ++s2 )
266 NS_ASSERTION(!(*s2 & ~0x7F), "Unexpected non-ASCII character");
267 NS_ASSERTION(!(*s2 >= 'A' && *s2 <= 'Z'),
270 if ( lower_s1 != to_char_type(*s2) )
271 return to_int_type(lower_s1) - to_int_type(*s2);
277 // this version assumes that s2 is null-terminated and s1 has length n.
278 // if s1 is shorter than s2 then we return -1; if s1 is longer than s2,
282 compareLowerCaseToASCIINullTerminated( const char_type* s1, size_t n, const char* s2 )
284 for ( ; n--; ++s1, ++s2 )
286 if ( !*s2 )
288 NS_ASSERTION(!(*s2 & ~0x7F), "Unexpected non-ASCII character");
289 NS_ASSERTION(!(*s2 >= 'A' && *s2 <= 'Z'),
292 if ( lower_s1 != to_char_type(*s2) )
293 return to_int_type(lower_s1) - to_int_type(*s2);
296 if ( *s2 )
427 move( char_type* s1, const char_type* s2, size_t n )
429 return NS_STATIC_CAST(char_type*, memmove(s1, s2, n * sizeof(char_type)));
434 copy( char_type* s1, const char_type* s2, size_t n )
436 return NS_STATIC_CAST(char_type*, memcpy(s1, s2, n * sizeof(char_type)));
441 copyASCII( char_type* s1, const char* s2, size_t n )
443 return copy(s1, s2, n);
455 compare( const char_type* s1, const char_type* s2, size_t n )
457 return memcmp(s1, s2, n);
462 compareASCII( const char_type* s1, const char* s2, size_t n )
467 NS_ASSERTION(!(s2[i] & ~0x7F), "Unexpected non-ASCII character");
470 return compare(s1, s2, n);
473 // this version assumes that s2 is null-terminated and s1 has length n.
474 // if s1 is shorter than s2 then we return -1; if s1 is longer than s2,
478 compareASCIINullTerminated( const char_type* s1, size_t n, const char* s2 )
482 for ( ; n--; ++s1, ++s2 )
484 if ( !*s2 )
486 NS_ASSERTION(!(*s2 & ~0x7F), "Unexpected non-ASCII character");
487 if ( *s1 != *s2 )
488 return to_int_type(*s1) - to_int_type(*s2);
491 if ( *s2 )
509 compareLowerCaseToASCII( const char_type* s1, const char* s2, size_t n )
511 for ( ; n--; ++s1, ++s2 )
513 NS_ASSERTION(!(*s2 & ~0x7F), "Unexpected non-ASCII character");
514 NS_ASSERTION(!(*s2 >= 'A' && *s2 <= 'Z'),
517 if ( lower_s1 != *s2 )
518 return to_int_type(lower_s1) - to_int_type(*s2);
523 // this version assumes that s2 is null-terminated and s1 has length n.
524 // if s1 is shorter than s2 then we return -1; if s1 is longer than s2,
528 compareLowerCaseToASCIINullTerminated( const char_type* s1, size_t n, const char* s2 )
530 for ( ; n--; ++s1, ++s2 )
532 if ( !*s2 )
534 NS_ASSERTION(!(*s2 & ~0x7F), "Unexpected non-ASCII character");
535 NS_ASSERTION(!(*s2 >= 'A' && *s2 <= 'Z'),
538 if ( lower_s1 != *s2 )
539 return to_int_type(lower_s1) - to_int_type(*s2);
542 if ( *s2 )