diff options
author | Hugo Hörnquist <hugo@hornquist.se> | 2019-02-11 01:34:40 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-02-15 20:03:43 +0100 |
commit | 60c7d789ce21cb77bdf9dd2c8cb22e86232d903f (patch) | |
tree | 45a2995340c1f2c2891369eb3ec5e2c6aae7b87c /pair.inc.h | |
parent | Replace key_val type with templatized PAIR(T, V). (diff) | |
download | calp-60c7d789ce21cb77bdf9dd2c8cb22e86232d903f.tar.gz calp-60c7d789ce21cb77bdf9dd2c8cb22e86232d903f.tar.xz |
Rewrote content_line, and how parameters are stored.
Diffstat (limited to '')
-rw-r--r-- | pair.inc.h | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -3,30 +3,31 @@ #else INIT_F(PAIR(T, V)) { - INIT(T, &this->left); - INIT(V, &this->right); + INIT(T, &this->key); + INIT(V, &this->val); return 0; } FREE_F(PAIR(T, V)) { - FREE(T)(&this->left); - FREE(V)(&this->right); + FREE(T)(&this->key); + FREE(V)(&this->val); + return 0; } FMT_F(PAIR(T, V)) { - char lbuf[100]; - char rbuf[100]; - FMT(T)(&this->left, lbuf); - FMT(V)(&this->right, rbuf); + char lbuf[0x100]; + char rbuf[0x1000]; + FMT(T)(&this->key, lbuf); + FMT(V)(&this->val, rbuf); return sprintf(buf, "<%s, %s>", lbuf, rbuf); } int DEEP_COPY(PAIR(T, V)) (PAIR(T, V)* dest, PAIR(T, V)* src) { - DEEP_COPY(T)(&dest->left, &src->left); - DEEP_COPY(V)(&dest->right, &src->right); + DEEP_COPY(T)(&dest->key, &src->key); + DEEP_COPY(V)(&dest->val, &src->val); return 0; } |