IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16045


Ignore:
Timestamp:
Jan 8, 2008, 1:59:09 PM (18 years ago)
Author:
eugene
Message:

converted sortstr to new macro version; moved into unique.c

Location:
trunk/Ohana/src/imregister
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/imregister/imreg/unique.c

    r16040 r16045  
    11# include "imregister.h"
    22# include "imreg.h"
     3
     4void 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}
    318
    419/* input is a subset index of image list, output is a new subset */
     
    6378  return (match);
    6479}
    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 SWAPFUNC
    77 # undef COMPARE
    78 
    79 }
  • trunk/Ohana/src/imregister/spreg/unique.c

    r3491 r16045  
    11# include "imregister.h"
    22# include "spreg.h"
     3
     4void 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}
    318
    419/* input is a subset index of spectrum list, output is a new subset */
     
    5570  return (match);
    5671}
    57 
Note: See TracChangeset for help on using the changeset viewer.