Skip to content

Commit b402248

Browse files
committed
Fix C++ linting issues.
1 parent ca3b0cb commit b402248

File tree

3 files changed

+47
-40
lines changed

3 files changed

+47
-40
lines changed

matlab/src/cpp/arrow/matlab/array/proxy/array.cc

+11-7
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,19 @@ void Array::slice(libmexclass::proxy::method::Context& context) {
182182
}
183183

184184
void Array::exportToC(libmexclass::proxy::method::Context& context) {
185-
namespace mda = ::matlab::data;
186-
mda::StructArray opts = context.inputs[0];
187-
const mda::TypedArray<uint64_t> array_address_mda = opts[0]["ArrowArrayAddress"];
188-
const mda::TypedArray<uint64_t> schema_address_mda = opts[0]["ArrowSchemaAddress"];
185+
namespace mda = ::matlab::data;
186+
mda::StructArray opts = context.inputs[0];
187+
const mda::TypedArray<uint64_t> array_address_mda = opts[0]["ArrowArrayAddress"];
188+
const mda::TypedArray<uint64_t> schema_address_mda = opts[0]["ArrowSchemaAddress"];
189189

190-
struct ArrowArray* arrow_array = reinterpret_cast<struct ArrowArray*>(uint64_t(array_address_mda[0]));
191-
struct ArrowSchema* arrow_schema = reinterpret_cast<struct ArrowSchema*>(uint64_t(schema_address_mda[0]));
190+
struct ArrowArray* arrow_array =
191+
reinterpret_cast<struct ArrowArray*>(uint64_t(array_address_mda[0]));
192+
struct ArrowSchema* arrow_schema =
193+
reinterpret_cast<struct ArrowSchema*>(uint64_t(schema_address_mda[0]));
192194

193-
MATLAB_ERROR_IF_NOT_OK_WITH_CONTEXT(arrow::ExportArray(*array, arrow_array, arrow_schema), context, error::C_EXPORT_FAILED);
195+
MATLAB_ERROR_IF_NOT_OK_WITH_CONTEXT(
196+
arrow::ExportArray(*array, arrow_array, arrow_schema), context,
197+
error::C_EXPORT_FAILED);
194198
}
195199

196200
} // namespace arrow::matlab::array::proxy

matlab/src/cpp/arrow/matlab/c/proxy/array_importer.cc

+34-31
Original file line numberDiff line numberDiff line change
@@ -18,51 +18,54 @@
1818
#include "arrow/array.h"
1919
#include "arrow/c/bridge.h"
2020

21-
#include "arrow/matlab/c/proxy/array_importer.h"
2221
#include "arrow/matlab/array/proxy/wrap.h"
22+
#include "arrow/matlab/c/proxy/array_importer.h"
2323
#include "arrow/matlab/error/error.h"
2424

2525
#include "libmexclass/proxy/ProxyManager.h"
2626

2727
namespace arrow::matlab::c::proxy {
2828

29-
ArrayImporter::ArrayImporter() {
30-
REGISTER_METHOD(ArrayImporter, import);
31-
}
29+
ArrayImporter::ArrayImporter() { REGISTER_METHOD(ArrayImporter, import); }
3230

33-
libmexclass::proxy::MakeResult ArrayImporter::make(const libmexclass::proxy::FunctionArguments& constructor_arguments) {
34-
return std::make_shared<ArrayImporter>();
35-
}
31+
libmexclass::proxy::MakeResult ArrayImporter::make(
32+
const libmexclass::proxy::FunctionArguments& constructor_arguments) {
33+
return std::make_shared<ArrayImporter>();
34+
}
3635

37-
void ArrayImporter::import(libmexclass::proxy::method::Context& context) {
38-
namespace mda = ::matlab::data;
39-
using namespace libmexclass::proxy;
36+
void ArrayImporter::import(libmexclass::proxy::method::Context& context) {
37+
namespace mda = ::matlab::data;
38+
using namespace libmexclass::proxy;
4039

41-
mda::StructArray args = context.inputs[0];
42-
const mda::TypedArray<uint64_t> arrow_array_address_mda = args[0]["ArrowArrayAddress"];
43-
const mda::TypedArray<uint64_t> arrow_schema_address_mda = args[0]["ArrowSchemaAddress"];
40+
mda::StructArray args = context.inputs[0];
41+
const mda::TypedArray<uint64_t> arrow_array_address_mda = args[0]["ArrowArrayAddress"];
42+
const mda::TypedArray<uint64_t> arrow_schema_address_mda =
43+
args[0]["ArrowSchemaAddress"];
4444

45-
const auto arrow_array_address = uint64_t(arrow_array_address_mda[0]);
46-
const auto arrow_schema_address = uint64_t(arrow_schema_address_mda[0]);
45+
const auto arrow_array_address = uint64_t(arrow_array_address_mda[0]);
46+
const auto arrow_schema_address = uint64_t(arrow_schema_address_mda[0]);
4747

48-
struct ArrowArray* arrow_array = reinterpret_cast<struct ArrowArray*>(arrow_array_address);
49-
struct ArrowSchema* arrow_schema = reinterpret_cast<struct ArrowSchema*>(arrow_schema_address);
48+
struct ArrowArray* arrow_array =
49+
reinterpret_cast<struct ArrowArray*>(arrow_array_address);
50+
struct ArrowSchema* arrow_schema =
51+
reinterpret_cast<struct ArrowSchema*>(arrow_schema_address);
5052

51-
MATLAB_ASSIGN_OR_ERROR_WITH_CONTEXT(std::shared_ptr<arrow::Array> array,
52-
arrow::ImportArray(arrow_array, arrow_schema),
53-
context, error::C_IMPORT_FAILED);
53+
MATLAB_ASSIGN_OR_ERROR_WITH_CONTEXT(std::shared_ptr<arrow::Array> array,
54+
arrow::ImportArray(arrow_array, arrow_schema),
55+
context, error::C_IMPORT_FAILED);
5456

55-
MATLAB_ASSIGN_OR_ERROR_WITH_CONTEXT(auto array_proxy,
56-
arrow::matlab::array::proxy::wrap(array), context,
57-
error::UNKNOWN_PROXY_FOR_ARRAY_TYPE);
57+
MATLAB_ASSIGN_OR_ERROR_WITH_CONTEXT(auto array_proxy,
58+
arrow::matlab::array::proxy::wrap(array), context,
59+
error::UNKNOWN_PROXY_FOR_ARRAY_TYPE);
5860

59-
mda::ArrayFactory factory;
60-
const auto array_proxy_id = ProxyManager::manageProxy(array_proxy);
61-
const auto array_proxy_id_mda = factory.createScalar(array_proxy_id);
62-
const auto array_type_id_mda = factory.createScalar(static_cast<int32_t>(array->type_id()));
61+
mda::ArrayFactory factory;
62+
const auto array_proxy_id = ProxyManager::manageProxy(array_proxy);
63+
const auto array_proxy_id_mda = factory.createScalar(array_proxy_id);
64+
const auto array_type_id_mda =
65+
factory.createScalar(static_cast<int32_t>(array->type_id()));
6366

64-
context.outputs[0] = array_proxy_id_mda;
65-
context.outputs[1] = array_type_id_mda;
66-
}
67+
context.outputs[0] = array_proxy_id_mda;
68+
context.outputs[1] = array_type_id_mda;
69+
}
6770

68-
} // namespace arrow::matlab::c::proxy
71+
} // namespace arrow::matlab::c::proxy

matlab/src/cpp/arrow/matlab/c/proxy/array_importer.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class ArrayImporter : public libmexclass::proxy::Proxy {
2727

2828
~ArrayImporter() = default;
2929

30-
static libmexclass::proxy::MakeResult make(
31-
const libmexclass::proxy::FunctionArguments& constructor_arguments);
30+
static libmexclass::proxy::MakeResult make(
31+
const libmexclass::proxy::FunctionArguments& constructor_arguments);
3232

3333
protected:
3434
void import(libmexclass::proxy::method::Context& context);

0 commit comments

Comments
 (0)