Skip to content

Commit b6e8b88

Browse files
committed
Removed unnecessary dependencies
1 parent 2edd349 commit b6e8b88

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

windows/RNFetchBlob/RNFetchBlob.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
#include "pch.h"
22
#include "RNFetchBlob.h"
3-
#include <windows.h>
3+
#include <winrt/Windows.ApplicationModel.Activation.h>
44
#include <winrt/Windows.Security.Cryptography.h>
55
#include <winrt/Windows.Security.Cryptography.Core.h>
66
#include <winrt/Windows.Storage.FileProperties.h>
77
#include <winrt/Windows.Storage.Streams.h>
88
#include <winrt/Windows.Storage.h>
9-
109
#include <winrt/Windows.Web.Http.h>
1110
#include <winrt/Windows.Web.Http.Headers.h>
1211
#include <winrt/windows.web.http.filters.h>
13-
1412
#include <filesystem>
1513
#include <sstream>
1614

@@ -21,8 +19,6 @@ using namespace winrt::Windows::Storage::Streams;
2119
using namespace winrt::Windows::Foundation;
2220
using namespace winrt::Windows::Security::Cryptography;
2321
using namespace winrt::Windows::Security::Cryptography::Core;
24-
25-
2622
using namespace std::chrono_literals;
2723

2824
CancellationDisposable::CancellationDisposable(IAsyncInfo const& async, std::function<void()>&& onCancel) noexcept
@@ -260,11 +256,11 @@ winrt::fire_and_forget RNFetchBlob::createFileASCII(
260256
winrt::Microsoft::ReactNative::ReactPromise<std::string> promise) noexcept
261257
try
262258
{
263-
std::vector<byte> data;
259+
std::vector<uint8_t> data;
264260
data.reserve(dataArray.size());
265261
for (auto& var : dataArray)
266262
{
267-
data.push_back(var.AsInt8());
263+
data.push_back(var.AsUInt8());
268264
}
269265

270266
Streams::IBuffer buffer{ CryptographicBuffer::CreateFromByteArray(data) };
@@ -369,11 +365,11 @@ winrt::fire_and_forget RNFetchBlob::writeFileArray(
369365
winrt::Microsoft::ReactNative::ReactPromise<int> promise) noexcept
370366
try
371367
{
372-
std::vector<byte> data;
368+
std::vector<uint8_t> data;
373369
data.reserve(dataArray.size());
374370
for (auto& var : dataArray)
375371
{
376-
data.push_back(var.AsInt8());
372+
data.push_back(var.AsUInt8());
377373
}
378374
Streams::IBuffer buffer{ CryptographicBuffer::CreateFromByteArray(data) };
379375

@@ -497,11 +493,11 @@ void RNFetchBlob::writeArrayChunk(
497493
try
498494
{
499495
auto stream{ m_streamMap.find(streamId)->second };
500-
std::vector<byte> data;
496+
std::vector<uint8_t> data;
501497
data.reserve(dataArray.size());
502498
for (auto& var : dataArray)
503499
{
504-
data.push_back(var.AsInt8());
500+
data.push_back(var.AsUInt8());
505501
}
506502
Streams::IBuffer buffer{ CryptographicBuffer::CreateFromByteArray(data) };
507503

windows/RNFetchBlob/pch.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
#pragma once
22
#include <winrt/Windows.Foundation.h>
33
#include <winrt/Windows.Foundation.Collections.h>
4-
5-
#include <hstring.h>
6-
#include <winrt/Windows.ApplicationModel.Activation.h>

0 commit comments

Comments
 (0)