Skip to content

Commit

Permalink
Fixed compiler warnings
Browse files Browse the repository at this point in the history
Removed unused variables & initialize some vars to 0.
  • Loading branch information
Tim van Werkhoven committed Aug 1, 2011
1 parent 25b4b65 commit f6ba79f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
40 changes: 20 additions & 20 deletions src/anacompress.c
Expand Up @@ -13,12 +13,12 @@ int anacrunchrun8(uint8_t *x,uint8_t *array,int slice,int nx,int ny,int limit,in
uint8_t bits[8]={1,2,4,8,16,32,64,128};
struct compresshead *ch;
uint8_t *p;
unsigned nb,ixa,ixb;
unsigned nb;
unsigned register i,j,r1;
int r0,r2,r3,r4,mask,fac, ii, nrun, lrun, ic;
int *dif, *d, nc, zq, yq, test, *dd;
int i2,k,ix,iy;
unsigned char xq;
int r0,r2,r3,mask,fac, nrun, lrun, ic;
int *dif, *d, nc, zq, yq, *dd;
int i2,k,iy;

union { int i; short w; unsigned char b[4]; } y;
/* begin execution */
if (limit<25) { printf("limit (%d) too small in crunchrun8\n", limit); return -1;}
Expand Down Expand Up @@ -187,12 +187,12 @@ int anacrunch8(uint8_t *x,uint8_t *array,int slice,int nx,int ny,int limit,int t
{
uint8_t bits[8]={1,2,4,8,16,32,64,128};
struct compresshead *ch;
short iq;

unsigned nb,ixa,ixb;
unsigned register i,j,r1,in;
int r0,r2,r3,mask,fac;
int i2,k,ix,iy;
unsigned char xq;
int i2,k,iy;

union { int i; short w; unsigned char b[4]; } y;
/* begin execution */
if (limit<25) { printf("limit (%d) too small in crunch8\n", limit); return -1;}
Expand Down Expand Up @@ -289,14 +289,14 @@ int anacrunchrun(uint8_t *x,int16_t *array,int slice,int nx,int ny,int limit,int
{
uint8_t bits[8]={1,2,4,8,16,32,64,128};
struct compresshead *ch;
short iq, *p;
unsigned nb,ixa,ixb;
short *p;
unsigned nb;
unsigned register i,j,r1;
int r0,r2,r3,r4,mask,fac, ii, nrun, lrun, ic;
int *dif, *d, nc, zq, yq, test, *dd;
enum {RUN, LITERAL } state;
int i2,k,ix,iy;
unsigned char xq;
int r0,r2,r3,mask,fac, nrun, lrun, ic;
int *dif, *d, nc, zq, yq, *dd;

int i2,k,iy;

union { int i; short w; unsigned char b[4]; } y;
/* begin execution */
if (limit<25) { printf("limit (%d) too small in crunchrun\n", limit); return -1;}
Expand Down Expand Up @@ -469,7 +469,7 @@ int anacrunch(uint8_t *x,int16_t *array,int slice,int nx,int ny,int limit,int t_
uint8_t bits[8]={1,2,4,8,16,32,64,128};
unsigned register i,j,r1,in;
int r0,r2,r3,mask,fac;
unsigned char xq;

union{
int i;
short w;
Expand Down Expand Up @@ -614,13 +614,13 @@ int anacrunch32(uint8_t *x,int32_t *array,int slice,int nx,int ny,int limit,int
{
uint8_t bits[8]={1,2,4,8,16,32,64,128};
struct compresshead *ch;
short iq;

unsigned int nb,ixa,ixb,big=0;
unsigned register i,j,r1,in;
int r0,r2,r4,fac;
int r0,r2,fac;
long long r3, mask, y64;
int i2,k,ix,iy;
unsigned char xq;
int i2,k,iy;

union { int i; short w; unsigned char b[4]; } y;
union { long long l64; unsigned char b[8]; } yy;
/* begin execution */
Expand Down
10 changes: 5 additions & 5 deletions src/anadecompress.c
Expand Up @@ -11,7 +11,7 @@ int anadecrunch32(unsigned char *x,int32_t *array,int r9,int nx,int ny,int littl
bit slice size r9 */
{
int iq;
int r0,r1,r2,r4,nb;
int r0=0,r1,r2,nb;
int j,in,i,k,ix,iy, mask;
long long y64;
unsigned char xq;
Expand Down Expand Up @@ -130,7 +130,7 @@ int anadecrunch(unsigned char *x,int16_t *array,int r9,int nx,int ny,int little_
bit slice size r9 */
{
short iq;
int r0,r1,r2,r4,nb,mask;
int r0=0,r1,r2,r4,nb,mask;
int j,in,i,k,ix,iy;
unsigned char xq;
union {
Expand Down Expand Up @@ -297,7 +297,7 @@ int anadecrunch8(unsigned char *x,int8_t *array,int r9,int nx,int ny,int little_
bit slice size r9 */
{
uint8_t iq;
int r0,r1,r2,r4,nb,mask;
int r0=0,r1,r2,r4,nb,mask;
int j,in,i,k,ix,iy;
uint8_t xq;
union { int i; short w; unsigned char b[4]; } y;
Expand Down Expand Up @@ -394,7 +394,7 @@ int anadecrunchrun(unsigned char *x,int16_t *array,int r9,int nx,int ny,int litt
/* this version handles the run length encoding used in anacrunchrun */
{
short iq;
int r0,r1,r2,r3,r4,nb,mask,nrun,n,nc;
int r0=0,r1,r2,r4,nb,mask,nrun,n,nc;
int j,in,i,k,iy;
unsigned char xq;
union { int i; short w; unsigned char b[4]; } y;
Expand Down Expand Up @@ -536,7 +536,7 @@ int anadecrunchrun8(unsigned char *x,int8_t *array,int r9,int nx,int ny,int litt
/* this version handles the run length encoding used in anacrunchrun */
{
uint8_t iq;
int r0,r1,r2,r3,r4,nb,mask,nrun,n,nc;
int r0=0,r1,r2,r4,nb,mask,nrun,n,nc;
int j,in,i,k,iy;
unsigned char xq;
union { int i; short w; unsigned char b[4]; } y;
Expand Down
4 changes: 2 additions & 2 deletions src/anarw.c
Expand Up @@ -246,8 +246,8 @@ void ana_fzwrite(uint8_t *data,char *file_name,int *ds,int nd,char *header,int t
//
int n_elem=1,n;
for(n=0;n<nd;++n) n_elem*=(fh.dim[n]=ds[n]);
int nx=fh.dim[0];
int ny=n_elem/nx;


int type_sizes[]=ANA_VAR_SZ;
int size=n_elem*type_sizes[type];
if(t_endian){ // big endian platform
Expand Down

0 comments on commit f6ba79f

Please sign in to comment.