This commit is contained in:
Shahram Najm 2016-08-31 09:59:21 +01:00
parent 98c83ee52c
commit 4a5d65dadc
6 changed files with 31 additions and 29 deletions

View File

@ -78,6 +78,7 @@ int grib_is_missing_internal(grib_accessor* a)
Assert(0);
return 0;
}
int grib_pack_double(grib_accessor* a, const double* v, size_t *len )
{
grib_accessor_class *c = a->cclass;
@ -662,7 +663,7 @@ int grib_accessor_clear_attributes(grib_accessor* a)
}
return 0;
}
*/
*/
int grib_accessor_add_attribute(grib_accessor* a,grib_accessor* attr,int nest_if_clash)
{
@ -674,8 +675,8 @@ int grib_accessor_add_attribute(grib_accessor* a,grib_accessor* attr,int nest_if
same=_grib_accessor_get_attribute(a,attr->name,&id);
if (same) {
if (nest_if_clash==0) return GRIB_ATTRIBUTE_CLASH;
aloc=same;
if (nest_if_clash==0) return GRIB_ATTRIBUTE_CLASH;
aloc=same;
}
for (id=0;id<MAX_ACCESSOR_ATTRIBUTES;id++) {
@ -805,7 +806,7 @@ grib_accessors_list* grib_accessors_list_last(grib_accessors_list* al)
last=next;
next=last->next;
}
*/
*/
return al->last;
}
@ -829,8 +830,8 @@ void grib_accessors_list_delete(grib_context* c,grib_accessors_list* al)
while (al) {
tmp=al->next;
/*grib_accessor_delete(c, al->accessor);*/
grib_context_free(c,al);
al=tmp;
}
}

View File

@ -13,7 +13,7 @@
/* grib level */
/* This file is generated my ./make_class.pl */
/* This file is generated by ./make_class.pl */
#include "grib_accessor_class.h"
#if GRIB_PTHREADS
@ -51,7 +51,8 @@ struct table_entry
grib_accessor_class **cclass;
};
static GRIB_INLINE int grib_inline_strcmp(const char* a,const char* b) {
static GRIB_INLINE int grib_inline_strcmp(const char* a,const char* b)
{
if (*a != *b) return 1;
while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;}
return (*a==0 && *b==0) ? 0 : 1;
@ -59,7 +60,7 @@ static GRIB_INLINE int grib_inline_strcmp(const char* a,const char* b) {
static struct table_entry table[] =
{
/* This file is generated my ./make_class.pl */
/* This file is generated by ./make_class.pl */
#include "grib_accessor_factory.h"
};
@ -89,7 +90,7 @@ grib_section* grib_create_root_section(const grib_context *context, grib_handle
s->aclength = NULL;
s->owner = NULL;
s->block = (grib_block_of_accessors*)
grib_context_malloc_clear(context, sizeof(grib_block_of_accessors));
grib_context_malloc_clear(context, sizeof(grib_block_of_accessors));
grib_context_log(context, GRIB_LOG_DEBUG, "Creating root section");
return s;
}
@ -110,7 +111,7 @@ static GRIB_INLINE grib_accessor_class* get_class(grib_context* c,char* type)
}
}
grib_context_log(c, GRIB_LOG_ERROR, "ecCodes Version: %s\nDefinition files path: %s\n",
ECCODES_VERSION_STR, c->grib_definition_files_path);
ECCODES_VERSION_STR, c->grib_definition_files_path);
grib_context_log(c,GRIB_LOG_FATAL,"unable to create class %s",type);
return NULL;
}
@ -199,15 +200,15 @@ grib_accessor* grib_accessor_factory(grib_section* p, grib_action* creator,
static void link_same_attributes(grib_accessor* a,grib_accessor* b)
{
int i=0;
int idx=0;
grib_accessor* bAttribute=NULL;
if (a==NULL || b==NULL) return;
while (a->attributes[i] && i<MAX_ACCESSOR_ATTRIBUTES) {
bAttribute=_grib_accessor_get_attribute(b,a->attributes[i]->name,&idx);
if (bAttribute) a->attributes[i]->same=bAttribute;
i++;
}
int i=0;
int idx=0;
grib_accessor* bAttribute=NULL;
if (a==NULL || b==NULL) return;
while (a->attributes[i] && i<MAX_ACCESSOR_ATTRIBUTES) {
bAttribute=_grib_accessor_get_attribute(b,a->attributes[i]->name,&idx);
if (bAttribute) a->attributes[i]->same=bAttribute;
i++;
}
}
void grib_push_accessor(grib_accessor* a, grib_block_of_accessors* l)
@ -314,8 +315,8 @@ int grib_section_adjust_sizes(grib_section* s,int update,int depth)
}
if(s->owner) {
grib_context_log(s->owner->context,GRIB_LOG_DEBUG,"grib_section_adjust_sizes: updating owner (%s->length old=%ld new=%ld)",s->owner->name,(long)s->owner->length,(long)length);
s->owner->length = length;
grib_context_log(s->owner->context,GRIB_LOG_DEBUG,"grib_section_adjust_sizes: updating owner (%s->length old=%ld new=%ld)",s->owner->name,(long)s->owner->length,(long)length);
s->owner->length = length;
}
s->length = length;
}

View File

@ -12,7 +12,7 @@
#define NUMBER(x) (sizeof(x)/sizeof(x[0]))
/* This file is generated my ./make_class.pl */
/* This file is generated by ./make_class.pl */
#include "grib_box_class.h"
struct table_entry
@ -23,7 +23,7 @@ struct table_entry
static struct table_entry table[] =
{
/* This file is generated my ./make_class.pl */
/* This file is generated by ./make_class.pl */
#include "grib_box_factory.h"
};

View File

@ -10,7 +10,7 @@
#include "grib_api_internal.h"
/* This file is generated my ./make_class.pl */
/* This file is generated by ./make_class.pl */
#include "grib_dumper_class.h"
@ -23,7 +23,7 @@ struct table_entry
static struct table_entry table[] =
{
/* This file is generated my ./make_class.pl */
/* This file is generated by ./make_class.pl */
#include "grib_dumper_factory.h"
};

View File

@ -18,7 +18,7 @@
#define NUMBER(x) (sizeof(x)/sizeof(x[0]))
/* This file is generated my ./make_class.pl */
/* This file is generated by ./make_class.pl */
#include "grib_iterator_class.h"
struct table_entry
@ -29,7 +29,7 @@ struct table_entry
static struct table_entry table[] =
{
/* This file is generated my ./make_class.pl */
/* This file is generated by ./make_class.pl */
#include "grib_iterator_factory.h"
};

View File

@ -17,7 +17,7 @@
#define NUMBER(x) (sizeof(x)/sizeof(x[0]))
/* This file is generated my ./make_class.pl */
/* This file is generated by ./make_class.pl */
#include "grib_nearest_class.h"
struct table_entry
@ -28,7 +28,7 @@ struct table_entry
static struct table_entry table[] =
{
/* This file is generated my ./make_class.pl */
/* This file is generated by ./make_class.pl */
#include "grib_nearest_factory.h"
};