diff options
author | Thanos Doukoudakis <thanos.doukoudakis@isode.com> | 2017-10-16 11:53:42 (GMT) |
---|---|---|
committer | Kevin Smith <kevin.smith@isode.com> | 2017-10-19 09:22:57 (GMT) |
commit | eb07238e9c1a09a640dae06e8a433d7dba77f490 (patch) | |
tree | 51b618bbdf933bcca2b8deb915e131c48d80d5f7 /3rdParty/Breakpad/src/common/string_conversion.cc | |
parent | 80ef26c165a08d5251d7ee56e0bd07b86fc82f55 (diff) | |
download | swift-eb07238e9c1a09a640dae06e8a433d7dba77f490.zip swift-eb07238e9c1a09a640dae06e8a433d7dba77f490.tar.bz2 |
Upgrade Breakpad to latest
This commit will upgrade breakpad to version 1.0.86
(I9957f27cd134f862b9831e4b1d90f8a014eb37b6) from
https://chromium.googlesource.com/breakpad/breakpad
Added a script(BreakpadSwiftCleanup.sh) that remove files from Breakpad's
repository that are not used by Swift.
This commit also re-applies the changes that were introduced in commit
7f0fe603be200c09c74cf9cc295a972f3c3dbdfd, that change the minidump
filename format to include version and date
Test-Information:
https://travis-ci.org/google/breakpad/builds/283789304
https://ci.appveyor.com/project/vapier/breakpad/build/job/1bu73ysmcfpwg9e4
Tested by adding some code that forces a crash to the client on Windows 10
with VS2015. Verified the name and contents of the generated crash dump.
Change-Id: Ied9e74088e43137845edc09d070c2c27494aeade
Diffstat (limited to '3rdParty/Breakpad/src/common/string_conversion.cc')
-rw-r--r-- | 3rdParty/Breakpad/src/common/string_conversion.cc | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/3rdParty/Breakpad/src/common/string_conversion.cc b/3rdParty/Breakpad/src/common/string_conversion.cc index 27fb8cd..040d3e8 100644 --- a/3rdParty/Breakpad/src/common/string_conversion.cc +++ b/3rdParty/Breakpad/src/common/string_conversion.cc @@ -30,23 +30,23 @@ #include <string.h> #include "common/convert_UTF.h" +#include "common/scoped_ptr.h" #include "common/string_conversion.h" #include "common/using_std_string.h" -#include "processor/scoped_ptr.h" namespace google_breakpad { using std::vector; -void UTF8ToUTF16(const char *in, vector<u_int16_t> *out) { +void UTF8ToUTF16(const char *in, vector<uint16_t> *out) { size_t source_length = strlen(in); const UTF8 *source_ptr = reinterpret_cast<const UTF8 *>(in); const UTF8 *source_end_ptr = source_ptr + source_length; // Erase the contents and zero fill to the expected size out->clear(); out->insert(out->begin(), source_length, 0); - u_int16_t *target_ptr = &(*out)[0]; - u_int16_t *target_end_ptr = target_ptr + out->capacity() * sizeof(u_int16_t); + uint16_t *target_ptr = &(*out)[0]; + uint16_t *target_end_ptr = target_ptr + out->capacity() * sizeof(uint16_t); ConversionResult result = ConvertUTF8toUTF16(&source_ptr, source_end_ptr, &target_ptr, target_end_ptr, strictConversion); @@ -55,11 +55,11 @@ void UTF8ToUTF16(const char *in, vector<u_int16_t> *out) { out->resize(result == conversionOK ? target_ptr - &(*out)[0] + 1: 0); } -int UTF8ToUTF16Char(const char *in, int in_length, u_int16_t out[2]) { +int UTF8ToUTF16Char(const char *in, int in_length, uint16_t out[2]) { const UTF8 *source_ptr = reinterpret_cast<const UTF8 *>(in); - const UTF8 *source_end_ptr = source_ptr + sizeof(char); - u_int16_t *target_ptr = out; - u_int16_t *target_end_ptr = target_ptr + 2 * sizeof(u_int16_t); + const UTF8 *source_end_ptr = source_ptr + 1; + uint16_t *target_ptr = out; + uint16_t *target_end_ptr = target_ptr + 2; out[0] = out[1] = 0; // Process one character at a time @@ -82,15 +82,15 @@ int UTF8ToUTF16Char(const char *in, int in_length, u_int16_t out[2]) { return 0; } -void UTF32ToUTF16(const wchar_t *in, vector<u_int16_t> *out) { +void UTF32ToUTF16(const wchar_t *in, vector<uint16_t> *out) { size_t source_length = wcslen(in); const UTF32 *source_ptr = reinterpret_cast<const UTF32 *>(in); const UTF32 *source_end_ptr = source_ptr + source_length; // Erase the contents and zero fill to the expected size out->clear(); out->insert(out->begin(), source_length, 0); - u_int16_t *target_ptr = &(*out)[0]; - u_int16_t *target_end_ptr = target_ptr + out->capacity() * sizeof(u_int16_t); + uint16_t *target_ptr = &(*out)[0]; + uint16_t *target_end_ptr = target_ptr + out->capacity() * sizeof(uint16_t); ConversionResult result = ConvertUTF32toUTF16(&source_ptr, source_end_ptr, &target_ptr, target_end_ptr, strictConversion); @@ -99,11 +99,11 @@ void UTF32ToUTF16(const wchar_t *in, vector<u_int16_t> *out) { out->resize(result == conversionOK ? target_ptr - &(*out)[0] + 1: 0); } -void UTF32ToUTF16Char(wchar_t in, u_int16_t out[2]) { +void UTF32ToUTF16Char(wchar_t in, uint16_t out[2]) { const UTF32 *source_ptr = reinterpret_cast<const UTF32 *>(&in); const UTF32 *source_end_ptr = source_ptr + 1; - u_int16_t *target_ptr = out; - u_int16_t *target_end_ptr = target_ptr + 2 * sizeof(u_int16_t); + uint16_t *target_ptr = out; + uint16_t *target_end_ptr = target_ptr + 2; out[0] = out[1] = 0; ConversionResult result = ConvertUTF32toUTF16(&source_ptr, source_end_ptr, &target_ptr, target_end_ptr, @@ -114,20 +114,20 @@ void UTF32ToUTF16Char(wchar_t in, u_int16_t out[2]) { } } -static inline u_int16_t Swap(u_int16_t value) { - return (value >> 8) | (value << 8); +static inline uint16_t Swap(uint16_t value) { + return (value >> 8) | static_cast<uint16_t>(value << 8); } -string UTF16ToUTF8(const vector<u_int16_t> &in, bool swap) { +string UTF16ToUTF8(const vector<uint16_t> &in, bool swap) { const UTF16 *source_ptr = &in[0]; - scoped_ptr<u_int16_t> source_buffer; + scoped_array<uint16_t> source_buffer; // If we're to swap, we need to make a local copy and swap each byte pair if (swap) { int idx = 0; - source_buffer.reset(new u_int16_t[in.size()]); + source_buffer.reset(new uint16_t[in.size()]); UTF16 *source_buffer_ptr = source_buffer.get(); - for (vector<u_int16_t>::const_iterator it = in.begin(); + for (vector<uint16_t>::const_iterator it = in.begin(); it != in.end(); ++it, ++idx) source_buffer_ptr[idx] = Swap(*it); @@ -140,7 +140,7 @@ string UTF16ToUTF8(const vector<u_int16_t> &in, bool swap) { scoped_array<UTF8> target_buffer(new UTF8[target_capacity]); UTF8 *target_ptr = target_buffer.get(); UTF8 *target_end_ptr = target_ptr + target_capacity; - ConversionResult result = ConvertUTF16toUTF8(&source_ptr, source_end_ptr, + ConversionResult result = ConvertUTF16toUTF8(&source_ptr, source_end_ptr, &target_ptr, target_end_ptr, strictConversion); |