diff options
| author | liuxueli <[email protected]> | 2023-08-14 20:10:05 +0800 |
|---|---|---|
| committer | chenzizhan <[email protected]> | 2023-08-15 11:06:22 +0800 |
| commit | cabd1347f86a0235ab4b367b1d8a73c0be5ed170 (patch) | |
| tree | f52f9ae03ffeb4c04b198580382dfbe50ade797c /src/fieldstat.c | |
| parent | cf3f77d5fe9b62df499bd3fafab38eca4f9e5245 (diff) | |
err proc for fieldstat_get_cube_versionv4.0.5
Diffstat (limited to 'src/fieldstat.c')
| -rw-r--r-- | src/fieldstat.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/fieldstat.c b/src/fieldstat.c index 5d2603f..f5f2f12 100644 --- a/src/fieldstat.c +++ b/src/fieldstat.c @@ -127,12 +127,21 @@ int fieldstat_unregister_cube(struct fieldstat *instance, int cube_id) return 0; } -unsigned long fieldstat_get_cube_version(const struct fieldstat *instance, int cube_id) +long long fieldstat_get_cube_version(const struct fieldstat *instance, int cube_id) { + if (instance == NULL) { + return -1; + } + if (cube_id < 0) { + return -2; + } if (cube_id >= instance->valid_cube_arr_length) { - //printf("ERR: cube_id is out of range\n"); - return 0; + return -3; + } + if (instance->cube[cube_id] == NULL && instance->cube_version[cube_id] == 0) { + return -3; } + return instance->cube_version[cube_id]; } |
