projects
/
pspp-builds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a55d3f2
)
value: New function value_swap.
author
Ben Pfaff
<blp@gnu.org>
Wed, 27 May 2009 06:04:32 +0000
(23:04 -0700)
committer
Ben Pfaff
<blp@gnu.org>
Sun, 7 Jun 2009 04:11:16 +0000
(21:11 -0700)
src/data/value.h
patch
|
blob
|
history
diff --git
a/src/data/value.h
b/src/data/value.h
index a28b1855bb1ee2acc0fae1a28e2660ac9330ab3d..046a9a3aa638a5e69b77bbecca8f8447e30d820b 100644
(file)
--- a/
src/data/value.h
+++ b/
src/data/value.h
@@
-78,6
+78,8
@@
bool value_is_resizable (const union value *, int old_width, int new_width);
bool value_needs_resize (int old_width, int new_width);
void value_resize (union value *, int old_width, int new_width);
bool value_needs_resize (int old_width, int new_width);
void value_resize (union value *, int old_width, int new_width);
+static inline void value_swap (union value *, union value *);
+
struct pool;
void value_init_pool (struct pool *, union value *, int width);
void value_resize_pool (struct pool *, union value *,
struct pool;
void value_init_pool (struct pool *, union value *, int width);
void value_resize_pool (struct pool *, union value *,
@@
-180,4
+182,13
@@
value_copy (union value *dst, const union value *src, int width)
memcpy (dst->long_string, src->long_string, width);
}
memcpy (dst->long_string, src->long_string, width);
}
+/* Exchanges the contents of A and B. */
+static inline void
+value_swap (union value *a, union value *b)
+{
+ union value tmp = *a;
+ *a = *b;
+ *b = tmp;
+}
+
#endif /* data/value.h */
#endif /* data/value.h */