Commits

Juri Pakaste committed c896610 Merge

merged feature-sort

  • Participants
  • Parent commits d56688c, 289b1e2

Comments (0)

Files changed (1)

ScalarArray/ScalarArray.h

 
 #import <Foundation/Foundation.h>
 
+typedef int (^ScalarComparisonBlock)(const void *v0, const void *v1);
+
 #define SCALAR_ARRAY_INTERFACE_TYPE(t, ct) \
 typedef void (^ Scalar ## ct ## ArrayEnumerateBlock)(t val); \
 typedef BOOL (^ Scalar ## ct ## ArrayEnumerateUntilBlock)(t val); \
 typedef t (^ Scalar ## ct ## ValueFromObject)(id object); \
 typedef BOOL (^ Scalar ## ct ## TestEqual)(t v0, t v1); \
 typedef NSUInteger (^ Scalar ## ct ## ValueHash)(t value); \
-typedef int (^ Scalar ## ct ## ComparisonBlock)(const void *v0, const void *v1); \
 @interface Scalar ## ct ## Array : NSObject \
 -(void)addValue:(t)val; \
 -(void)addValuesFromArray:(NSArray*)array withBlock:(Scalar ## ct ## ValueFromObject)block; \
 -(void)replaceValueAtIndex:(NSUInteger)index withValue:(t)value; \
 -(void)reverse; \
 -(void)sort; \
--(void)sortWithBlock:(Scalar ## ct ## ComparisonBlock)block; \
+-(void)sortWithBlock:(ScalarComparisonBlock)block; \
 -(t)valueAtIndex:(NSUInteger)index; \
 @end
 
     if (defaultSort != nil) \
         [self sortWithBlock:defaultSort]; \
 } \
--(void)sortWithBlock:(Scalar ## ct ## ComparisonBlock)block { \
+-(void)sortWithBlock:(ScalarComparisonBlock)block { \
     t *bytes = (t*)[data mutableBytes]; \
     qsort_b(bytes, count, sizeof(t), block); \
 } \