Skip to content

Commit fdc1d7c

Browse files
committed
Merge remote-tracking branch 'origin/development' into android-clang-3
2 parents 2ffed38 + 85e4c48 commit fdc1d7c

File tree

80 files changed

+1455
-1228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+1455
-1228
lines changed

Release/include/cpprest/astreambuf.h

Lines changed: 60 additions & 60 deletions
Large diffs are not rendered by default.

Release/include/cpprest/asyncrt_utils.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ namespace details
186186
std::string m_prevLocale;
187187
int m_prevThreadSetting;
188188
#elif !defined(ANDROID)
189-
locale_t m_prevLocale;
189+
locale_t m_prevLocale;
190190
#endif
191191
scoped_c_thread_locale(const scoped_c_thread_locale &);
192192
scoped_c_thread_locale & operator=(const scoped_c_thread_locale &);
@@ -316,7 +316,7 @@ class datetime
316316
enum date_format { RFC_1123, ISO_8601 };
317317

318318
/// <summary>
319-
/// Returns the current UTC time.
319+
/// Returns the current UTC time.
320320
/// </summary>
321321
static _ASYNCRTIMP datetime __cdecl utc_now();
322322

@@ -409,7 +409,7 @@ class datetime
409409
return days*_dayTicks;
410410
}
411411

412-
bool is_initialized() const
412+
bool is_initialized() const
413413
{
414414
return m_interval != 0;
415415
}
@@ -447,7 +447,7 @@ class datetime
447447
class cmp
448448
{
449449
public:
450-
450+
451451
static int icmp(std::string left, std::string right)
452452
{
453453
size_t i;
@@ -481,7 +481,7 @@ inline int operator- (datetime t1, datetime t2)
481481

482482
// Round it down to seconds
483483
diff /= 10 * 1000 * 1000;
484-
484+
485485
return static_cast<int>(diff);
486486
}
487487

Release/include/cpprest/base_uri.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/***
22
* ==++==
33
*
4-
* Copyright (c) Microsoft Corporation. All rights reserved.
4+
* Copyright (c) Microsoft Corporation. All rights reserved.
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
77
* You may obtain a copy of the License at
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -94,7 +94,7 @@ namespace web {
9494
}
9595
return *this;
9696
}
97-
97+
9898
_ASYNCRTIMP utility::string_t join();
9999

100100
utility::string_t m_scheme;
@@ -138,11 +138,11 @@ namespace web {
138138
/// ('/path?query#frag').
139139
///
140140
/// This implementation does not provide any scheme-specific handling -- an example of this
141-
/// would be the following: 'http://path1/path'. This is a valid URI, but it's not a valid
142-
/// http-uri -- that is, it's syntactically correct but does not conform to the requirements
143-
/// of the http scheme (http requires a host).
144-
/// We could provide this by allowing a pluggable 'scheme' policy-class, which would provide
145-
/// extra capability for validating and canonicalizing a URI according to scheme, and would
141+
/// would be the following: 'http://path1/path'. This is a valid URI, but it's not a valid
142+
/// http-uri -- that is, it's syntactically correct but does not conform to the requirements
143+
/// of the http scheme (http requires a host).
144+
/// We could provide this by allowing a pluggable 'scheme' policy-class, which would provide
145+
/// extra capability for validating and canonicalizing a URI according to scheme, and would
146146
/// introduce a layer of type-safety for URIs of differing schemes, and thus differing semantics.
147147
///
148148
/// One issue with implementing a scheme-independent URI facility is that of comparing for equality.
@@ -178,15 +178,15 @@ namespace web {
178178

179179
/// <summary>
180180
/// Encodes a URI component according to RFC 3986.
181-
/// Note if a full URI is specified instead of an individual URI component all
181+
/// Note if a full URI is specified instead of an individual URI component all
182182
/// characters not in the unreserved set are escaped.
183183
/// </summary>
184184
/// <param name="raw">The URI as a string.</param>
185185
/// <returns>The encoded string.</returns>
186186
_ASYNCRTIMP static utility::string_t __cdecl encode_uri(const utility::string_t &raw, uri::components::component = components::full_uri);
187187

188188
/// <summary>
189-
/// Encodes a string by converting all characters except for RFC 3986 unreserved characters to their
189+
/// Encodes a string by converting all characters except for RFC 3986 unreserved characters to their
190190
/// hexadecimal representation.
191191
/// </summary>
192192
/// <param name="utf8data">The UTF-8 string data.</param>
@@ -227,14 +227,14 @@ namespace web {
227227
uri() { m_uri = _XPLATSTR("/");};
228228

229229
/// <summary>
230-
/// Creates a URI from the given encoded string. This will throw an exception if the string
230+
/// Creates a URI from the given encoded string. This will throw an exception if the string
231231
/// does not contain a valid URI. Use uri::validate if processing user-input.
232232
/// </summary>
233233
/// <param name="uri_string">A pointer to an encoded string to create the URI instance.</param>
234234
_ASYNCRTIMP uri(const utility::char_t *uri_string);
235235

236236
/// <summary>
237-
/// Creates a URI from the given encoded string. This will throw an exception if the string
237+
/// Creates a URI from the given encoded string. This will throw an exception if the string
238238
/// does not contain a valid URI. Use uri::validate if processing user-input.
239239
/// </summary>
240240
/// <param name="uri_string">An encoded URI string to create the URI instance.</param>

Release/include/cpprest/basic_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/***
22
* ==++==
33
*
4-
* Copyright (c) Microsoft Corporation. All rights reserved.
4+
* Copyright (c) Microsoft Corporation. All rights reserved.
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
77
* You may obtain a copy of the License at
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

Release/include/cpprest/containerstream.h

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ namespace Concurrency { namespace streams {
120120
/// </summary>
121121
virtual utility::size64_t size() const
122122
{
123-
return utility::size64_t(m_size);
123+
return utility::size64_t(m_data.size());
124124
}
125125

126126
/// <summary>
@@ -153,10 +153,10 @@ namespace Concurrency { namespace streams {
153153
{
154154
// See the comment in seek around the restriction that we do not allow read head to
155155
// seek beyond the current write_end.
156-
_ASSERTE(m_current_position <= m_size);
156+
_ASSERTE(m_current_position <= m_data.size());
157157

158158
SafeSize readhead(m_current_position);
159-
SafeSize writeend(m_size);
159+
SafeSize writeend(m_data.size());
160160
return (size_t)(writeend - readhead);
161161
}
162162

@@ -330,7 +330,7 @@ namespace Concurrency { namespace streams {
330330
// For now, we assume that the current write_end is the end of the buffer. We use this artificial
331331
// end to restrict the read head from seeking beyond what is available.
332332

333-
pos_type end(m_size);
333+
pos_type end(m_data.size());
334334

335335
if (position >= beg)
336336
{
@@ -378,7 +378,7 @@ namespace Concurrency { namespace streams {
378378
{
379379
pos_type beg = 0;
380380
pos_type cur = static_cast<pos_type>(m_current_position);
381-
pos_type end = static_cast<pos_type>(m_size);
381+
pos_type end = static_cast<pos_type>(m_data.size());
382382

383383
switch ( way )
384384
{
@@ -404,8 +404,7 @@ namespace Concurrency { namespace streams {
404404
/// </summary>
405405
basic_container_buffer(std::ios_base::openmode mode)
406406
: streambuf_state_manager<typename _CollectionType::value_type>(mode),
407-
m_current_position(0),
408-
m_size(0)
407+
m_current_position(0)
409408
{
410409
validate_mode(mode);
411410
}
@@ -416,8 +415,7 @@ namespace Concurrency { namespace streams {
416415
basic_container_buffer(_CollectionType data, std::ios_base::openmode mode)
417416
: streambuf_state_manager<typename _CollectionType::value_type>(mode),
418417
m_data(std::move(data)),
419-
m_current_position((mode & std::ios_base::in) ? 0 : m_data.size()),
420-
m_size(m_data.size())
418+
m_current_position((mode & std::ios_base::in) ? 0 : m_data.size())
421419
{
422420
validate_mode(mode);
423421
}
@@ -509,10 +507,8 @@ namespace Concurrency { namespace streams {
509507
/// </summary>
510508
void resize_for_write(size_t newPos)
511509
{
512-
_ASSERTE(m_size <= m_data.size());
513-
514510
// Resize the container if required
515-
if (newPos > m_size)
511+
if (newPos > m_data.size())
516512
{
517513
m_data.resize(newPos);
518514
}
@@ -525,23 +521,14 @@ namespace Concurrency { namespace streams {
525521
{
526522
// The new write head
527523
m_current_position = newPos;
528-
529-
if ( this->can_write() && m_size < m_current_position)
530-
{
531-
// Update the size of the buffer with valid data if required
532-
m_size = m_current_position;
533-
}
534-
535-
_ASSERTE(m_current_position <= m_size);
536-
_ASSERTE(m_size <= m_data.size());
524+
_ASSERTE(m_current_position <= m_data.size());
537525
}
538526

539527
// The actual data store
540528
_CollectionType m_data;
541529

542530
// Read/write head
543531
size_t m_current_position;
544-
size_t m_size;
545532
};
546533

547534
} // namespace details

Release/include/cpprest/details/apple_compat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#define __declspec(x) __attribute__ ((x))
3737

3838
// ignore these:
39-
#define dllimport
39+
#define dllimport
4040

4141
#include <stdint.h>
4242
#include <assert.h>

Release/include/cpprest/details/linux_compat.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/***
22
* ==++==
33
*
4-
* Copyright (c) Microsoft Corporation. All rights reserved.
4+
* Copyright (c) Microsoft Corporation. All rights reserved.
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
77
* You may obtain a copy of the License at
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -40,7 +40,7 @@
4040
#define __declspec(x) __attribute__ ((x))
4141

4242
// ignore these:
43-
#define dllimport
43+
#define dllimport
4444
#ifdef __LP64__ // ignore cdecl on 64-bit
4545
#define cdecl
4646
#endif

Release/include/cpprest/details/nosal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/***
22
* ==++==
33
*
4-
* Copyright (c) Microsoft Corporation. All rights reserved.
4+
* Copyright (c) Microsoft Corporation. All rights reserved.
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
77
* You may obtain a copy of the License at
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

Release/include/cpprest/details/windows_compat.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/***
22
* ==++==
33
*
4-
* Copyright (c) Microsoft Corporation. All rights reserved.
4+
* Copyright (c) Microsoft Corporation. All rights reserved.
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
77
* You may obtain a copy of the License at
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

Release/include/cpprest/fileio.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/***
22
* ==++==
33
*
4-
* Copyright (c) Microsoft Corporation. All rights reserved.
4+
* Copyright (c) Microsoft Corporation. All rights reserved.
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
77
* You may obtain a copy of the License at
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -89,19 +89,19 @@ namespace details
8989
/// </summary>
9090
struct _file_info
9191
{
92-
_ASYNCRTIMP _file_info(std::ios_base::openmode mode, size_t buffer_size) :
93-
m_rdpos(0),
94-
m_wrpos(0),
95-
m_atend(false),
92+
_ASYNCRTIMP _file_info(std::ios_base::openmode mode, size_t buffer_size) :
93+
m_rdpos(0),
94+
m_wrpos(0),
95+
m_atend(false),
9696
m_buffer_size(buffer_size),
9797
m_buffer(nullptr),
98-
m_bufoff(0),
98+
m_bufoff(0),
9999
m_bufsize(0),
100100
m_buffill(0),
101101
m_mode(mode)
102102
{
103103
}
104-
104+
105105
// Positional data
106106

107107
size_t m_rdpos;
@@ -140,7 +140,7 @@ namespace details
140140
}
141141
}}
142142

143-
extern "C"
143+
extern "C"
144144
{
145145
/// <summary>
146146
/// Open a file and create a streambuf instance to represent it.

0 commit comments

Comments
 (0)