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
new command: base
[calc.git]
/
storage.c
diff --git
a/storage.c
b/storage.c
index dda1856155387d8f8d5b5afbd9697eabfaee2215..15a64702a46b92278eaf34bf44f0ff5816419acd 100644
(file)
--- a/
storage.c
+++ b/
storage.c
@@
-16,11
+16,15
@@
tab_t *storage = NULL;
/* storage functions */
/* storage functions */
-
void
memory (int nb)
+
int
memory (int nb)
{
{
- if (
nb != size_tab (storage
)) {
+ if (
(nb != -1) && (nb != size_tab (storage)
)) {
storage = resize_tab (storage, nb);
}
storage = resize_tab (storage, nb);
}
+ if (nb == -1) {
+ memory (DEFAULT_STORAGE_SIZE);
+ }
+ return size_tab (storage);
}
double store (int id, double value)
}
double store (int id, double value)
@@
-69,12
+73,12
@@
void display (void)
memory (DEFAULT_STORAGE_SIZE);
}
int i, n = size_tab (storage);
memory (DEFAULT_STORAGE_SIZE);
}
int i, n = size_tab (storage);
-
fprintf (stdout,
"storage:");
+
printf (
"storage:");
for (i = 0; i < n; i++) {
for (i = 0; i < n; i++) {
-
fprintf (stdout,
" ");
-
fprintf (stdout, minform,
get_tab (storage, i + 1));
+
printf (
" ");
+
printl (
get_tab (storage, i + 1));
}
}
-
fprintf (stdout,
"\n");
+
printf (
"\n");
}
void clear ()
}
void clear ()