Changeset 16045 for trunk/Ohana/src/imregister/imreg/unique.c
- Timestamp:
- Jan 8, 2008, 1:59:09 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/imregister/imreg/unique.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/imregister/imreg/unique.c
r16040 r16045 1 1 # include "imregister.h" 2 2 # include "imreg.h" 3 4 void sortstr (char **S, int *X, int N) { 5 6 # define SWAPFUNC(A,B){ \ 7 char *tmp = S[A]; S[A] = S[B]; S[B] = tmp; \ 8 int itmp = X[A]; X[A] = X[B]; X[B] = itmp; \ 9 } 10 # define COMPARE(A,B)(strcmp(S[A], S[B]) < 0) 11 12 OHANA_SORT (N, COMPARE, SWAPFUNC); 13 14 # undef SWAPFUNC 15 # undef COMPARE 16 17 } 3 18 4 19 /* input is a subset index of image list, output is a new subset */ … … 63 78 return (match); 64 79 } 65 66 void sortstr (char **S, int *X, int N) {67 68 # define SWAPFUNC(A,B){ \69 char *tmp = S[A]; S[A] = S[B]; S[B] = tmp; \70 int itmp = X[A]; X[A] = X[B]; X[B] = itmp; \71 }72 # define COMPARE(A,B)(strcmp(S[A], S[B]) < 0)73 74 OHANA_SORT (N, COMPARE, SWAPFUNC);75 76 # undef SWAPFUNC77 # undef COMPARE78 79 }
Note:
See TracChangeset
for help on using the changeset viewer.
