Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/vowpal_wabbit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Langford <jl@hunch.net>2011-09-20 04:02:56 +0400
committerJohn Langford <jl@hunch.net>2011-09-20 04:02:56 +0400
commit613964666251ee57b2f7813fad8392d37c8952cf (patch)
treebae2762c6723ec1724558fe8032d1b84c322add7 /cluster
parent07c22ba2a8d24920e9f7855b3f3b563874dd4a5d (diff)
remove variable length arrays
Diffstat (limited to 'cluster')
-rw-r--r--cluster/spanning_tree.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/cluster/spanning_tree.cc b/cluster/spanning_tree.cc
index bb937b49..c6472f66 100644
--- a/cluster/spanning_tree.cc
+++ b/cluster/spanning_tree.cc
@@ -197,8 +197,8 @@ int main(int argc, char* argv[]) {
{//Time to make the spanning tree
qsort(partial_nodeset.nodes, total, sizeof(client), socket_sort);
- int parent[total];
- uint16_t kid_count[total];
+ int* parent = (int*)calloc(total,sizeof(int));
+ uint16_t* kid_count = (uint16_t*)calloc(total,sizeof(uint16_t));
int root = build_tree(parent, kid_count, total, 0);
parent[root] = -1;
@@ -208,7 +208,7 @@ int main(int argc, char* argv[]) {
fail_write(partial_nodeset.nodes[i].socket, &kid_count[i], sizeof(kid_count[i]));
}
- uint16_t client_ports[total];
+ uint16_t* client_ports=(uint16_t*)calloc(total,sizeof(uint16_t));
for(size_t i = 0;i < total;i++) {
int done = 0;