Indentation

This commit is contained in:
Shahram Najm 2019-08-06 16:46:12 +01:00
parent 9cfdcf506e
commit 4a725d1ee9
4 changed files with 251 additions and 252 deletions

View File

@ -141,12 +141,14 @@ static void init(grib_accessor* a, const long len , grib_arguments* arg )
Assert(a->length>=0);
}
static int value_count(grib_accessor* a,long* count){
static int value_count(grib_accessor* a,long* count)
{
*count=1;
return 0;
}
static size_t string_length(grib_accessor* a){
static size_t string_length(grib_accessor* a)
{
return a->length;
}
@ -155,7 +157,8 @@ static void dump(grib_accessor* a, grib_dumper* dumper)
grib_dump_string(dumper,a,NULL);
}
static int get_native_type(grib_accessor* a){
static int get_native_type(grib_accessor* a)
{
return GRIB_TYPE_STRING;
}
@ -200,19 +203,20 @@ static int pack_string(grib_accessor* a, const char* val, size_t *len)
return GRIB_SUCCESS;
}
static int pack_long(grib_accessor* a, const long* v, size_t *len){
static int pack_long(grib_accessor* a, const long* v, size_t *len)
{
grib_context_log(a->context,GRIB_LOG_ERROR, " Should not pack %s as long", a->name);
return GRIB_NOT_IMPLEMENTED;
}
static int pack_double(grib_accessor* a, const double*v, size_t *len){
static int pack_double(grib_accessor* a, const double*v, size_t *len)
{
grib_context_log(a->context,GRIB_LOG_ERROR, " Should not pack %s as double", a->name);
return GRIB_NOT_IMPLEMENTED;
}
static int unpack_long (grib_accessor* a, long* v, size_t *len){
static int unpack_long (grib_accessor* a, long* v, size_t *len)
{
char val[1024]={0,};
size_t l = sizeof(val);
size_t i =0;
@ -234,10 +238,10 @@ static int unpack_long (grib_accessor* a, long* v, size_t *len){
grib_context_log(a->context,GRIB_LOG_DEBUG, " Casting string %s to long", a->name);
return GRIB_SUCCESS;
}
static int unpack_double (grib_accessor* a, double*v, size_t *len){
static int unpack_double (grib_accessor* a, double*v, size_t *len)
{
char val[1024];
size_t l = sizeof(val);
char *last = NULL;
@ -254,8 +258,8 @@ static int unpack_double (grib_accessor* a, double*v, size_t *len){
return GRIB_NOT_IMPLEMENTED;
}
static int compare(grib_accessor* a,grib_accessor* b) {
static int compare(grib_accessor* a,grib_accessor* b)
{
int retval=0;
char *aval=0;
char *bval=0;
@ -289,4 +293,3 @@ static int compare(grib_accessor* a,grib_accessor* b) {
return retval;
}

View File

@ -209,7 +209,8 @@ static void destroy(grib_context* c,grib_accessor* a)
grib_context_free(c,self->v);
}
static int compare(grib_accessor* a, grib_accessor* b) {
static int compare(grib_accessor* a, grib_accessor* b)
{
int retval = GRIB_SUCCESS;
double *aval=0;
double *bval=0;

View File

@ -132,9 +132,6 @@ static void init_class(grib_accessor_class* c)
/* END_CLASS_IMP */
static void init(grib_accessor* a, const long len , grib_arguments* arg )
{
a->sub_section = grib_section_create(grib_handle_of_accessor(a),a);
@ -159,9 +156,7 @@ static long byte_count(grib_accessor* a)
/* printf(" SECTION %s is %ld %ld\n",a->name,(long)a->offset,(long)a->length); */
}
/* printf("SECTION %s is %ld %d\n",a->name,a->length,a->sub_section->aclength != NULL); */
return a->length;
}
@ -175,19 +170,19 @@ static void destroy(grib_context* ct, grib_accessor* a)
grib_section_delete(ct,a->sub_section);
}
static int get_native_type(grib_accessor* a){
static int get_native_type(grib_accessor* a)
{
return GRIB_TYPE_SECTION;
}
static grib_section* sub_section(grib_accessor* a){
static grib_section* sub_section(grib_accessor* a)
{
/* grib_accessor_section* self = (grib_accessor_section*)a; */
return a->sub_section;
}
static void update_size(grib_accessor* a,size_t length)
{
size_t size = 1;
long len = length;
Assert(length <= 0x7fffffff);
@ -210,7 +205,8 @@ static void update_size(grib_accessor* a,size_t length)
Assert(a->length>=0);
}
static grib_accessor* next(grib_accessor* a,int explore) {
static grib_accessor* next(grib_accessor* a,int explore)
{
grib_accessor* next=NULL;
if (explore) {
next=a->sub_section->block->first;
@ -224,4 +220,3 @@ static grib_accessor* next(grib_accessor* a,int explore) {
}
return next;
}