File: grib_fortran_kinds.c

package info (click to toggle)
eccodes 2.43.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 420,752 kB
  • sloc: cpp: 153,709; sh: 20,505; ansic: 12,673; f90: 6,854; python: 3,011; perl: 2,744; javascript: 1,427; yacc: 854; fortran: 468; lex: 359; makefile: 141
file content (43 lines) | stat: -rw-r--r-- 1,125 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 * (C) Copyright 2005- ECMWF.
 *
 * This software is licensed under the terms of the Apache Licence Version 2.0
 * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
 *
 * In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
 * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
 */

#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif

void f_sizeof_(void *x, void *y, int *size) {
  *size=((char*)y)-((char*)x);
}

void check_double_(double *x, double* y, char* ret) {
  *ret = ((char*)y)-((char*)x) == sizeof(*x) ?  't' : 'f';
}

void check_float_(float* x, float* y, char* ret) {
  *ret = ((char*)y)-((char*)x) == sizeof(*x) ?  't' : 'f';
}

void check_int_(int* x, int* y, char* ret) {
  *ret = ((char*)y)-((char*)x) == sizeof(*x) ?  't' : 'f';
}

void check_long_(long* x, long * y, char* ret) {
  *ret = ((char*)y)-((char*)x) == sizeof(*x) ?  't' : 'f';
}

void check_size_t_(size_t* x, size_t* y, char* ret) {
  *ret = ((char*)y)-((char*)x) == sizeof(*x) ?  't' : 'f';
}

#ifdef __cplusplus
}
#endif