Fix compiler warnings/errors

This commit is contained in:
Shahram Najm 2016-07-09 12:37:29 +01:00
parent 55427dfc18
commit e54185a501
2 changed files with 6 additions and 7 deletions

View File

@ -155,7 +155,6 @@ static char* cast_char(char* buf, char* fortstr,int len)
static char* cast_char_no_cut(char* buf, char* fortstr,int len)
{
char *p,*end;
if (len == 0 || fortstr == NULL) return NULL;
memcpy(buf,fortstr,len);
buf[len]='\0';
@ -2775,7 +2774,7 @@ int grib_f_set_string_array_(int* gid, char* key, char* val,int* nvals,int* slen
cast_char_no_cut(cval[i],p,*slen);
p+= *slen;
}
err = grib_set_string_array(h, cast_char(buf,key,len), cval, lsize);
err = grib_set_string_array(h, cast_char(buf,key,len), (const char **)cval, lsize);
if (err) return err;
for (i=0;i<lsize;i++) {

View File

@ -219,7 +219,7 @@ static void dump_values(grib_dumper* d,grib_accessor* a)
if (size>1) {
fprintf(self->dumper.out," if(allocated(rvalues)) deallocate(rvalues)\n");
fprintf(self->dumper.out," allocate(rvalues(%d))\n",size);
fprintf(self->dumper.out," allocate(rvalues(%ld))\n",size);
fprintf(self->dumper.out," rvalues=(/");
@ -297,7 +297,7 @@ static void dump_long(grib_dumper* d,grib_accessor* a,const char* comment)
if (size>1) {
fprintf(self->dumper.out," if(allocated(ivalues)) deallocate(ivalues)\n");
fprintf(self->dumper.out," allocate(ivalues(%d))\n",size);
fprintf(self->dumper.out," allocate(ivalues(%ld))\n",size);
fprintf(self->dumper.out," ivalues=(/");
@ -398,7 +398,7 @@ static void dump_string_array(grib_dumper* d,grib_accessor* a,const char* commen
}
fprintf(self->dumper.out," if(allocated(svalues)) deallocate(svalues)\n");
fprintf(self->dumper.out," allocate(svalues(%d))\n",size);
fprintf(self->dumper.out," allocate(svalues(%ld))\n",size);
fprintf(self->dumper.out," svalues=(/");
@ -507,9 +507,9 @@ static void _dump_long_array(grib_handle* h,FILE* f,const char* key,const char*
if (grib_get_size(h,key,&size)==GRIB_NOT_FOUND) return;
fprintf(f," if(allocated(ivalues)) deallocate(ivalues)\n");
fprintf(f," allocate(ivalues(%d))\n",size);
fprintf(f," allocate(ivalues(%ld))\n",size);
fprintf(f," ivalues=(/ ",print_key);
fprintf(f," ivalues=(/ %s",print_key);
val=grib_context_malloc_clear(h->context,sizeof(long)*size);
grib_get_long_array(h,key,val,&size);