diff options
author | Roger Leigh <rleigh@debian.org> | 2011-05-03 10:28:02 +0100 |
---|---|---|
committer | Roger Leigh <rleigh@debian.org> | 2011-05-03 10:28:02 +0100 |
commit | 15578e218035547ca17e25ef351fbe56bc55a4ae (patch) | |
tree | 06a97de2b9f0d9e04ee05d5ff806ef7c53a2003e /src/main/sequence.c | |
parent | 4bc88c4aa9026d5c679008a4dbbb8ec4d9a901bd (diff) |
Imported Upstream version 5.2.7
Diffstat (limited to 'src/main/sequence.c')
-rw-r--r-- | src/main/sequence.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/main/sequence.c b/src/main/sequence.c index 403d89f..b6a8d2e 100644 --- a/src/main/sequence.c +++ b/src/main/sequence.c @@ -1,5 +1,5 @@ /* - * "$Id: sequence.c,v 1.28 2010/08/04 00:33:57 rlk Exp $" + * "$Id: sequence.c,v 1.29 2011/02/17 02:15:18 rlk Exp $" * * Sequence data type. This type is designed to be derived from by * the curve and dither matrix types. @@ -491,6 +491,8 @@ stp_xmltree_create_from_sequence(const stp_sequence_t *seq) /* The sequence */ } +#define isfinite_null(x) (1) + /* "Overloaded" functions */ #define DEFINE_DATA_SETTER(t, name, checkfinite) \ @@ -505,7 +507,7 @@ stp_sequence_set_##name##_data(stp_sequence_t *sequence, \ \ /* Validate the data before we commit to it. */ \ for (i = 0; i < count; i++) \ - if (((checkfinite) && ! isfinite(data[i])) || \ + if ((! checkfinite(data[i])) || \ data[i] < sequence->blo || \ data[i] > sequence->bhi) \ return 0; \ @@ -515,13 +517,13 @@ stp_sequence_set_##name##_data(stp_sequence_t *sequence, \ return 1; \ } -DEFINE_DATA_SETTER(float, float, 1) -DEFINE_DATA_SETTER(long, long, 0) -DEFINE_DATA_SETTER(unsigned long, ulong, 0) -DEFINE_DATA_SETTER(int, int, 0) -DEFINE_DATA_SETTER(unsigned int, uint, 0) -DEFINE_DATA_SETTER(short, short, 0) -DEFINE_DATA_SETTER(unsigned short, ushort, 0) +DEFINE_DATA_SETTER(float, float, isfinite) +DEFINE_DATA_SETTER(long, long, isfinite_null) +DEFINE_DATA_SETTER(unsigned long, ulong, isfinite_null) +DEFINE_DATA_SETTER(int, int, isfinite_null) +DEFINE_DATA_SETTER(unsigned int, uint, isfinite_null) +DEFINE_DATA_SETTER(short, short, isfinite_null) +DEFINE_DATA_SETTER(unsigned short, ushort, isfinite_null) #define DEFINE_DATA_ACCESSOR(t, lb, ub, name) \ const t * \ |