summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorchenzizhan <[email protected]>2024-04-19 18:13:40 +0800
committerchenzizhan <[email protected]>2024-04-19 18:13:40 +0800
commit69baa07be7d9684968e82dfdd3135bfd5c8e6663 (patch)
treed93c1674532958fb377d6c3f0b961a4079ffaf82 /src
parent73d8bbead87ba04e0762831b7e402ae0833de38d (diff)
fix civ4.5.7b
Diffstat (limited to 'src')
-rw-r--r--src/tags/heavy_keeper.c7
-rw-r--r--src/tags/sorted_set.c5
2 files changed, 5 insertions, 7 deletions
diff --git a/src/tags/heavy_keeper.c b/src/tags/heavy_keeper.c
index a82677b..bfef493 100644
--- a/src/tags/heavy_keeper.c
+++ b/src/tags/heavy_keeper.c
@@ -9,7 +9,6 @@
#include <stdlib.h>
#include <string.h>
#include <assert.h>
-#include <limits.h>
#include "minheap/heap.h"
#include "mpack/mpack.h"
@@ -158,8 +157,8 @@ struct Bucket *map_flow_id_hash_to_bucket(struct heavy_keeper *hk, int array_ind
}
unsigned long long count_add(unsigned long long a, unsigned long long b) {
- if (a > LLONG_MAX - b) {
- return LLONG_MAX;
+ if (a > UINT64_MAX - b) {
+ return UINT64_MAX;
}
return a + b;
}
@@ -434,7 +433,7 @@ void heavy_keeper_merge_sorted_set_recording_id_details(struct heavy_keeper *des
int cell_id_in_src_before_merge_len = 0;
int cell_id_in_dest_corresponding[dest->K]; // length == cell_id_in_src_before_merge_len
- /* ------------------------------ merge dest ------------------------------ *
+ /* ------------------------------ merge dest ------------------------------ */
for (int i = 0; i < size_dest; i++) {
unsigned long long maxv = find_maxv_in_sketch(dest, tag_arr[i]);
assert(tag_arr[i] != NULL);
diff --git a/src/tags/sorted_set.c b/src/tags/sorted_set.c
index 6d71777..31320f7 100644
--- a/src/tags/sorted_set.c
+++ b/src/tags/sorted_set.c
@@ -3,7 +3,6 @@
#include <string.h>
#include <stdio.h>
#include <assert.h>
-#include <limits.h>
#include "my_ut_hash_inner.h"
#include "xxhash/xxhash.h"
@@ -213,8 +212,8 @@ bool sorted_set_check_is_full(const struct sorted_set *ss)
unsigned long long safe_add(unsigned long long a, unsigned long long b)
{
- if (ULLONG_MAX - a < b) {
- return ULLONG_MAX;
+ if (UINT64_MAX - a < b) {
+ return UINT64_MAX;
}
return a + b;
}