summaryrefslogtreecommitdiffstats
authorDon Pellegrino <don@coffee.donpellegrino.com>2009-08-14 19:40:35 (GMT)
committer Don Pellegrino <don@coffee.donpellegrino.com>2009-08-14 19:40:35 (GMT)
commit873945533e5d66583f1acc9b0d1580cef5856728 (patch) (side-by-side diff)
tree2a994647d087a228685616493df3754a572fc00e
parent8de1ddca2733630a20b2663928084d209632d88f (diff)
downloadexp005-873945533e5d66583f1acc9b0d1580cef5856728.zip
exp005-873945533e5d66583f1acc9b0d1580cef5856728.tar.gz
exp005-873945533e5d66583f1acc9b0d1580cef5856728.tar.bz2
Modified to use dynamic memory allocation based on the number of nodes to process.
-rw-r--r--src/model/selection_info.h7
-rw-r--r--src/model/selection_info_init.c2
-rw-r--r--src/view/exp004init.c1
3 files changed, 3 insertions, 7 deletions
diff --git a/src/model/selection_info.h b/src/model/selection_info.h
index ccd3f7a..73a1c34 100644
--- a/src/model/selection_info.h
+++ b/src/model/selection_info.h
@@ -4,18 +4,13 @@
#include "selection_purposes.h"
#include <stdbool.h>
-/*
- * Vertices in the graph.
- */
-#define ROWS 83905
-
typedef struct
{
/*
* Selection list.
*/
- bool set[ROWS];
+ bool *set;
/*
* A selection is being performed.
diff --git a/src/model/selection_info_init.c b/src/model/selection_info_init.c
index 33b3bb5..40d00aa 100644
--- a/src/model/selection_info_init.c
+++ b/src/model/selection_info_init.c
@@ -4,7 +4,7 @@
void
selection_info_init (SELECTION_INFO * s)
{
- memset (s->set, 0, sizeof (bool) * ROWS);
+ s->set = NULL;
s->active = false;
s->purpose = SET;
s->x = 0;
diff --git a/src/view/exp004init.c b/src/view/exp004init.c
index 5a6ddd0..af66623 100644
--- a/src/view/exp004init.c
+++ b/src/view/exp004init.c
@@ -18,6 +18,7 @@ exp004init (void)
* Initialize default values, zero memory and NULL pointers.
*/
S.rows = 0;
+ S.gi_data = NULL;
S.base_vertices_data = NULL;
S.base_colors_data = NULL;
selection_info_init (&S.selection);

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.