mirror of https://github.com/ecmwf/eccodes.git
Terminate statements (with macros) with semi-colons
This commit is contained in:
parent
8b1e519ac3
commit
7dc8a1a4a6
|
@ -306,7 +306,7 @@ static grib_concept_value* get_concept_impl(grib_handle* h, grib_action_concept*
|
|||
static grib_concept_value* get_concept(grib_handle* h, grib_action_concept* self)
|
||||
{
|
||||
grib_concept_value* result = NULL;
|
||||
GRIB_MUTEX_INIT_ONCE(&once, &init)
|
||||
GRIB_MUTEX_INIT_ONCE(&once, &init);
|
||||
GRIB_MUTEX_LOCK(&mutex);
|
||||
|
||||
result = get_concept_impl(h, self);
|
||||
|
|
|
@ -306,10 +306,10 @@ static int grib_load_smart_table(grib_context* c, const char* filename,
|
|||
t->recomposed_name[0] = grib_context_strdup_persistent(c, recomposed_name);
|
||||
t->next = c->smart_table;
|
||||
t->numberOfEntries = size;
|
||||
GRIB_MUTEX_INIT_ONCE(&once, &thread_init)
|
||||
GRIB_MUTEX_LOCK(&mutex)
|
||||
GRIB_MUTEX_INIT_ONCE(&once, &thread_init);
|
||||
GRIB_MUTEX_LOCK(&mutex);
|
||||
c->smart_table = t;
|
||||
GRIB_MUTEX_UNLOCK(&mutex)
|
||||
GRIB_MUTEX_UNLOCK(&mutex);
|
||||
}
|
||||
else if (t->filename[1] == NULL) {
|
||||
t->filename[1] = grib_context_strdup_persistent(c, filename);
|
||||
|
|
|
@ -80,13 +80,13 @@ static void init_ibm_table()
|
|||
|
||||
static void init_table_if_needed()
|
||||
{
|
||||
GRIB_MUTEX_INIT_ONCE(&once, &init)
|
||||
GRIB_MUTEX_LOCK(&mutex)
|
||||
GRIB_MUTEX_INIT_ONCE(&once, &init);
|
||||
GRIB_MUTEX_LOCK(&mutex);
|
||||
|
||||
if (!ibm_table.inited)
|
||||
init_ibm_table();
|
||||
|
||||
GRIB_MUTEX_UNLOCK(&mutex)
|
||||
GRIB_MUTEX_UNLOCK(&mutex);
|
||||
}
|
||||
|
||||
static void binary_search(const double xx[], const unsigned long n, double x, unsigned long* j)
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
/***************************************************************************
|
||||
* Enrico Fucile - 06.01.2009 *
|
||||
* *
|
||||
***************************************************************************/
|
||||
#include "grib_ieeefloat.h"
|
||||
|
||||
|
@ -86,13 +85,13 @@ static void init_ieee_table()
|
|||
|
||||
static void init_table_if_needed()
|
||||
{
|
||||
GRIB_MUTEX_INIT_ONCE(&once, &init)
|
||||
GRIB_MUTEX_LOCK(&mutex)
|
||||
GRIB_MUTEX_INIT_ONCE(&once, &init);
|
||||
GRIB_MUTEX_LOCK(&mutex);
|
||||
|
||||
if (!ieee_table.inited)
|
||||
init_ieee_table();
|
||||
|
||||
GRIB_MUTEX_UNLOCK(&mutex)
|
||||
GRIB_MUTEX_UNLOCK(&mutex);
|
||||
}
|
||||
|
||||
static void binary_search(const double xx[], const unsigned long n, double x, unsigned long* j)
|
||||
|
|
|
@ -319,7 +319,7 @@ grib_itrie* grib_itrie_new(grib_context* c, int* count)
|
|||
|
||||
void grib_itrie_delete(grib_itrie* t)
|
||||
{
|
||||
GRIB_MUTEX_INIT_ONCE(&once, &init)
|
||||
GRIB_MUTEX_INIT_ONCE(&once, &init);
|
||||
GRIB_MUTEX_LOCK(&mutex);
|
||||
|
||||
if (t) {
|
||||
|
|
|
@ -108,8 +108,8 @@ static void* fast_new(size_t s, mempool* pool)
|
|||
char* p;
|
||||
memblk* m;
|
||||
|
||||
GRIB_MUTEX_INIT_ONCE(&once, &init)
|
||||
GRIB_MUTEX_LOCK(&mutex)
|
||||
GRIB_MUTEX_INIT_ONCE(&once, &init);
|
||||
GRIB_MUTEX_LOCK(&mutex);
|
||||
|
||||
m = (memblk*)pool->priv;
|
||||
|
||||
|
@ -141,7 +141,7 @@ static void* fast_new(size_t s, mempool* pool)
|
|||
|
||||
p = (memblk*)(pool->clear ? calloc(size, 1) : malloc(size));
|
||||
if (!p) {
|
||||
GRIB_MUTEX_UNLOCK(&mutex)
|
||||
GRIB_MUTEX_UNLOCK(&mutex);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -156,7 +156,7 @@ static void* fast_new(size_t s, mempool* pool)
|
|||
m->left -= s;
|
||||
m->cnt++;
|
||||
|
||||
GRIB_MUTEX_UNLOCK(&mutex)
|
||||
GRIB_MUTEX_UNLOCK(&mutex);
|
||||
|
||||
return p;
|
||||
}
|
||||
|
@ -167,8 +167,8 @@ static void fast_delete(void* p, mempool* pool)
|
|||
memblk* m;
|
||||
memblk* n = NULL;
|
||||
|
||||
GRIB_MUTEX_INIT_ONCE(&once, &init)
|
||||
GRIB_MUTEX_LOCK(&mutex)
|
||||
GRIB_MUTEX_INIT_ONCE(&once, &init);
|
||||
GRIB_MUTEX_LOCK(&mutex);
|
||||
|
||||
m = (memblk*)pool->priv;
|
||||
|
||||
|
@ -183,7 +183,7 @@ static void fast_delete(void* p, mempool* pool)
|
|||
pool->priv = (void*)m->next;
|
||||
free((void*)m);
|
||||
}
|
||||
GRIB_MUTEX_UNLOCK(&mutex)
|
||||
GRIB_MUTEX_UNLOCK(&mutex);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -271,8 +271,8 @@ void* grib_buffer_malloc(const grib_context* c, size_t s)
|
|||
{
|
||||
memblk* r;
|
||||
|
||||
GRIB_MUTEX_INIT_ONCE(&once, &init)
|
||||
GRIB_MUTEX_LOCK(&mutex)
|
||||
GRIB_MUTEX_INIT_ONCE(&once, &init);
|
||||
GRIB_MUTEX_LOCK(&mutex);
|
||||
|
||||
s = ((s + WORD - 1) / WORD) * WORD;
|
||||
r = reserve;
|
||||
|
@ -297,7 +297,7 @@ void* grib_buffer_malloc(const grib_context* c, size_t s)
|
|||
r->size = s;
|
||||
r->cnt = 1;
|
||||
|
||||
GRIB_MUTEX_UNLOCK(&mutex)
|
||||
GRIB_MUTEX_UNLOCK(&mutex);
|
||||
|
||||
return &r->buffer[0];
|
||||
}
|
||||
|
@ -307,8 +307,8 @@ void grib_buffer_free(const grib_context* c, void* p)
|
|||
memblk* r;
|
||||
memblk* s;
|
||||
|
||||
GRIB_MUTEX_INIT_ONCE(&once, &init)
|
||||
GRIB_MUTEX_LOCK(&mutex)
|
||||
GRIB_MUTEX_INIT_ONCE(&once, &init);
|
||||
GRIB_MUTEX_LOCK(&mutex);
|
||||
|
||||
r = (memblk*)(((char*)p) - HEADER_SIZE);
|
||||
s = reserve;
|
||||
|
@ -320,7 +320,7 @@ void grib_buffer_free(const grib_context* c, void* p)
|
|||
s->cnt = 0;
|
||||
}
|
||||
|
||||
GRIB_MUTEX_UNLOCK(&mutex)
|
||||
GRIB_MUTEX_UNLOCK(&mutex);
|
||||
}
|
||||
|
||||
void* grib_buffer_realloc(const grib_context* c, void* p, size_t s)
|
||||
|
|
|
@ -752,12 +752,12 @@ static grib_action* grib_parse_stream(grib_context* gc, const char* filename)
|
|||
|
||||
if (parse(gc, filename) == 0) {
|
||||
if (grib_parser_all_actions) {
|
||||
GRIB_MUTEX_UNLOCK(&mutex_stream)
|
||||
GRIB_MUTEX_UNLOCK(&mutex_stream);
|
||||
return grib_parser_all_actions;
|
||||
}
|
||||
else {
|
||||
grib_action* ret = grib_action_create_noop(gc, filename);
|
||||
GRIB_MUTEX_UNLOCK(&mutex_stream)
|
||||
GRIB_MUTEX_UNLOCK(&mutex_stream);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue