mirror of https://github.com/ecmwf/eccodes.git
Fix cppcheck warnings
This commit is contained in:
parent
2479a8670c
commit
ce006ec226
|
@ -256,7 +256,7 @@ int LambertAzimuthalEqualArea::init_sphere(grib_handle* h,
|
||||||
return GRIB_OUT_OF_MEMORY;
|
return GRIB_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
lons_ = (double*)grib_context_malloc(h->context, nv * sizeof(double));
|
lons_ = (double*)grib_context_malloc(h->context, nv * sizeof(double));
|
||||||
if (!lats_) {
|
if (!lons_) {
|
||||||
grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv * sizeof(double));
|
grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv * sizeof(double));
|
||||||
return GRIB_OUT_OF_MEMORY;
|
return GRIB_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,7 +166,7 @@ int LambertConformal::init_sphere(const grib_handle* h,
|
||||||
return GRIB_OUT_OF_MEMORY;
|
return GRIB_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
lons_ = (double*)grib_context_malloc(h->context, nv * sizeof(double));
|
lons_ = (double*)grib_context_malloc(h->context, nv * sizeof(double));
|
||||||
if (!lats_) {
|
if (!lons_) {
|
||||||
grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv * sizeof(double));
|
grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv * sizeof(double));
|
||||||
return GRIB_OUT_OF_MEMORY;
|
return GRIB_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
@ -291,7 +291,7 @@ int LambertConformal::init_oblate(const grib_handle* h,
|
||||||
return GRIB_OUT_OF_MEMORY;
|
return GRIB_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
lons_ = (double*)grib_context_malloc(h->context, nv * sizeof(double));
|
lons_ = (double*)grib_context_malloc(h->context, nv * sizeof(double));
|
||||||
if (!lats_) {
|
if (!lons_) {
|
||||||
grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv * sizeof(double));
|
grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv * sizeof(double));
|
||||||
return GRIB_OUT_OF_MEMORY;
|
return GRIB_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,7 +123,7 @@ int Mercator::init_mercator(grib_handle* h,
|
||||||
return GRIB_OUT_OF_MEMORY;
|
return GRIB_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
lons_ = (double*)grib_context_malloc(h->context, nv * sizeof(double));
|
lons_ = (double*)grib_context_malloc(h->context, nv * sizeof(double));
|
||||||
if (!lats_) {
|
if (!lons_) {
|
||||||
grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv * sizeof(double));
|
grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv * sizeof(double));
|
||||||
return GRIB_OUT_OF_MEMORY;
|
return GRIB_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,7 +186,7 @@ int PolarStereographic::init(grib_handle* h, grib_arguments* args)
|
||||||
return GRIB_OUT_OF_MEMORY;
|
return GRIB_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
lons_ = (double*)grib_context_malloc(h->context, nv_ * sizeof(double));
|
lons_ = (double*)grib_context_malloc(h->context, nv_ * sizeof(double));
|
||||||
if (!lats_) {
|
if (!lons_) {
|
||||||
grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv_ * sizeof(double));
|
grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, nv_ * sizeof(double));
|
||||||
return GRIB_OUT_OF_MEMORY;
|
return GRIB_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,7 +227,7 @@ int SpaceView::init(grib_handle* h, grib_arguments* args)
|
||||||
return GRIB_OUT_OF_MEMORY;
|
return GRIB_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
lons_ = (double*)grib_context_malloc(h->context, array_size);
|
lons_ = (double*)grib_context_malloc(h->context, array_size);
|
||||||
if (!lats_) {
|
if (!lons_) {
|
||||||
grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, array_size);
|
grib_context_log(h->context, GRIB_LOG_ERROR, "%s: Error allocating %zu bytes", ITER, array_size);
|
||||||
return GRIB_OUT_OF_MEMORY;
|
return GRIB_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue