Skip to content

Commit 98cf7cb

Browse files
authored
Merge pull request #103 from ggtakec/modify_configure
Enabled external customization of configure.ac and fixed for building
2 parents 2b4e9c4 + d9a6a3f commit 98cf7cb

18 files changed

+127
-67
lines changed

.github/workflows/ostypevars.sh

+5
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,11 @@ elif [ "X${CI_OSTYPE}" = "Xcentos:8" -o "X${CI_OSTYPE}" = "Xcentos:centos8" ]; t
146146
PKG_EXT="rpm"
147147
IS_OS_CENTOS=1
148148

149+
#
150+
# Change mirrorlist
151+
#
152+
sed -i -e 's|^mirrorlist|#mirrorlist|g' -e 's|^#baseurl=http://mirror|baseurl=http://vault|g' /etc/yum.repos.d/CentOS-*repo
153+
149154
# [NOTE]
150155
# For CentOS8, installing libyaml-devel from PowerTools( PwoerTools -> powertools at 2020/12 )
151156
#

.gitignore

+6-3
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,10 @@ tests/test.sh.log
152152
tests/test.sh.trs
153153

154154
#
155-
# VIM modelines
156-
#
157-
# vim:set ts=4 fenc=utf-8:
155+
# Local variables:
156+
# tab-width: 4
157+
# c-basic-offset: 4
158+
# End:
159+
# vim600: noexpandtab sw=4 ts=4 fdm=marker
160+
# vim<600: noexpandtab sw=4 ts=4
158161
#

Makefile.am

+7-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
SUBDIRS=lib src tests docs buildutils
2424
ACLOCAL_AMFLAGS = -I m4
25-
EXTRA_DIST=RELEASE_VERSION
25+
EXTRA_DIST=RELEASE_VERSION @CONFIGURECUSTOM@
2626

2727
CPPCHECK_CMD= cppcheck
2828
CPPCHECK_OPT= --quiet \
@@ -68,7 +68,10 @@ cppcheck:
6868
fi
6969

7070
#
71-
# VIM modelines
72-
#
73-
# vim:set ts=4 fenc=utf-8:
71+
# Local variables:
72+
# tab-width: 4
73+
# c-basic-offset: 4
74+
# End:
75+
# vim600: noexpandtab sw=4 ts=4 fdm=marker
76+
# vim<600: noexpandtab sw=4 ts=4
7477
#

configure.ac

+39-16
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ AC_PROG_RANLIB
5151
#
5252
AC_CHECK_LIB(dl, dlopen)
5353

54-
#
55-
# Checks for header files.
56-
#
57-
AC_CHECK_HEADERS([locale.h netdb.h fcntl.h sys/socket.h sys/time.h endian.h sys/endian.h netinet/in.h])
58-
5954
#
6055
# Checks for typedefs, structures, and compiler characteristics.
6156
#
@@ -79,20 +74,45 @@ AC_FUNC_MKTIME
7974
AC_FUNC_FORK
8075
AC_FUNC_ERROR_AT_LINE
8176
AC_CHECK_FUNCS([ftruncate gethostname memset regcomp setlocale strcasecmp strncasecmp strdup strrchr clock_gettime munmap select socket uname gettimeofday strstr inet_ntoa])
82-
AC_CHECK_HEADERS([termios.h arpa/inet.h])
77+
AC_CHECK_HEADERS([locale.h netdb.h fcntl.h sys/socket.h sys/time.h endian.h sys/endian.h netinet/in.h termios.h arpa/inet.h inttypes.h strings.h unistd.h])
8378
AC_CONFIG_MACRO_DIR([m4])
8479
AC_HEADER_RESOLV
8580

81+
#
82+
# Load customizable variables
83+
#
84+
AC_CHECK_FILE([configure.custom],
85+
[
86+
configure_custom_file="configure.custom"
87+
custom_git_domain="$(grep '^\s*GIT_DOMAIN\s*=' configure.custom | sed -e 's|^\s*GIT_DOMAIN\s*=\s*||g' -e 's|^\s*||g' -e 's|\s*$||g')"
88+
custom_git_org="$(grep '^\s*GIT_ORG\s*=' configure.custom | sed -e 's|^\s*GIT_ORG\s*=\s*||g' -e 's|^\s*||g' -e 's|\s*$||g')"
89+
custom_git_repo="$(grep '^\s*GIT_REPO\s*=' configure.custom | sed -e 's|^\s*GIT_REPO\s*=\s*||g' -e 's|^\s*||g' -e 's|\s*$||g')"
90+
custom_git_endpoint="$(grep '^\s*GIT_EP_V3_REPO\s*=' configure.custom | sed -e 's|^\s*GIT_EP_V3_REPO\s*=\s*||g' -e 's|^\s*||g' -e 's|\s*$||g')"
91+
custom_dev_email="$(grep '^\s*DEV_EMAIL\s*=' configure.custom | sed -e 's|^\s*DEV_EMAIL\s*=\s*||g' -e 's|^\s*||g' -e 's|\s*$||g')"
92+
custom_dev_name="$(grep '^\s*DEB_NAME\s*=' configure.custom | sed -e 's|^\s*DEB_NAME\s*=\s*||g' -e 's|^\s*||g' -e 's|\s*$||g')"
93+
],
94+
[
95+
configure_custom_file=""
96+
custom_git_domain="github.com"
97+
custom_git_org="yahoojapan"
98+
custom_git_repo="chmpx"
99+
custom_git_endpoint="https://api.github.com/repos/"
100+
custom_dev_email="[email protected]"
101+
custom_dev_name="CHMPX_DEVELOPER"
102+
]
103+
)
104+
86105
#
87106
# Symbols for buildutils
88107
#
89-
AC_SUBST([GIT_DOMAIN], "github.com")
90-
AC_SUBST([GIT_ORG], "yahoojapan")
91-
AC_SUBST([GIT_REPO], "chmpx")
92-
AC_SUBST([CURRENTREV], "`$(pwd)/buildutils/make_commit_hash.sh -o yahoojapan -r chmpx -short`")
93-
AC_SUBST([DEV_EMAIL], "`echo ${DEBEMAIL:[email protected]}`")
94-
AC_SUBST([DEV_NAME], "`echo ${DEBFULLNAME:-CHMPX_DEVELOPER}`")
95-
108+
AC_SUBST([CONFIGURECUSTOM], "${configure_custom_file}")
109+
AC_SUBST([GIT_DOMAIN], "${custom_git_domain}")
110+
AC_SUBST([GIT_ORG], "${custom_git_org}")
111+
AC_SUBST([GIT_REPO], "${custom_git_repo}")
112+
AC_SUBST([CURRENTREV], "$($(pwd)/buildutils/make_commit_hash.sh -o "${custom_git_org}" -r "${custom_git_repo}" -ep "${custom_git_endpoint}" -short)")
113+
AC_SUBST([DEV_EMAIL], "$(echo ${DEBEMAIL:-"${custom_dev_email}"})")
114+
AC_SUBST([DEV_NAME], "$(echo ${DEBFULLNAME:-"${custom_dev_name}"})")
115+
#
96116
AC_SUBST([RPMCHANGELOG], "`$(pwd)/buildutils/make_rpm_changelog.sh $(pwd)/ChangeLog`")
97117
AC_SUBST([SHORTDESC], "`$(pwd)/buildutils/make_description.sh $(pwd)/docs/chmpx.1 -short`")
98118
AC_SUBST([LONGDESC], "`$(pwd)/buildutils/make_description.sh $(pwd)/docs/chmpx.1 -long`")
@@ -242,7 +262,10 @@ AC_CONFIG_FILES([Makefile
242262
AC_OUTPUT
243263

244264
#
245-
# VIM modelines
246-
#
247-
# vim:set ts=4 fenc=utf-8:
265+
# Local variables:
266+
# tab-width: 4
267+
# c-basic-offset: 4
268+
# End:
269+
# vim600: noexpandtab sw=4 ts=4 fdm=marker
270+
# vim<600: noexpandtab sw=4 ts=4
248271
#

lib/Makefile.am

+15-5
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,15 @@ libchmpx_la_LDFLAGS = -version-info $(LIB_VERSION_INFO)
108108
libchmpx_la_LIBADD = $(k2hash_LIBS) $(fullock_LIBS) $(SSL_TLS_LIBS) -lyaml -lrt -lresolv -lpthread
109109

110110
ACLOCAL_AMFLAGS = -I m4
111-
AM_CFLAGS = $(k2hash_CFLAGS) $(fullock_CFLAGS)
112-
AM_CPPFLAGS = $(k2hash_CFLAGS) $(fullock_CFLAGS)
111+
112+
# [NOTE]
113+
# "-Waddress-of-packed-member" optsion was introduced by default
114+
# from GCC 9.
115+
# Knowing that packed structure is CPU architecture dependent,
116+
# this program ignores this warning.
117+
#
118+
AM_CFLAGS = $(k2hash_CFLAGS) $(fullock_CFLAGS) -Wno-address-of-packed-member
119+
AM_CPPFLAGS = $(k2hash_CFLAGS) $(fullock_CFLAGS) -Wno-address-of-packed-member
113120

114121
### version(commit hash)
115122
.PHONY: chmpxversion
@@ -118,7 +125,10 @@ chmpxversion.cc: chmpxversion
118125
@../buildutils/make_commit_hash_source.sh chmpxversion.cc chmpx_commit_hash
119126

120127
#
121-
# VIM modelines
122-
#
123-
# vim:set ts=4 fenc=utf-8:
128+
# Local variables:
129+
# tab-width: 4
130+
# c-basic-offset: 4
131+
# End:
132+
# vim600: noexpandtab sw=4 ts=4 fdm=marker
133+
# vim<600: noexpandtab sw=4 ts=4
124134
#

lib/chmcntrl.cc

+4
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,8 @@ bool ChmCntrl::EventLoop(void)
510510
if(0L == ImData.GetUpServerCount()){
511511
// Check any server up
512512
if(pEventSock->InitialAllServerStatus()){
513+
// cppcheck-suppress unmatchedSuppression
514+
// cppcheck-suppress knownConditionTrueFalse
513515
if(0L < ImData.GetUpServerCount()){
514516
// Try to connect servers
515517
//MSG_CHMPRN("Try to connect servers on RING(mode is SLAVE).");
@@ -530,6 +532,8 @@ bool ChmCntrl::EventLoop(void)
530532
// [NOTE]
531533
// This case is that there are no other server node up.
532534
if(pEventSock->InitialAllServerStatus()){
535+
// cppcheck-suppress unmatchedSuppression
536+
// cppcheck-suppress knownConditionTrueFalse
533537
if(1L < ImData.GetUpServerCount()){
534538
// Try to connect servers
535539
//MSG_CHMPRN("Try to connect servers on RING(mode is SERVER).");

lib/chmcommon.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ template<typename T> inline bool CHMEMPTYSTR(const T pstr)
6565
#define CHMPXSTRJOIN(first, second) first ## second
6666

6767
#if defined(__cplusplus)
68-
#define CHM_OFFSET(baseaddr, offset, type) (offset > 0 ? reinterpret_cast<type>(reinterpret_cast<off_t>(baseaddr) + offset) : reinterpret_cast<type>(baseaddr)) // convert pointer with offset
69-
#define CHM_ABS(baseaddr, offset, type) (reinterpret_cast<off_t>(offset) > 0 ? reinterpret_cast<type>(reinterpret_cast<off_t>(baseaddr) + reinterpret_cast<off_t>(offset)) : 0) // To Absolute address
70-
#define CHM_REL(baseaddr, address, type) (address > 0 ? reinterpret_cast<type>(reinterpret_cast<off_t>(address) - reinterpret_cast<off_t>(baseaddr)) : 0) // To Relative address
68+
#define CHM_OFFSET(baseaddr, offset, type) ((offset > 0) ? reinterpret_cast<type>(reinterpret_cast<off_t>(baseaddr) + offset) : reinterpret_cast<type>(baseaddr)) // convert pointer with offset
69+
#define CHM_ABS(baseaddr, offset, type) ((reinterpret_cast<off_t>(offset) > 0) ? reinterpret_cast<type>(reinterpret_cast<off_t>(baseaddr) + reinterpret_cast<off_t>(offset)) : 0) // To Absolute address
70+
#define CHM_REL(baseaddr, address, type) ((reinterpret_cast<off_t>(address) > 0) ? reinterpret_cast<type>(reinterpret_cast<off_t>(address) - reinterpret_cast<off_t>(baseaddr)) : 0) // To Relative address
7171
#else // __cplusplus
72-
#define CHM_OFFSET(baseaddr, offset, type) (offset > 0 ? (type)((off_t)baseaddr + offset) : (type)baseaddr) // convert pointer with offset
73-
#define CHM_ABS(baseaddr, offset, type) (offset > 0 ? (type)((off_t)baseaddr + (off_t)offset) : 0) // To Absolute address
74-
#define CHM_REL(baseaddr, address, type) (address > 0 ? (type)((off_t)address - (off_t)baseaddr) : 0) // To Relative address
72+
#define CHM_OFFSET(baseaddr, offset, type) ((offset > 0) ? (type)((off_t)baseaddr + (off_t)offset) : (type)baseaddr) // convert pointer with offset
73+
#define CHM_ABS(baseaddr, offset, type) (((off_t)offset > 0) ? (type)((off_t)baseaddr + (off_t)offset) : 0) // To Absolute address
74+
#define CHM_REL(baseaddr, address, type) (((off_t)address > 0) ? (type)((off_t)address - (off_t)baseaddr) : 0) // To Relative address
7575
#endif // __cplusplus
7676

7777
//---------------------------------------------------------

lib/chmconf.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ bool CHMConf::Clean(void)
352352
UnsetEventQueue();
353353
}
354354

355-
while(!fullock::flck_trylock_noshared_mutex(&CHMConf::lockval)); // LOCK
355+
while(!fullock::flck_trylock_noshared_mutex(&CHMConf::lockval)){} // LOCK
356356
CHM_Delete(pchmcfginfo);
357357
fullock::flck_unlock_noshared_mutex(&CHMConf::lockval); // UNLOCK
358358

lib/chmeventmq.cc

+13-15
Original file line numberDiff line numberDiff line change
@@ -1625,25 +1625,23 @@ bool ChmEventMq::RawReceive(mqd_t mqfd, const COMPOSEDMSGID& composed)
16251625
pComPkt = pTmp;
16261626

16271627
// Dispatching
1628-
if(pComPkt){
1629-
bool is_need_ack = (COM_C2C == pComPkt->head.type && use_mq_ack && pChmCntrl->IsChmpxType());
1628+
bool is_need_ack = (COM_C2C == pComPkt->head.type && use_mq_ack && pChmCntrl->IsChmpxType());
16301629

1631-
if(pChmCntrl && !pChmCntrl->Processing(pComPkt, ChmCntrl::EVOBJ_TYPE_EVMQ)){
1632-
// send failure ack
1633-
if(is_need_ack && !SendAck(composed, false)){
1634-
ERR_CHMPRN("Failed sending failure ACK to to MQ(%d).", mqfd);
1635-
}
1636-
ERR_CHMPRN("Failed processing after receiving from MQ(%d).", mqfd);
1637-
CHM_Free(pComPkt);
1638-
return false;
1630+
if(pChmCntrl && !pChmCntrl->Processing(pComPkt, ChmCntrl::EVOBJ_TYPE_EVMQ)){
1631+
// send failure ack
1632+
if(is_need_ack && !SendAck(composed, false)){
1633+
ERR_CHMPRN("Failed sending failure ACK to to MQ(%d).", mqfd);
16391634
}
1635+
ERR_CHMPRN("Failed processing after receiving from MQ(%d).", mqfd);
16401636
CHM_Free(pComPkt);
1637+
return false;
1638+
}
1639+
CHM_Free(pComPkt);
16411640

1642-
// send success ack
1643-
if(is_need_ack && !SendAck(composed, true)){
1644-
ERR_CHMPRN("Failed sending success ACK to to MQ(%d).", mqfd);
1645-
return false;
1646-
}
1641+
// send success ack
1642+
if(is_need_ack && !SendAck(composed, true)){
1643+
ERR_CHMPRN("Failed sending success ACK to to MQ(%d).", mqfd);
1644+
return false;
16471645
}
16481646
return true;
16491647
}

lib/chmeventshm.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ bool ChmEventShm::GetEventQueueFds(event_fds_t& fds)
198198

199199
bool ChmEventShm::SetEventQueue(void)
200200
{
201-
if(0 == chmshmfile.c_str()){
201+
if(chmshmfile.empty()){
202202
ERR_CHMPRN("This object does not have chmshm file path.");
203203
return false;
204204
}

lib/chmeventsock.cc

+7-7
Original file line numberDiff line numberDiff line change
@@ -1459,7 +1459,7 @@ bool ChmEventSock::ReceiveWorkerProc(void* common_param, chmthparam_t wp_param)
14591459
// cppcheck-suppress unmatchedSuppression
14601460
// cppcheck-suppress nullPointerRedundantCheck
14611461
suseconds_t waittime = pSockObj->sock_wait_time;
1462-
bool is_closed;
1462+
bool is_closed= false;
14631463
int werr;
14641464
while(0 == (werr = ChmEventSock::WaitForReady(sock, WAIT_READ_FD, 0, false, waittime))){ // check rest data & return assap
14651465
// Processing
@@ -7587,7 +7587,7 @@ bool ChmEventSock::PxComSendStatusReq(int sock, chmpxid_t chmpxid, bool need_soc
75877587
return true;
75887588
}
75897589

7590-
bool ChmEventSock::PxComReceiveStatusReq(PCOMHEAD pComHead, PPXCOM_ALL pComAll, PCOMPKT* ppResComPkt)
7590+
bool ChmEventSock::PxComReceiveStatusReq(PCOMHEAD pComHead, const PPXCOM_ALL pComAll, PCOMPKT* ppResComPkt)
75917591
{
75927592
if(!pComHead || !pComAll || !ppResComPkt){
75937593
ERR_CHMPRN("Parameter are wrong.");
@@ -9971,7 +9971,7 @@ bool ChmEventSock::PxComSendMergeSuspendGet(int sock, chmpxid_t chmpxid)
99719971
return true;
99729972
}
99739973

9974-
bool ChmEventSock::PxComReceiveMergeSuspendGet(PCOMHEAD pComHead, PPXCOM_ALL pComAll, PCOMPKT* ppResComPkt)
9974+
bool ChmEventSock::PxComReceiveMergeSuspendGet(PCOMHEAD pComHead, const PPXCOM_ALL pComAll, PCOMPKT* ppResComPkt)
99759975
{
99769976
if(!pComHead || !pComAll || !ppResComPkt){
99779977
ERR_CHMPRN("Parameter are wrong.");
@@ -10204,7 +10204,7 @@ bool ChmEventSock::PxComReceiveServerDown(PCOMHEAD pComHead, PPXCOM_ALL pComAll,
1020410204
return true;
1020510205
}
1020610206

10207-
bool ChmEventSock::PxCltReceiveJoinNotify(PCOMHEAD pComHead, PPXCLT_ALL pComAll)
10207+
bool ChmEventSock::PxCltReceiveJoinNotify(const PCOMHEAD pComHead, const PPXCLT_ALL pComAll)
1020810208
{
1020910209
if(!pComHead || !pComAll){
1021010210
ERR_CHMPRN("Parameter are wrong.");
@@ -10532,7 +10532,7 @@ bool ChmEventSock::PxComSendResUpdateData(chmpxid_t chmpxid, size_t length, cons
1053210532
return true;
1053310533
}
1053410534

10535-
bool ChmEventSock::PxComReceiveResUpdateData(PCOMHEAD pComHead, PPXCOM_ALL pComAll)
10535+
bool ChmEventSock::PxComReceiveResUpdateData(const PCOMHEAD pComHead, PPXCOM_ALL pComAll)
1053610536
{
1053710537
if(!pComHead || !pComAll){
1053810538
ERR_CHMPRN("Parameter are wrong.");
@@ -10596,7 +10596,7 @@ bool ChmEventSock::PxComSendResultUpdateData(chmpxid_t chmpxid, reqidmapflag_t r
1059610596
return true;
1059710597
}
1059810598

10599-
bool ChmEventSock::PxComReceiveResultUpdateData(PCOMHEAD pComHead, PPXCOM_ALL pComAll)
10599+
bool ChmEventSock::PxComReceiveResultUpdateData(const PCOMHEAD pComHead, PPXCOM_ALL pComAll)
1060010600
{
1060110601
if(!pComHead || !pComAll){
1060210602
ERR_CHMPRN("Parameter are wrong.");
@@ -10699,7 +10699,7 @@ bool ChmEventSock::PxComSendVersionReq(int sock, chmpxid_t chmpxid, bool need_so
1069910699
// Therefore, instead of processing in the reception main loop, CHMPX_COM_VERSION_RES is
1070010700
// returned directly in this method.
1070110701
//
10702-
bool ChmEventSock::PxComReceiveVersionReq(int sock, PCOMHEAD pComHead, PPXCOM_ALL pComAll)
10702+
bool ChmEventSock::PxComReceiveVersionReq(int sock, PCOMHEAD pComHead, const PPXCOM_ALL pComAll)
1070310703
{
1070410704
if(CHM_INVALID_SOCK == sock || !pComHead || !pComAll){
1070510705
ERR_CHMPRN("Parameter are wrong.");

lib/chmeventsock.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ class ChmEventSock : public ChmEventBase
263263

264264
// px2px commands
265265
bool PxComSendStatusReq(int sock, chmpxid_t chmpxid, bool need_sock_close);
266-
bool PxComReceiveStatusReq(PCOMHEAD pComHead, PPXCOM_ALL pComAll, PCOMPKT* ppResComPkt);
266+
bool PxComReceiveStatusReq(PCOMHEAD pComHead, const PPXCOM_ALL pComAll, PCOMPKT* ppResComPkt);
267267
bool PxComReceiveStatusRes(PCOMHEAD pComHead, PPXCOM_ALL pComAll, PCOMPKT* ppResComPkt, bool is_init_process = false);
268268
bool PxComSendConinitReq(int sock, chmpxid_t chmpxid);
269269
bool PxComReceiveConinitReq(PCOMHEAD pComHead, PPXCOM_ALL pComAll, PCOMPKT* ppResComPkt, comver_t& comver, std::string& name, chmpxid_t& from_chmpxid, short& ctlport, std::string& cuk, std::string& custom_seed, hostport_list_t& endpoints, hostport_list_t& ctlendpoints, hostport_list_t& forward_peers, hostport_list_t& reverse_peers);
@@ -289,19 +289,19 @@ class ChmEventSock : public ChmEventBase
289289
bool PxComSendMergeNoSuspend(chmpxid_t chmpxid);
290290
bool PxComReceiveMergeNoSuspend(PCOMHEAD pComHead, PPXCOM_ALL pComAll, PCOMPKT* ppResComPkt);
291291
bool PxComSendMergeSuspendGet(int sock, chmpxid_t chmpxid);
292-
bool PxComReceiveMergeSuspendGet(PCOMHEAD pComHead, PPXCOM_ALL pComAll, PCOMPKT* ppResComPkt);
292+
bool PxComReceiveMergeSuspendGet(PCOMHEAD pComHead, const PPXCOM_ALL pComAll, PCOMPKT* ppResComPkt);
293293
bool PxComReceiveMergeSuspendRes(PCOMHEAD pComHead, PPXCOM_ALL pComAll);
294294
bool PxComSendServerDown(chmpxid_t chmpxid, chmpxid_t downchmpxid);
295295
bool PxComReceiveServerDown(PCOMHEAD pComHead, PPXCOM_ALL pComAll, PCOMPKT* ppResComPkt);
296296

297-
bool PxCltReceiveJoinNotify(PCOMHEAD pComHead, PPXCLT_ALL pComAll);
297+
bool PxCltReceiveJoinNotify(const PCOMHEAD pComHead, const PPXCLT_ALL pComAll);
298298

299299
bool PxComSendReqUpdateData(chmpxid_t chmpxid, const PPXCOMMON_MERGE_PARAM pmerge_param);
300300
bool PxComReceiveReqUpdateData(PCOMHEAD pComHead, PPXCOM_ALL pComAll, PCOMPKT* ppResComPkt);
301-
bool PxComReceiveResUpdateData(PCOMHEAD pComHead, PPXCOM_ALL pComAll);
302-
bool PxComReceiveResultUpdateData(PCOMHEAD pComHead, PPXCOM_ALL pComAll);
301+
bool PxComReceiveResUpdateData(const PCOMHEAD pComHead, PPXCOM_ALL pComAll);
302+
bool PxComReceiveResultUpdateData(const PCOMHEAD pComHead, PPXCOM_ALL pComAll);
303303
bool PxComSendVersionReq(int sock, chmpxid_t chmpxid, bool need_sock_close); // 1.0.71 or later
304-
bool PxComReceiveVersionReq(int sock, PCOMHEAD pComHead, PPXCOM_ALL pComAll); // 1.0.71 or later
304+
bool PxComReceiveVersionReq(int sock, PCOMHEAD pComHead, const PPXCOM_ALL pComAll); // 1.0.71 or later
305305
bool PxComReceiveVersionRes(PCOMHEAD pComHead, PPXCOM_ALL pComAll, PCOMPKT* ppResComPkt, comver_t& com_proto_version); // 1.0.71 or later
306306

307307
public:

lib/chmimdata.cc

+2
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,8 @@ off_t ChmIMData::GetLockOffsetForMQ(void) const
969969
ERR_CHMPRN("There is no attached ChmShm.");
970970
return 0L;
971971
}
972+
// cppcheck-suppress unmatchedSuppression
973+
// cppcheck-suppress clarifyCondition
972974
long* rel_freemsgcnt = CHM_REL(pChmShm, &(pChmShm->info.free_msg_count), long*);
973975
return reinterpret_cast<off_t>(rel_freemsgcnt);
974976
}

lib/chmsigcntrl.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ ChmSigCntrl::~ChmSigCntrl()
8989
{
9090
}
9191

92-
bool ChmSigCntrl::Initialize(int* psignums, int count)
92+
bool ChmSigCntrl::Initialize(const int* psignums, int count)
9393
{
9494
ChmSigCntrl::GetHelper().Lock();
9595

lib/chmsigcntrl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ChmSigCntrl
4747
ChmSigCntrl(void);
4848
virtual ~ChmSigCntrl();
4949

50-
bool Initialize(int* psignums, int count);
50+
bool Initialize(const int* psignums, int count);
5151
bool GetSignalMask(sigset_t& sigset);
5252
bool SetSignalProcMask(void);
5353
bool SetHandler(int signum, sighandler_t handler) { return SetHandlerEx(signum, handler, false); }

lib/chmssnss.cc

+2
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,8 @@ bool ChmSecureSock::SetBlockingMode(PRFileDesc* SSSession, bool is_blocking)
10461046
return true;
10471047
}
10481048

1049+
// cppcheck-suppress unmatchedSuppression
1050+
// cppcheck-suppress constParameter
10491051
bool ChmSecureSock::CheckResultSSL(int sock, ChmSSSession sslsession, long action_result, int type, bool& is_retry, bool& is_close, int retrycnt, suseconds_t waittime)
10501052
{
10511053
if(CHM_INVALID_SOCK == sock || !sslsession || !IS_SAFE_CHKRESULTSSL_TYPE(type)){

0 commit comments

Comments
 (0)