@@ -133,8 +133,8 @@ namespace Concurrency { namespace streams {
133133 // seek beyond the current size.
134134 _ASSERTE (m_current_position <= m_size);
135135
136- SafeSize readhead (m_current_position);
137- SafeSize writeend (m_size);
136+ msl::safeint3::SafeInt< size_t > readhead (m_current_position);
137+ msl::safeint3::SafeInt< size_t > writeend (m_size);
138138 return (size_t )(writeend - readhead);
139139 }
140140
@@ -178,7 +178,7 @@ namespace Concurrency { namespace streams {
178178
179179 virtual pplx::task<size_t > _putn (const _CharType *ptr, size_t count)
180180 {
181- SafeSize newSize = SafeSize (count) + m_current_position;
181+ msl::safeint3::SafeInt< size_t > newSize = msl::safeint3::SafeInt< size_t > (count) + m_current_position;
182182 if ( newSize > m_size )
183183 return pplx::task_from_exception<size_t >(std::make_exception_ptr (std::runtime_error (" Writing past the end of the buffer" )));
184184 return pplx::task_from_result<size_t >(this ->write (ptr, count));
@@ -193,8 +193,8 @@ namespace Concurrency { namespace streams {
193193 {
194194 if (!this ->can_write ()) return nullptr ;
195195
196- SafeSize readhead (m_current_position);
197- SafeSize writeend (m_size);
196+ msl::safeint3::SafeInt< size_t > readhead (m_current_position);
197+ msl::safeint3::SafeInt< size_t > writeend (m_size);
198198 size_t space_left = (size_t )(writeend - readhead);
199199
200200 if (space_left < count) return nullptr ;
@@ -476,8 +476,8 @@ namespace Concurrency { namespace streams {
476476 if (!can_satisfy (count))
477477 return 0 ;
478478
479- SafeSize request_size (count);
480- SafeSize read_size = request_size.Min (in_avail ());
479+ msl::safeint3::SafeInt< size_t > request_size (count);
480+ msl::safeint3::SafeInt< size_t > read_size = request_size.Min (in_avail ());
481481
482482 size_t newPos = m_current_position + read_size;
483483
@@ -506,7 +506,7 @@ namespace Concurrency { namespace streams {
506506 {
507507 if (!this ->can_write () || (count == 0 )) return 0 ;
508508
509- SafeSize newSize = SafeSize (count) + m_current_position;
509+ msl::safeint3::SafeInt< size_t > newSize = msl::safeint3::SafeInt< size_t > (count) +m_current_position;
510510
511511 if ( newSize > m_size )
512512 throw std::runtime_error (" Writing past the end of the buffer" );
0 commit comments