OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple Inc. All rights reserved. |
3 * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). | 3 * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "wtf/text/ASCIIFastPath.h" | 30 #include "wtf/text/ASCIIFastPath.h" |
31 | 31 |
32 namespace WTF { | 32 namespace WTF { |
33 | 33 |
34 template<size_t size> struct UCharByteFiller; | 34 template<size_t size> struct UCharByteFiller; |
35 template<> struct UCharByteFiller<4> { | 35 template<> struct UCharByteFiller<4> { |
36 static void copy(LChar* destination, const uint8_t* source) | 36 static void copy(LChar* destination, const uint8_t* source) |
37 { | 37 { |
38 memcpy(destination, source, 4); | 38 memcpy(destination, source, 4); |
39 } | 39 } |
40 | 40 |
41 static void copy(UChar* destination, const uint8_t* source) | 41 static void copy(UChar* destination, const uint8_t* source) |
42 { | 42 { |
43 destination[0] = source[0]; | 43 destination[0] = source[0]; |
44 destination[1] = source[1]; | 44 destination[1] = source[1]; |
45 destination[2] = source[2]; | 45 destination[2] = source[2]; |
46 destination[3] = source[3]; | 46 destination[3] = source[3]; |
47 } | 47 } |
48 }; | 48 }; |
49 template<> struct UCharByteFiller<8> { | 49 template<> struct UCharByteFiller<8> { |
50 static void copy(LChar* destination, const uint8_t* source) | 50 static void copy(LChar* destination, const uint8_t* source) |
(...skipping 20 matching lines...) Expand all Loading... |
71 } | 71 } |
72 | 72 |
73 inline void copyASCIIMachineWord(UChar* destination, const uint8_t* source) | 73 inline void copyASCIIMachineWord(UChar* destination, const uint8_t* source) |
74 { | 74 { |
75 UCharByteFiller<sizeof(WTF::MachineWord)>::copy(destination, source); | 75 UCharByteFiller<sizeof(WTF::MachineWord)>::copy(destination, source); |
76 } | 76 } |
77 | 77 |
78 } // namespace WTF | 78 } // namespace WTF |
79 | 79 |
80 #endif // TextCodecASCIIFastPath_h | 80 #endif // TextCodecASCIIFastPath_h |
OLD | NEW |