diff options
| author | Frank Warmerdam <warmerdam@pobox.com> | 2003-03-19 03:36:41 +0000 |
|---|---|---|
| committer | Frank Warmerdam <warmerdam@pobox.com> | 2003-03-19 03:36:41 +0000 |
| commit | ee42eae04ff1fd7134df74a149c87322820482cb (patch) | |
| tree | 1cc17ea088de7f9c910c0282f5ee915b7b195065 /src | |
| parent | 780153502fcaa6048ee210b9353ea97486102af9 (diff) | |
| download | PROJ-ee42eae04ff1fd7134df74a149c87322820482cb.tar.gz PROJ-ee42eae04ff1fd7134df74a149c87322820482cb.zip | |
Fixed so swap_words() works when it should.
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1113 4e78687f-474d-0410-85f9-8d5e500ac6b2
Diffstat (limited to 'src')
| -rw-r--r-- | src/pj_gridinfo.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/src/pj_gridinfo.c b/src/pj_gridinfo.c index 989b264b..2a6c5221 100644 --- a/src/pj_gridinfo.c +++ b/src/pj_gridinfo.c @@ -29,6 +29,9 @@ ****************************************************************************** * * $Log$ + * Revision 1.4 2003/03/19 03:36:41 warmerda + * Fixed so swap_words() works when it should. + * * Revision 1.3 2003/03/17 19:44:45 warmerda * improved debugging, reduce header read size * @@ -60,28 +63,22 @@ static int byte_order_test = 1; static void swap_words( unsigned char *data, int word_size, int word_count ) { - /* We only need to do work on LSB machines. Perhaps we should - convert the data files into LSB order to cut workload! */ + int word; - if( IS_LSB ) + for( word = 0; word < word_count; word++ ) { - int word; - - for( word = 0; word < word_count; word++ ) + int i; + + for( i = 0; i < word_size/2; i++ ) { - int i; - - for( i = 0; i < word_size/2; i++ ) - { - int t; - - t = data[i]; - data[i] = data[word_size-i-1]; - data[word_size-i-1] = t; - } - - data += word_size; + int t; + + t = data[i]; + data[i] = data[word_size-i-1]; + data[word_size-i-1] = t; } + + data += word_size; } } |
