Fix build break on Windows due to name _expand

This commit is contained in:
Shahram Najm 2015-11-23 11:28:48 +00:00
parent b59e8f8b39
commit 982becb85e
3 changed files with 523 additions and 516 deletions

View File

@ -11,7 +11,7 @@
/* Sequences and replication (not delayed) are resolved in this class.
Number of elements to which a delayed replication applies are recomputed to
take account of the expansion.
expanded descriptors cannot contain sequences and only delayed replication
Expanded descriptors cannot contain sequences and only delayed replication
can appear
*/
@ -158,7 +158,8 @@ static void dump(grib_accessor* a, grib_dumper* dumper)
grib_dump_string_array(dumper,a,NULL);
}
static grib_accessor* get_accessor(grib_accessor* a) {
static grib_accessor* get_accessor(grib_accessor* a)
{
grib_accessor_bufr_string_values* self = (grib_accessor_bufr_string_values*)a;
if (!self->dataAccessor) {
self->dataAccessor=grib_find_accessor(grib_handle_of_accessor(a),self->dataAccessorName);
@ -200,7 +201,8 @@ static int unpack_string_array (grib_accessor* a, char** buffer, size_t *len)
return GRIB_SUCCESS;
}
static int pack_string_array(grib_accessor*a , const char** v, size_t *len){
static int pack_string_array(grib_accessor*a , const char** v, size_t *len)
{
return GRIB_NOT_IMPLEMENTED;
}
@ -221,5 +223,6 @@ static int value_count(grib_accessor* a,long* rlen)
return grib_value_count(descriptors,rlen);
}
static void destroy(grib_context* c,grib_accessor* a) {
static void destroy(grib_context* c,grib_accessor* a)
{
}

View File

@ -11,7 +11,7 @@
/* Sequences and replication (not delayed) are resolved in this class.
Number of elements to which a delayed replication applies are recomputed to
take account of the expansion.
expanded descriptors cannot contain sequences and only delayed replication
Expanded descriptors cannot contain sequences and only delayed replication
can appear
*/
@ -158,7 +158,8 @@ static void dump(grib_accessor* a, grib_dumper* dumper)
grib_dump_long(dumper,a,NULL);
}
static grib_accessor* get_accessor(grib_accessor* a) {
static grib_accessor* get_accessor(grib_accessor* a)
{
grib_accessor_bufrdc_expanded_descriptors* self = (grib_accessor_bufrdc_expanded_descriptors*)a;
if (!self->expandedDescriptorsAccessor) {
self->expandedDescriptorsAccessor=grib_find_accessor(grib_handle_of_accessor(a),self->expandedDescriptors);
@ -221,7 +222,6 @@ static int unpack_string_array (grib_accessor* a, char** buffer, size_t *len)
return GRIB_SUCCESS;
}
static int value_count(grib_accessor* a,long* rlen)
{
grib_accessor* descriptors=get_accessor(a);
@ -229,5 +229,6 @@ static int value_count(grib_accessor* a,long* rlen)
return grib_value_count(descriptors,rlen);
}
static void destroy(grib_context* c,grib_accessor* a) {
static void destroy(grib_context* c,grib_accessor* a)
{
}

View File

@ -11,7 +11,7 @@
/* Sequences and replication (not delayed) are resolved in this class.
Number of elements to which a delayed replication applies are recomputed to
take account of the expansion.
expanded descriptors cannot contain sequences and only delayed replication
Expanded descriptors cannot contain sequences and only delayed replication
can appear
*/
@ -192,12 +192,13 @@ static void dump(grib_accessor* a, grib_dumper* dumper)
grib_dump_long(dumper,a,NULL);
}
static bufr_descriptors_array* _expand(grib_accessor* a,bufr_descriptors_array* unexpanded,change_coding_params* ccp,int *err);
static bufr_descriptors_array* do_expand(grib_accessor* a,bufr_descriptors_array* unexpanded,change_coding_params* ccp,int *err);
static int depth=-1;
static size_t __expand(grib_accessor* a, bufr_descriptors_array* unexpanded, bufr_descriptors_array* expanded,
change_coding_params* ccp,int* err) {
change_coding_params* ccp, int* err)
{
int k,j,i;
grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a;
size_t size=0;
@ -248,7 +249,7 @@ static size_t __expand(grib_accessor* a,bufr_descriptors_array* unexpanded,bufr_
inner_unexpanded=grib_bufr_descriptors_array_push(inner_unexpanded,vv);
}
grib_context_free(c,v);
inner_expanded=_expand(a,inner_unexpanded,ccp,err);
inner_expanded=do_expand(a,inner_unexpanded,ccp,err);
grib_bufr_descriptors_array_delete(inner_unexpanded);
#if MYDEBUG
for (i=0;i<inner_expanded->n;i++) {
@ -284,7 +285,7 @@ static size_t __expand(grib_accessor* a,bufr_descriptors_array* unexpanded,bufr_
printf("+++ pop %06ld\n",u0->code);
#endif
}
inner_expanded=_expand(a,inner_unexpanded,ccp,err);
inner_expanded=do_expand(a,inner_unexpanded,ccp,err);
size=grib_bufr_descriptors_array_used_size(inner_expanded);
#if MYDEBUG
for (i=0;i<inner_expanded->n;i++) {
@ -325,7 +326,7 @@ static size_t __expand(grib_accessor* a,bufr_descriptors_array* unexpanded,bufr_
}
for (i=0;i<us->X;i++) grib_bufr_descriptor_delete(ur[i]);
grib_context_free(c,ur);
inner_expanded=_expand(a,inner_unexpanded,ccp,err);
inner_expanded=do_expand(a,inner_unexpanded,ccp,err);
grib_bufr_descriptors_array_delete(inner_unexpanded);
#if MYDEBUG
for (i=0;i<inner_expanded->n;i++) {
@ -457,7 +458,7 @@ static size_t __expand(grib_accessor* a,bufr_descriptors_array* unexpanded,bufr_
return size;
}
static bufr_descriptors_array* _expand(grib_accessor* a,bufr_descriptors_array* unexpanded,change_coding_params* ccp,int *err)
bufr_descriptors_array* do_expand(grib_accessor* a,bufr_descriptors_array* unexpanded,change_coding_params* ccp,int *err)
{
bufr_descriptors_array* expanded=NULL;
grib_context* c=a->context;
@ -555,26 +556,29 @@ static int expand(grib_accessor* a)
ccp.referenceFactor=1;
ccp.associatedFieldWidth=0;
ccp.newStringWidth=0;
self->expanded=_expand(a,unexpanded,&ccp,&err);
self->expanded=do_expand(a,unexpanded,&ccp,&err);
grib_bufr_descriptors_array_delete(unexpanded);
return err;
}
int grib_accessor_class_expanded_descriptors_set_do_expand(grib_accessor* a,long do_expand) {
int grib_accessor_class_expanded_descriptors_set_do_expand(grib_accessor* a,long do_expand)
{
grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a;
self->do_expand=do_expand;
return 0;
}
bufr_descriptors_array* grib_accessor_class_expanded_descriptors_get_expanded(grib_accessor* a,int* err) {
bufr_descriptors_array* grib_accessor_class_expanded_descriptors_get_expanded(grib_accessor* a,int* err)
{
grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a;
*err=expand(a);
return self->expanded;
}
static int unpack_double (grib_accessor* a, double* val, size_t *len) {
static int unpack_double (grib_accessor* a, double* val, size_t *len)
{
grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a;
int ret=0;
int i;
@ -652,7 +656,6 @@ static int pack_long (grib_accessor* a, const long* val, size_t *len)
return GRIB_NOT_IMPLEMENTED;
}
static int value_count(grib_accessor* a,long* rlen)
{
grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a;
@ -670,7 +673,8 @@ static int value_count(grib_accessor* a,long* rlen)
return ret;
}
static void destroy(grib_context* c,grib_accessor* a) {
static void destroy(grib_context* c,grib_accessor* a)
{
grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a;
if (self->rank==0 && self->expanded) {
grib_bufr_descriptors_array_delete(self->expanded);
@ -683,4 +687,3 @@ static int get_native_type(grib_accessor* a)
if (self->rank==2) return GRIB_TYPE_DOUBLE;
else return GRIB_TYPE_LONG;
}