From f9a63538d988e77a2014cf9b41dfc60f9386e2a2 Mon Sep 17 00:00:00 2001 From: Changgyu Choi Date: Wed, 18 Aug 2021 16:32:35 +0900 Subject: [PATCH] Change num type to unsigned Change-Id: Ia250c2ed687f796c8ab1865f900ea3054cd0bc8a Signed-off-by: Changgyu Choi --- src/parcel-header-internal.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parcel-header-internal.cc b/src/parcel-header-internal.cc index 888b13a..f508bda 100644 --- a/src/parcel-header-internal.cc +++ b/src/parcel-header-internal.cc @@ -58,9 +58,9 @@ struct timespec ParcelHeader::GetTimeStamp() const { } int ParcelHeader::GenerateSeqNum() { - static std::atomic num { 0 }; + static std::atomic num { 0 }; ++num; - return num &= INT_MAX; + return static_cast(num & INT_MAX); } } // namespace internal -- 2.7.4