Skip to content

Commit

Permalink
Fix emscripten/utf8 bug and fix compile warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
texodus committed Apr 26, 2020
1 parent b380dd1 commit 1e5e083
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 34 deletions.
6 changes: 3 additions & 3 deletions cpp/perspective/src/cpp/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ t_config::t_config(const std::vector<std::string>& row_pivots,
, m_col_sortspecs(col_sortspecs)
, m_aggregates(aggregates)
, m_detail_columns(col_names) // this should be the columns property
, m_combiner(combiner)
, m_fterms(fterms) {
, m_fterms(fterms)
, m_combiner(combiner) {
for (const auto& p : row_pivots) {
m_row_pivots.push_back(t_pivot(p));
}
Expand Down Expand Up @@ -102,8 +102,8 @@ t_config::t_config(const std::vector<std::string>& row_pivots,
const t_totals totals, t_filter_op combiner, const std::vector<t_fterm>& fterms)
: m_aggregates(aggregates)
, m_totals(totals)
, m_combiner(combiner)
, m_fterms(fterms)
, m_combiner(combiner)
, m_fmode(FMODE_SIMPLE_CLAUSES) {
for (const auto& p : row_pivots) {
m_row_pivots.push_back(t_pivot(p));
Expand Down
1 change: 0 additions & 1 deletion cpp/perspective/src/cpp/context_zero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,6 @@ t_ctx0::calc_step_delta(const t_data_table& flattened, const t_data_table& prev,

const t_column* pkey_col = flattened.get_const_column("psp_pkey").get();

t_uindex ncols = m_config.get_num_columns();
const auto& column_names = m_config.get_column_names();

for (const auto& name : column_names) {
Expand Down
11 changes: 2 additions & 9 deletions cpp/perspective/src/cpp/emscripten.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -764,10 +764,7 @@ namespace binding {
continue;
}

std::wstring welem = item.as<std::wstring>();
std::wstring_convert<utf16convert_type, wchar_t> converter;
std::string elem = converter.to_bytes(welem);
col->set_nth(i, elem);
col->set_nth(i, item.as<std::string>());
}
}

Expand Down Expand Up @@ -909,11 +906,7 @@ namespace binding {
break;
}
case DTYPE_STR: {
std::wstring welem = value.as<std::wstring>();

std::wstring_convert<utf16convert_type, wchar_t> converter;
std::string elem = converter.to_bytes(welem);
col->set_nth(idx, elem, STATUS_VALID);
col->set_nth(idx, value.as<std::string>(), STATUS_VALID);
break;
}
case DTYPE_DATE: {
Expand Down
3 changes: 0 additions & 3 deletions cpp/perspective/src/cpp/gnode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,6 @@ t_gnode::_add_computed_column(
const t_computed_column_definition& computed_column,
std::shared_ptr<t_data_table> tbl) {
std::string computed_column_name = std::get<0>(computed_column);
t_computed_function_name computed_function_name = std::get<1>(computed_column);
std::vector<std::string> input_column_names = std::get<2>(computed_column);
t_computation computation = std::get<3>(computed_column);

Expand All @@ -934,7 +933,6 @@ t_gnode::_compute_column(
std::vector<std::shared_ptr<t_column>> input_columns;

std::string computed_column_name = std::get<0>(computed_column);
t_computed_function_name computed_function_name = std::get<1>(computed_column);
std::vector<std::string> input_column_names = std::get<2>(computed_column);
t_computation computation = std::get<3>(computed_column);

Expand Down Expand Up @@ -976,7 +974,6 @@ t_gnode::_recompute_column(
std::vector<std::shared_ptr<t_column>> flattened_columns;

std::string computed_column_name = std::get<0>(computed_column);
t_computed_function_name computed_function_name = std::get<1>(computed_column);
std::vector<std::string> input_column_names = std::get<2>(computed_column);
t_computation computation = std::get<3>(computed_column);

Expand Down
3 changes: 1 addition & 2 deletions docker/emsdk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ FROM debian:stretch AS stage_build
# -------------------------------- STAGE BUILD --------------------------------
# ------------------------------------------------------------------------------

ENV EMSCRIPTEN_SDK 1.39.12
ENV EMSCRIPTEN_SDK 1.39.13
ENV EMSDK_CHANGESET master

# ------------------------------------------------------------------------------
Expand Down Expand Up @@ -398,7 +398,6 @@ libidn11

RUN apt-get -qq update && apt-get install -q -y software-properties-common
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA9EF27F
RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y
RUN apt-get -qq update && apt-get install -qy g++ gcc git wget
RUN wget --quiet --max-redirect 3 https://dl.bintray.com/boostorg/release/1.71.0/source/boost_1_71_0.tar.gz
RUN mkdir -p /usr/include/boost && tar zxf boost_1_71_0.tar.gz -C /usr/include/boost --strip-components=1
Expand Down
16 changes: 0 additions & 16 deletions packages/perspective-bench/src/js/bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,8 @@ async function run_node_version(args, run_test) {
return await js.run();
}

function new_host() {
return new Promise(
resolve =>
new perspective.WebSocketServer({
assets: ["build"],
port: 0,
on_start: function() {
resolve(this);
}
})
);
}

exports.run = async function run(version, benchmark, ...cmdArgs) {
const options = cmdArgs.splice(cmdArgs.length - 1, 1)[0];
const host = await new_host();
// const port = host._server.address().port;

let benchmark_name = options.output || "benchmark";

Expand Down Expand Up @@ -108,7 +93,6 @@ exports.run = async function run(version, benchmark, ...cmdArgs) {
await browser.close();

console.log(`Benchmark suite has finished running - results are in ${benchmark_name}.html.`);
host.close();
} else {
bins = await run_node_version(cmdArgs, RUN_TEST);
}
Expand Down

0 comments on commit 1e5e083

Please sign in to comment.