summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/kit/lower_bound.h52
1 files changed, 26 insertions, 26 deletions
diff --git a/source/kit/lower_bound.h b/source/kit/lower_bound.h
index 5b04557..fee1648 100644
--- a/source/kit/lower_bound.h
+++ b/source/kit/lower_bound.h
@@ -5,34 +5,34 @@
extern "C" {
#endif
-#define KIT_LOWER_BOUND(return_val, array, value, op) \
- { \
- ptrdiff_t position_ = 0; \
- ptrdiff_t count_ = (array).size; \
- while (count_ > 0) { \
- ptrdiff_t delta_ = count_ / 2; \
- if (op((array).values[position_ + delta_], (value))) { \
- position_ += delta_ + 1; \
- count_ -= delta_ + 1; \
- } else \
- count_ = delta_; \
- } \
- (return_val) = position_; \
+#define KIT_LOWER_BOUND(return_val, array, value, op) \
+ { \
+ ptrdiff_t position_ = 0; \
+ ptrdiff_t count_ = (array).size; \
+ while (count_ > 0) { \
+ ptrdiff_t delta_ = count_ / 2; \
+ if ((op) ((array).values[position_ + delta_], (value))) { \
+ position_ += delta_ + 1; \
+ count_ -= delta_ + 1; \
+ } else \
+ count_ = delta_; \
+ } \
+ (return_val) = position_; \
}
-#define KIT_LOWER_BOUND_REF(return_val, array, value, op) \
- { \
- ptrdiff_t position_ = 0; \
- ptrdiff_t count_ = (array).size; \
- while (count_ > 0) { \
- ptrdiff_t delta_ = count_ / 2; \
- if (op((array).values + position_ + delta_, &(value))) { \
- position_ += delta_ + 1; \
- count_ -= delta_ + 1; \
- } else \
- count_ = delta_; \
- } \
- (return_val) = position_; \
+#define KIT_LOWER_BOUND_REF(return_val, array, value, op) \
+ { \
+ ptrdiff_t position_ = 0; \
+ ptrdiff_t count_ = (array).size; \
+ while (count_ > 0) { \
+ ptrdiff_t delta_ = count_ / 2; \
+ if ((op) ((array).values + position_ + delta_, &(value))) { \
+ position_ += delta_ + 1; \
+ count_ -= delta_ + 1; \
+ } else \
+ count_ = delta_; \
+ } \
+ (return_val) = position_; \
}
#ifdef __cplusplus