projects
/
rrq
/
rrqmisc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add Tuple_calloc
[rrq/rrqmisc.git]
/
vector
/
Tuple.c
diff --git
a/vector/Tuple.c
b/vector/Tuple.c
index 06eba85778e4e654623aa1c0ca869af9c2e6b84a..e5341bd1a807a1ae298630b4d5e964d28e39139b 100644
(file)
--- a/
vector/Tuple.c
+++ b/
vector/Tuple.c
@@
-3,6
+3,13
@@
#include <string.h>
#include <Tuple.h>
#include <string.h>
#include <Tuple.h>
+Tuple *Tuple_calloc(int arity) {
+ Tuple *t = (Tuple *) malloc( sizeof( Tuple ) + arity * sizeof( void* ) );
+ t->types = 0;
+ memset( t->elements, 0, arity * sizeof( void* ) );
+ return t;
+}
+
// Allocate
Tuple *Tuple_create(int arity,...) {
va_list ap;
// Allocate
Tuple *Tuple_create(int arity,...) {
va_list ap;
@@
-23,6
+30,7
@@
Tuple *Tuple_clone(int arity,Tuple *t) {
return ct;
}
return ct;
}
+#if 0
unsigned long Tuple_mask(int arity,Tuple *t) {
unsigned long mask = 0;
while ( arity-- > 0 ) {
unsigned long Tuple_mask(int arity,Tuple *t) {
unsigned long mask = 0;
while ( arity-- > 0 ) {
@@
-33,3
+41,4
@@
unsigned long Tuple_mask(int arity,Tuple *t) {
}
return mask;
}
}
return mask;
}
+#endif