@@ -43,35 +43,35 @@ CELL *cell, *mask;
4343double * rowlook , * collook , * lat_diff , /* distances between latitudes */
4444 ew2 ;
4545
46- short ll ; /* TRUE if latitude-longitude projection */
46+ int ll ; /* TRUE if latitude-longitude projection */
4747
4848/* function pointers for LL function substitutes */
4949
50- int first_west (EW * , SHORT );
51- int first_west_LL (EW * , SHORT );
52- int (* init_row_search )(EW * , SHORT ); /* function pointer */
50+ int first_west (EW * , int );
51+ int first_west_LL (EW * , int );
52+ int (* init_row_search )(EW * , int ); /* function pointer */
5353
5454int completed_row (EW * );
5555int completed_row_LL (EW * );
5656
5757/* function pointer */
5858int (* comp_row_search )(EW * );
5959
60- int find_neighbors (EW * , NEIGHBOR * , SHORT , SHORT , int , SHORT * );
61- int find_neighbors_LL (EW * , NEIGHBOR * , SHORT , SHORT , int , SHORT * );
60+ int find_neighbors (EW * , NEIGHBOR * , int , int , int , int * );
61+ int find_neighbors_LL (EW * , NEIGHBOR * , int , int , int , int * );
6262
6363/* function pointer */
64- int (* locate_neighbors )(EW * , NEIGHBOR * , SHORT , SHORT , int , SHORT * );
64+ int (* locate_neighbors )(EW * , NEIGHBOR * , int , int , int , int * );
6565
66- int exhaust_search (EW * , NEIGHBOR * , SHORT , SHORT );
67- int exhaust_search_LL (EW * , NEIGHBOR * , SHORT , SHORT );
66+ int exhaust_search (EW * , NEIGHBOR * , int , int );
67+ int exhaust_search_LL (EW * , NEIGHBOR * , int , int );
6868
6969/* function pointer */
70- int (* exhaust_row )(EW * , NEIGHBOR * , SHORT , SHORT );
70+ int (* exhaust_row )(EW * , NEIGHBOR * , int , int );
7171
72- double offset_distance (SHORT );
73- double offset_distance_LL (SHORT );
74- double (* check_offset )(SHORT ); /* function pointer */
72+ double offset_distance (int );
73+ double offset_distance_LL (int );
74+ double (* check_offset )(int ); /* function pointer */
7575
7676static int error_flag = 0 ;
7777static char * input ;
@@ -80,8 +80,8 @@ static char *output;
8080int main (int argc , char * * argv )
8181{
8282 MELEMENT * rowlist ;
83- SHORT nrows , ncols ;
84- SHORT datarows ;
83+ int nrows , ncols ;
84+ int datarows ;
8585 int npoints ;
8686 struct GModule * module ;
8787 struct History history ;
@@ -199,7 +199,7 @@ int main(int argc, char **argv)
199199/* calculations depends on the projection type; function */
200200/* pointers are set dependent on projection type */
201201
202- int lookup_and_function_ptrs (SHORT nrows , SHORT ncols )
202+ int lookup_and_function_ptrs (int nrows , int ncols )
203203{
204204 double a , e2 ; /* used to control geodetic distance calculations */
205205
@@ -232,15 +232,15 @@ int lookup_and_function_ptrs(SHORT nrows, SHORT ncols)
232232/* a matrix by interpolating from a given set of */
233233/* irregularly spaced data points */
234234
235- int interpolate (MELEMENT rowlist [], SHORT nrows , SHORT ncols , SHORT datarows ,
235+ int interpolate (MELEMENT rowlist [], int nrows , int ncols , int datarows ,
236236 int npoints , int out_fd , int maskfd )
237237{
238238 extern CELL * cell ;
239239
240240 MELEMENT * Rptr ;
241241 EW * search , * ewptr , * current_row , /* start row for north/south search */
242242 * lastrow ; /* last element in search array */
243- SHORT row , col ;
243+ int row , col ;
244244 NEIGHBOR * nbr_head , * Nptr ;
245245 double sum1 , sum2 ;
246246
@@ -325,13 +325,13 @@ int interpolate(MELEMENT rowlist[], SHORT nrows, SHORT ncols, SHORT datarows,
325325/* to be interpolated using data value of its neighbors */
326326
327327int make_neighbors_list (
328- EW * firstrow , EW * lastrow , EW * curr_row , SHORT row , SHORT col ,
328+ EW * firstrow , EW * lastrow , EW * curr_row , int row , int col ,
329329 NEIGHBOR * head , /* head points to dummy plus npoints neighbors */
330330 int npoints )
331331{
332332 extern CELL * cell ;
333333
334- SHORT neighbors = 0 , /* number of neighbors in current list */
334+ int neighbors = 0 , /* number of neighbors in current list */
335335 nsearch = 1 , ssearch = 1 ; /* expand search north and south */
336336 EW * north , * south ;
337337
@@ -393,11 +393,11 @@ int make_neighbors_list(
393393/******* END OF FUNCTION "MAKE_NEIGHBORS_LIST" ******************/
394394
395395int search (EW * * ewptr , /* double-indirection !! */
396- NEIGHBOR * head , SHORT row , SHORT col , int npoints , SHORT * neighbors ,
397- EW * boundary , SHORT south /* search proceeds southward if == 1 */
396+ NEIGHBOR * head , int row , int col , int npoints , int * neighbors ,
397+ EW * boundary , int south /* search proceeds southward if == 1 */
398398)
399399{
400- SHORT new = 0 ; /* no prior search in first row in list */
400+ int new = 0 ; /* no prior search in first row in list */
401401 EW * current , * prior ;
402402
403403 /* reset ewptr if row it points to has been thoroughly searched */
@@ -442,7 +442,7 @@ int search(EW **ewptr, /* double-indirection !! */
442442}
443443
444444int exhaust (EW * * ewptr , /* double-indirection !! */
445- NEIGHBOR * head , SHORT row , SHORT col )
445+ NEIGHBOR * head , int row , int col )
446446{
447447 EW * current ;
448448
@@ -469,7 +469,7 @@ int exhaust(EW **ewptr, /* double-indirection !! */
469469 return 0 ;
470470}
471471
472- double offset_distance (SHORT offset )
472+ double offset_distance (int offset )
473473{
474474 return (offset * offset ); /* compare squared distances in this case */
475475}
@@ -483,8 +483,8 @@ int completed_row(EW *ewptr)
483483}
484484
485485EW * next_row (EW * ewptr ,
486- EW * boundary , /* row boundary of map in search direction */
487- SHORT * new , SHORT south /* search proceeds southward if == 1 */
486+ EW * boundary , /* row boundary of map in search direction */
487+ int * new , int south /* search proceeds southward if == 1 */
488488)
489489{
490490 if (ewptr -> next )
@@ -505,7 +505,7 @@ EW *next_row(EW *ewptr,
505505/* by locating the two data closest to the specified column in */
506506/* a linked list of row data */
507507
508- int first_west (EW * ewptr , SHORT col )
508+ int first_west (EW * ewptr , int col )
509509{
510510 if (ewptr -> start == NULL ) { /* no data in this row */
511511 ewptr -> west = ewptr -> east = NULL ;
@@ -525,8 +525,8 @@ int first_west(EW *ewptr, SHORT col)
525525/* This function evaluates nearest neighbor status for a given */
526526/* datum and resets the row search pointer based on the result */
527527
528- int find_neighbors (EW * ewptr , NEIGHBOR * nbr_head , SHORT row , SHORT col ,
529- int npoints , SHORT * neighbors )
528+ int find_neighbors (EW * ewptr , NEIGHBOR * nbr_head , int row , int col , int npoints ,
529+ int * neighbors )
530530{
531531 MELEMENT * * Mptr ; /* double indirection !! */
532532 int westward = 1 ; /* 1 if west of interpolation point */
@@ -559,7 +559,7 @@ int find_neighbors(EW *ewptr, NEIGHBOR *nbr_head, SHORT row, SHORT col,
559559/* This function exhausts all possible nearest neighhbors */
560560/* within the row indexed by the ew search pointer */
561561
562- int exhaust_search (EW * ewptr , NEIGHBOR * nbr_head , SHORT row , SHORT col )
562+ int exhaust_search (EW * ewptr , NEIGHBOR * nbr_head , int row , int col )
563563{
564564 double distance ;
565565
@@ -586,7 +586,7 @@ int exhaust_search(EW *ewptr, NEIGHBOR *nbr_head, SHORT row, SHORT col)
586586/************************************************************************/
587587/* triangulate returns the square of the hypoteneuse */
588588
589- double triangulate (MELEMENT * Mptr , SHORT row , SHORT col )
589+ double triangulate (MELEMENT * Mptr , int row , int col )
590590{
591591 extern double * rowlook , * collook ;
592592 int rowoff , coloff ;
@@ -653,7 +653,7 @@ int sort_neighbors(NEIGHBOR *nbr_head, double distance)
653653}
654654
655655int free_row_lists (/* frees indexed row lists of data */
656- MELEMENT * rowlist , SHORT nrows )
656+ MELEMENT * rowlist , int nrows )
657657{
658658 int i ;
659659 MELEMENT * Mptr , * prev ;
@@ -674,11 +674,11 @@ int free_row_lists(/* frees indexed row lists of data */
674674MELEMENT * row_lists (
675675 /* Search and make array-indexed doubly-linked lists of original data points
676676 */
677- SHORT rows , SHORT cols , /* total rows and columns in window */
678- SHORT * datarows , /* number of rows with non-zero input data */
679- int * npts , /* number of data points available */
680- int fd , /* file descriptor, input */
681- CELL * cell /* array of data for a single row */
677+ int rows , int cols , /* total rows and columns in window */
678+ int * datarows , /* number of rows with non-zero input data */
679+ int * npts , /* number of data points available */
680+ int fd , /* file descriptor, input */
681+ CELL * cell /* array of data for a single row */
682682)
683683{
684684 int row , col ; /* row and column indices */
@@ -737,7 +737,7 @@ MELEMENT *row_lists(
737737/* Lookup tables containing distance squared (in units of ns.res) */
738738/* are created for later use in selecting nearest neighbors */
739739
740- int lookup_tables (SHORT nrows , SHORT ncols )
740+ int lookup_tables (int nrows , int ncols )
741741{
742742 extern double * rowlook , * collook , ew2 ;
743743 extern struct Cell_head window ;
0 commit comments