File: reverse.c

package info (click to toggle)
librsl 1.42-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,836 kB
  • sloc: ansic: 16,950; sh: 8,544; yacc: 316; perl: 151; lex: 94; makefile: 61
file content (48 lines) | stat: -rw-r--r-- 1,775 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
    NASA/TRMM, Code 910.1.
    This is the TRMM Office Radar Software Library.
    Copyright (C) 1996, 1997
            John H. Merritt
            Space Applications Corporation
            Vienna, Virginia

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public
    License along with this library; if not, write to the Free
    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "rsl.h"
/*********************************************************************/
/*                                                                   */
/*                      RSL_reverse_sweep_order                      */
/*                                                                   */
/*********************************************************************/
Volume *RSL_reverse_sweep_order(Volume *v)
{
/*
 *  Reverse the order of the sweeps within the volume.
 *  This routine modifies the argument and does not allocate memory.
 */

  int i, j;
  Sweep *s_tmp;

  if (v == NULL) return v;
  /* Yes, the follwing is integer divide by 2. */
  for (i=0, j=v->h.nsweeps-1; i<v->h.nsweeps/2; i++, j--) {
        s_tmp = v->sweep[i];
        v->sweep[i] = v->sweep[j];
        v->sweep[j] = s_tmp;
  }

  return v;
}