Skip to content

Commit 111b09f

Browse files
committed
Fixed dev14 warnings and project files
1 parent 3668f34 commit 111b09f

File tree

38 files changed

+179
-105
lines changed

38 files changed

+179
-105
lines changed

Release/include/cpprest/asyncrt_utils.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,11 @@ namespace details
250250
class windows_category_impl : public std::error_category
251251
{
252252
public:
253-
virtual const char *name() const { return "windows"; }
253+
virtual const char *name() const _NOEXCEPT { return "windows"; }
254254

255-
_ASYNCRTIMP virtual std::string message(int errorCode) const;
255+
_ASYNCRTIMP virtual std::string message(int errorCode) const _NOEXCEPT;
256256

257-
_ASYNCRTIMP virtual std::error_condition default_error_condition(int errorCode) const;
257+
_ASYNCRTIMP virtual std::error_condition default_error_condition(int errorCode) const _NOEXCEPT;
258258
};
259259

260260
/// <summary>

Release/include/cpprest/fileio.h

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,29 @@
3333

3434
#if defined(_MSC_VER) && (_MSC_VER >= 1800)
3535
#include <ppltasks.h>
36+
#if (_MSC_VER >= 1900)
37+
#include <concrt.h>
38+
#ifndef DEV14_EXTENSIBILITY_WRKRND
39+
#define DEV14_EXTENSIBILITY_WRKRND
3640
namespace pplx = Concurrency;
37-
#else
41+
namespace Concurrency {
42+
namespace extensibility {
43+
typedef ::std::condition_variable condition_variable_t;
44+
typedef ::std::mutex critical_section_t;
45+
typedef ::std::unique_lock< ::std::mutex> scoped_critical_section_t;
46+
47+
typedef ::Concurrency::event event_t;
48+
typedef ::Concurrency::reader_writer_lock reader_writer_lock_t;
49+
typedef ::Concurrency::reader_writer_lock::scoped_lock scoped_rw_lock_t;
50+
typedef ::Concurrency::reader_writer_lock::scoped_lock_read scoped_read_lock_t;
51+
52+
typedef ::Concurrency::details::_ReentrantBlockingLock recursive_lock_t;
53+
typedef recursive_lock_t::_Scoped_lock scoped_recursive_lock_t;
54+
}
55+
}
56+
#endif // DEV14_EXTENSIBILITY_WRKRND
57+
#endif // _MSC_VER >= 1900
58+
#else // _MSC_VER
3859
#include "pplx/pplxtasks.h"
3960
#endif
4061

Release/include/cpprest/http_msg.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,24 @@
3535
#if defined(_MSC_VER) && (_MSC_VER >= 1800)
3636
#include <ppltasks.h>
3737
namespace pplx = Concurrency;
38+
#if (_MSC_VER >= 1900)
39+
#include <concrt.h>
40+
#ifndef DEV14_EXTENSIBILITY_WRKRND
41+
#define DEV14_EXTENSIBILITY_WRKRND
42+
namespace pplx = Concurrency;
43+
namespace Concurrency {
44+
namespace extensibility {
45+
typedef ::Concurrency::event event_t;
46+
typedef ::Concurrency::reader_writer_lock reader_writer_lock_t;
47+
typedef ::Concurrency::reader_writer_lock::scoped_lock scoped_rw_lock_t;
48+
typedef ::Concurrency::reader_writer_lock::scoped_lock_read scoped_read_lock_t;
49+
50+
typedef ::Concurrency::details::_ReentrantBlockingLock recursive_lock_t;
51+
typedef recursive_lock_t::_Scoped_lock scoped_recursive_lock_t;
52+
}
53+
}
54+
#endif // DEV14_EXTENSIBILITY_WRKRND
55+
#endif // _MSC_VER >= 1900
3856
#else
3957
#include "pplx/pplxtasks.h"
4058
#endif

Release/include/cpprest/streams.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,10 @@ namespace Concurrency { namespace streams
492492
static pplx::task<void> _skip_whitespace(streams::streambuf<CharType> buffer);
493493

494494
// Aid in parsing input: peek at a character at a time, call type-specific code to examine, extract value when done.
495-
template<typename _ParseState, typename _ReturnType>
496-
static pplx::task<_ReturnType> _parse_input(streams::streambuf<CharType> buffer,
497-
std::function<bool(std::shared_ptr<_ParseState>, int_type)> accept_character,
498-
std::function<pplx::task<_ReturnType>(std::shared_ptr<_ParseState>)> extract);
495+
// <remark>AcceptFunctor should model std::function<bool(std::shared_ptr<X>, int_type)></remark>
496+
// <remark>ExtractFunctor should model std::function<pplx::task<ReturnType>(std::shared_ptr<X>)></remark>
497+
template<typename StateType, typename ReturnType, typename AcceptFunctor, typename ExtractFunctor>
498+
static pplx::task<ReturnType> _parse_input(streams::streambuf<CharType> buffer, AcceptFunctor accept_character, ExtractFunctor extract);
499499
};
500500

501501
/// <summary>
@@ -1176,13 +1176,13 @@ pplx::task<void> concurrency::streams::_type_parser_base<CharType>::_skip_whites
11761176
}
11771177

11781178
template<typename CharType>
1179-
template<typename _ParseState, typename _ReturnType>
1180-
pplx::task<_ReturnType> concurrency::streams::_type_parser_base<CharType>::_parse_input(
1179+
template<typename StateType, typename ReturnType, typename AcceptFunctor, typename ExtractFunctor>
1180+
pplx::task<ReturnType> concurrency::streams::_type_parser_base<CharType>::_parse_input(
11811181
concurrency::streams::streambuf<CharType> buffer,
1182-
std::function<bool(std::shared_ptr<_ParseState>, int_type)> accept_character,
1183-
std::function<pplx::task<_ReturnType>(std::shared_ptr<_ParseState>)> extract)
1182+
AcceptFunctor accept_character,
1183+
ExtractFunctor extract)
11841184
{
1185-
std::shared_ptr<_ParseState> state = std::make_shared<_ParseState>();
1185+
std::shared_ptr<StateType> state = std::make_shared<StateType>();
11861186

11871187
auto update_end = [=] (pplx::task<int_type> op) -> bool { op.wait(); return true; };
11881188

@@ -1219,14 +1219,14 @@ pplx::task<_ReturnType> concurrency::streams::_type_parser_base<CharType>::_pars
12191219
};
12201220

12211221
auto finish =
1222-
[=](pplx::task<bool> op) -> pplx::task<_ReturnType>
1222+
[=](pplx::task<bool> op) -> pplx::task<ReturnType>
12231223
{
12241224
op.wait();
1225-
pplx::task<_ReturnType> result = extract(state);
1225+
pplx::task<ReturnType> result = extract(state);
12261226
return result;
12271227
};
12281228

1229-
return _skip_whitespace(buffer).then([=](pplx::task<void> op) -> pplx::task<_ReturnType>
1229+
return _skip_whitespace(buffer).then([=](pplx::task<void> op) -> pplx::task<ReturnType>
12301230
{
12311231
op.wait();
12321232

Release/include/pplx/ioscheduler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class io_scheduler
149149
/// <summary>
150150
/// Get the I/O completion key to use with the scheduler.
151151
/// </summary>
152-
DWORD get_key() const { return (((DWORD)this) & 0xFAFAFA00) + sizeof(EXTENDED_OVERLAPPED); }
152+
DWORD get_key() const { return (((DWORD)(uintptr_t)this) & 0xFAFAFA00) + sizeof(EXTENDED_OVERLAPPED); }
153153

154154
/// <summary>
155155
/// Get the I/O scheduler instance.

Release/samples/BingRequest/BingRequest140/BingRequest140.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
</ItemDefinitionGroup>
185185
<ItemGroup>
186186
<ProjectReference Include="$(CasablancaSrcDir)\build\vs14\casablanca140.vcxproj">
187-
<Project>{90D85FF4-F0AE-4816-923F-0EF2758F30AB}</Project>
187+
<Project>{1014c621-bc2d-4813-b8c1-6d83ad6f9249}</Project>
188188
</ProjectReference>
189189
</ItemGroup>
190190
<ItemGroup>

Release/samples/BlackJack/BlackJack_Client/BlackJack_Client140/BlackJack_Client140.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
</ItemGroup>
199199
<ItemGroup>
200200
<ProjectReference Include="$(CasablancaSrcDir)\build\vs14\casablanca140.vcxproj">
201-
<Project>{90D85FF4-F0AE-4816-923F-0EF2758F30AB}</Project>
201+
<Project>{1014c621-bc2d-4813-b8c1-6d83ad6f9249}</Project>
202202
</ProjectReference>
203203
</ItemGroup>
204204
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

Release/samples/BlackJack/BlackJack_Server/BlackJack_Server140/BlackJack_Server140.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@
204204
</ItemGroup>
205205
<ItemGroup>
206206
<ProjectReference Include="$(CasablancaSrcDir)\build\vs14\casablanca140.vcxproj">
207-
<Project>{90D85FF4-F0AE-4816-923F-0EF2758F30AB}</Project>
207+
<Project>{1014c621-bc2d-4813-b8c1-6d83ad6f9249}</Project>
208208
</ProjectReference>
209209
</ItemGroup>
210210
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

Release/samples/BlackJack/BlackJack_Server/messagetypes.h

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -126,35 +126,35 @@ struct BJHand
126126

127127
NumericHandValues GetNumericValues()
128128
{
129-
NumericHandValues result;
130-
result.low = 0;
131-
result.low = 0;
129+
NumericHandValues res;
130+
res.low = 0;
131+
res.low = 0;
132132

133133
bool hasAces = false;
134134

135135
for (auto iter = cards.begin(); iter != cards.end(); ++iter)
136136
{
137137
if ( iter->value == CV_Ace ) hasAces = true;
138138

139-
result.low += std::min((int)iter->value, 10);
139+
res.low += std::min((int)iter->value, 10);
140140
}
141-
result.high = hasAces ? result.low + 10 : result.low;
142-
return result;
141+
res.high = hasAces ? res.low + 10 : res.low;
142+
return res;
143143
}
144144

145145
static BJHand FromJSON(const web::json::object &object)
146146
{
147-
BJHand result;
147+
BJHand res;
148148

149-
web::json::value cards = object.at(CARDS);
149+
web::json::value cs = object.at(CARDS);
150150

151-
for (auto iter = cards.as_array().begin(); iter != cards.as_array().end(); ++iter)
151+
for (auto iter = cs.as_array().begin(); iter != cs.as_array().end(); ++iter)
152152
{
153153
if ( !iter->is_null() )
154154
{
155155
Card card;
156156
card = Card::FromJSON(iter->as_object());
157-
result.cards.push_back(card);
157+
res.cards.push_back(card);
158158
}
159159
}
160160

@@ -164,35 +164,35 @@ struct BJHand
164164
{
165165
throw web::json::json_exception(U("STATE key not found"));
166166
}
167-
result.state = (BJHandState)iState->second.as_integer();
167+
res.state = (BJHandState)iState->second.as_integer();
168168
auto iBet = object.find(BET);
169169
if (iBet == object.end())
170170
{
171171
throw web::json::json_exception(U("BET key not found"));
172172
}
173-
result.bet = iBet->second.as_double();
173+
res.bet = iBet->second.as_double();
174174
auto iInsurance = object.find(INSURANCE);
175175
if (iInsurance == object.end())
176176
{
177177
throw web::json::json_exception(U("INSURANCE key not found"));
178178
}
179-
result.insurance = iInsurance->second.as_double();
179+
res.insurance = iInsurance->second.as_double();
180180
auto iResult = object.find(RESULT);
181181
if (iResult == object.end())
182182
{
183183
throw web::json::json_exception(U("RESULT key not found"));
184184
}
185-
result.result = (BJHandResult)object.find(RESULT)->second.as_integer();
186-
return result;
185+
res.result = (BJHandResult)object.find(RESULT)->second.as_integer();
186+
return res;
187187
}
188188

189189
web::json::value AsJSON() const
190190
{
191-
web::json::value result = web::json::value::object();
192-
result[STATE] = web::json::value::number(state);
193-
result[RESULT] = web::json::value::number(this->result);
194-
result[BET] = web::json::value::number(bet);
195-
result[INSURANCE] = web::json::value::number(insurance);
191+
web::json::value res = web::json::value::object();
192+
res[STATE] = web::json::value::number(state);
193+
res[RESULT] = web::json::value::number(this->result);
194+
res[BET] = web::json::value::number(bet);
195+
res[INSURANCE] = web::json::value::number(insurance);
196196

197197
web::json::value jCards = web::json::value::array(cards.size());
198198

@@ -213,8 +213,8 @@ struct BJHand
213213
break;
214214
}
215215
}
216-
result[CARDS] = jCards;
217-
return result;
216+
res[CARDS] = jCards;
217+
return res;
218218
}
219219
};
220220

Release/samples/CasaLens/CasaLens140/CasaLens140.vcxproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,6 @@
121121
<OptimizeReferences>true</OptimizeReferences>
122122
</Link>
123123
</ItemDefinitionGroup>
124-
<ItemGroup>
125-
<ProjectReference Include="$(CasablancaSrcDir)\build\vs14\casablanca140.vcxproj">
126-
<Project>{90D85FF4-F0AE-4816-923F-0EF2758F30AB}</Project>
127-
</ProjectReference>
128-
</ItemGroup>
129124
<ItemGroup>
130125
<Text Include="..\ReadMe.txt" />
131126
</ItemGroup>
@@ -143,6 +138,11 @@
143138
<ClCompile Include="..\casalens.cpp" />
144139
<ClCompile Include="..\datafetcher.cpp" />
145140
</ItemGroup>
141+
<ItemGroup>
142+
<ProjectReference Include="..\..\..\src\build\vs14\casablanca140.vcxproj">
143+
<Project>{1014c621-bc2d-4813-b8c1-6d83ad6f9249}</Project>
144+
</ProjectReference>
145+
</ItemGroup>
146146
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
147147
<Target Name="PreBuildEvent">
148148
<MakeDir Directories="$(MSBuildProjectDirectory)\css" />

0 commit comments

Comments
 (0)