Soft'N'Design Software
/
projects
/
calc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
better control on base parameters
[calc.git]
/
workspace.c
diff --git
a/workspace.c
b/workspace.c
index 26bbe8abcbcd70fb2f30d79a2e1f9d06249fbc85..eca1bf2bb182178bba5cd3372a3e0dbc9e3f45cc 100644
(file)
--- a/
workspace.c
+++ b/
workspace.c
@@
-1,7
+1,6
@@
#include <malloc.h>
#include <stdio.h>
#include <malloc.h>
#include <stdio.h>
-#include "argument.h"
#include "debug.h"
#include "element.h"
#include "parser.h"
#include "debug.h"
#include "element.h"
#include "parser.h"
@@
-23,8
+22,13
@@
workspace_t *alloc_ws ()
workspace_t *backup_ws (workspace_t *ws)
{
ws->answer = answer;
workspace_t *backup_ws (workspace_t *ws)
{
ws->answer = answer;
- ws->argument = copy_tab (argument);
+ if (ws->stack) {
+ free_tab (ws->stack);
+ }
ws->stack = copy_tab (stack);
ws->stack = copy_tab (stack);
+ if (ws->storage) {
+ free_tab (ws->storage);
+ }
ws->storage = copy_tab (storage);
return ws;
}
ws->storage = copy_tab (storage);
return ws;
}
@@
-35,11
+39,6
@@
workspace_t *clean_ws (workspace_t *ws)
{
ws->answer = 0;
{
ws->answer = 0;
- if (ws->argument) {
- free_tab (ws->argument);
- ws->argument = NULL;
- }
-
ws->id = 0;
if (ws->root) {
ws->id = 0;
if (ws->root) {
@@
-81,11
+80,6
@@
void restore_ws (workspace_t *ws)
{
answer = ws->answer;
{
answer = ws->answer;
- if (argument) {
- free_tab (argument);
- }
- argument = copy_tab (ws->argument);
-
if (stack) {
free_tab (stack);
}
if (stack) {
free_tab (stack);
}