Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
a92eeafd
Commit
a92eeafd
authored
Nov 26, 2018
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor fixes: used 'const' if possible..
parent
e6b637c7
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
23 additions
and
23 deletions
+23
-23
RRDServer.cc
extensions/RRDServer/RRDServer.cc
+2
-2
UniExchange.cc
extensions/UniNetwork/UniExchange.cc
+2
-2
UniExchange.h
extensions/UniNetwork/UniExchange.h
+1
-1
Calibration.cc
extensions/lib/Calibration.cc
+3
-3
DigitalFilter.cc
extensions/lib/DigitalFilter.cc
+5
-5
TestProc.cc
extensions/tests/MBSlaveTest/TestProc.cc
+1
-1
TestProc.cc
extensions/tests/SMemoryTest/TestProc.cc
+1
-1
ModbusTypes.cc
src/Communications/Modbus/ModbusTypes.cc
+2
-2
Configuration.cc
src/Core/Configuration.cc
+2
-2
IOController.cc
src/Processes/IOController.cc
+1
-1
ProxyManager.cc
src/Processes/ProxyManager.cc
+2
-2
test_mutex.cc
tests/test_mutex.cc
+1
-1
No files found.
extensions/RRDServer/RRDServer.cc
View file @
a92eeafd
...
@@ -227,10 +227,10 @@ void RRDServer::initRRD( xmlNode* cnode, int tmID )
...
@@ -227,10 +227,10 @@ void RRDServer::initRRD( xmlNode* cnode, int tmID )
int
k
=
0
;
int
k
=
0
;
for
(
auto
&
i
:
rrdparamist
)
for
(
const
auto
&
i
:
rrdparamist
)
argv
[
k
++
]
=
strdup
(
i
.
c_str
());
argv
[
k
++
]
=
strdup
(
i
.
c_str
());
for
(
auto
&
i
:
rralist
)
for
(
const
auto
&
i
:
rralist
)
argv
[
k
++
]
=
strdup
(
i
.
c_str
());
argv
[
k
++
]
=
strdup
(
i
.
c_str
());
// for( k=0; k<argc; k++ )
// for( k=0; k<argc; k++ )
...
...
extensions/UniNetwork/UniExchange.cc
View file @
a92eeafd
...
@@ -288,7 +288,7 @@ IOController_i::ShortMapSeq* UniExchange::getSensors()
...
@@ -288,7 +288,7 @@ IOController_i::ShortMapSeq* UniExchange::getSensors()
int
i
=
0
;
int
i
=
0
;
for
(
auto
&
it
:
mymap
)
for
(
const
auto
&
it
:
mymap
)
{
{
IOController_i
::
ShortMap
m
;
IOController_i
::
ShortMap
m
;
{
{
...
@@ -327,7 +327,7 @@ void UniExchange::updateLocalData()
...
@@ -327,7 +327,7 @@ void UniExchange::updateLocalData()
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
void
UniExchange
::
initIterators
()
void
UniExchange
::
initIterators
()
{
{
for
(
auto
&
it
:
mymap
)
for
(
auto
&
&
it
:
mymap
)
shm
->
initIterator
(
it
.
ioit
);
shm
->
initIterator
(
it
.
ioit
);
}
}
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
...
...
extensions/UniNetwork/UniExchange.h
View file @
a92eeafd
...
@@ -100,7 +100,7 @@ namespace uniset
...
@@ -100,7 +100,7 @@ namespace uniset
long
val
;
long
val
;
long
id
;
long
id
;
UniversalIO
::
IOType
type
;
UniversalIO
::
IOType
type
;
uniset
::
uniset_rwmutex
val_lock
;
mutable
uniset
::
uniset_rwmutex
val_lock
;
};
};
typedef
std
::
vector
<
SInfo
>
SList
;
typedef
std
::
vector
<
SInfo
>
SList
;
...
...
extensions/lib/Calibration.cc
View file @
a92eeafd
...
@@ -348,7 +348,7 @@ namespace uniset
...
@@ -348,7 +348,7 @@ namespace uniset
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
long
Calibration
::
getRawValue
(
const
long
cal
,
bool
range
)
const
long
Calibration
::
getRawValue
(
const
long
cal
,
bool
range
)
const
{
{
for
(
auto
&
it
:
pvec
)
for
(
const
auto
&
it
:
pvec
)
{
{
TypeOfValue
q
=
it
.
getX
(
cal
);
TypeOfValue
q
=
it
.
getX
(
cal
);
...
@@ -372,7 +372,7 @@ namespace uniset
...
@@ -372,7 +372,7 @@ namespace uniset
{
{
os
<<
"*******************"
<<
endl
;
os
<<
"*******************"
<<
endl
;
for
(
auto
&
it
:
c
.
pvec
)
for
(
const
auto
&
it
:
c
.
pvec
)
{
{
os
<<
"["
<<
it
.
leftPoint
().
x
<<
" : "
<<
it
.
rightPoint
().
x
<<
" ] --> ["
os
<<
"["
<<
it
.
leftPoint
().
x
<<
" : "
<<
it
.
rightPoint
().
x
<<
" ] --> ["
<<
it
.
leftPoint
().
y
<<
" : "
<<
it
.
rightPoint
().
y
<<
" ]"
<<
it
.
leftPoint
().
y
<<
" : "
<<
it
.
rightPoint
().
y
<<
" ]"
...
@@ -387,7 +387,7 @@ namespace uniset
...
@@ -387,7 +387,7 @@ namespace uniset
{
{
os
<<
"*******************"
<<
endl
;
os
<<
"*******************"
<<
endl
;
for
(
auto
&
it
:
c
->
pvec
)
for
(
const
auto
&
it
:
c
->
pvec
)
{
{
os
<<
"["
<<
it
.
leftPoint
().
x
<<
" : "
<<
it
.
rightPoint
().
x
<<
" ] --> ["
os
<<
"["
<<
it
.
leftPoint
().
x
<<
" : "
<<
it
.
rightPoint
().
x
<<
" ] --> ["
<<
it
.
leftPoint
().
y
<<
" : "
<<
it
.
rightPoint
().
y
<<
" ]"
<<
it
.
leftPoint
().
y
<<
" : "
<<
it
.
rightPoint
().
y
<<
" ]"
...
...
extensions/lib/DigitalFilter.cc
View file @
a92eeafd
...
@@ -105,7 +105,7 @@ namespace uniset
...
@@ -105,7 +105,7 @@ namespace uniset
// считаем среднее арифметическое
// считаем среднее арифметическое
M
=
0
;
M
=
0
;
for
(
auto
&
i
:
buf
)
for
(
const
auto
&
i
:
buf
)
M
=
M
+
i
;
M
=
M
+
i
;
M
=
M
/
buf
.
size
();
M
=
M
/
buf
.
size
();
...
@@ -114,7 +114,7 @@ namespace uniset
...
@@ -114,7 +114,7 @@ namespace uniset
S
=
0
;
S
=
0
;
double
r
=
0
;
double
r
=
0
;
for
(
auto
&
i
:
buf
)
for
(
const
auto
&
i
:
buf
)
{
{
r
=
M
-
i
;
r
=
M
-
i
;
S
=
S
+
r
*
r
;
S
=
S
+
r
*
r
;
...
@@ -130,7 +130,7 @@ namespace uniset
...
@@ -130,7 +130,7 @@ namespace uniset
int
n
=
0
;
int
n
=
0
;
double
val
=
0
;
// Конечное среднее значение
double
val
=
0
;
// Конечное среднее значение
for
(
auto
&
i
:
buf
)
for
(
const
auto
&
i
:
buf
)
{
{
if
(
fabs
(
M
-
i
)
<
S
*
2
)
// откидываем
if
(
fabs
(
M
-
i
)
<
S
*
2
)
// откидываем
{
{
...
@@ -209,7 +209,7 @@ namespace uniset
...
@@ -209,7 +209,7 @@ namespace uniset
{
{
os
<<
"("
<<
d
.
buf
.
size
()
<<
")["
;
os
<<
"("
<<
d
.
buf
.
size
()
<<
")["
;
for
(
auto
&
i
:
d
.
buf
)
for
(
const
auto
&
i
:
d
.
buf
)
os
<<
" "
<<
setw
(
5
)
<<
i
;
os
<<
" "
<<
setw
(
5
)
<<
i
;
os
<<
" ]"
;
os
<<
" ]"
;
...
@@ -292,7 +292,7 @@ namespace uniset
...
@@ -292,7 +292,7 @@ namespace uniset
add
(
newval
);
add
(
newval
);
for
(
auto
&
i
:
buf
)
for
(
const
auto
&
i
:
buf
)
aver
+=
i
;
aver
+=
i
;
aver
/=
maxsize
;
aver
/=
maxsize
;
...
...
extensions/tests/MBSlaveTest/TestProc.cc
View file @
a92eeafd
...
@@ -137,7 +137,7 @@ void TestProc::timerInfo( const TimerMessage* tm )
...
@@ -137,7 +137,7 @@ void TestProc::timerInfo( const TimerMessage* tm )
cerr
<<
"======= TEST LOG PRINT ======"
<<
endl
;
cerr
<<
"======= TEST LOG PRINT ======"
<<
endl
;
cerr
<<
"LOGLEVEL: ["
<<
(
int
)(
*
lit
)
<<
"] "
<<
(
*
lit
)
<<
endl
;
cerr
<<
"LOGLEVEL: ["
<<
(
int
)(
*
lit
)
<<
"] "
<<
(
*
lit
)
<<
endl
;
for
(
auto
&
it
:
loglevels
)
for
(
const
auto
&
it
:
loglevels
)
mylog
->
debug
(
it
)
<<
myname
<<
": test log print..."
<<
endl
;
mylog
->
debug
(
it
)
<<
myname
<<
": test log print..."
<<
endl
;
cerr
<<
"======= END LOG PRINT ======"
<<
endl
;
cerr
<<
"======= END LOG PRINT ======"
<<
endl
;
...
...
extensions/tests/SMemoryTest/TestProc.cc
View file @
a92eeafd
...
@@ -113,7 +113,7 @@ void TestProc::timerInfo( const TimerMessage* tm )
...
@@ -113,7 +113,7 @@ void TestProc::timerInfo( const TimerMessage* tm )
cerr
<<
"======= TEST LOG PRINT ======"
<<
endl
;
cerr
<<
"======= TEST LOG PRINT ======"
<<
endl
;
cerr
<<
"LOGLEVEL: ["
<<
(
int
)(
*
lit
)
<<
"] "
<<
(
*
lit
)
<<
endl
;
cerr
<<
"LOGLEVEL: ["
<<
(
int
)(
*
lit
)
<<
"] "
<<
(
*
lit
)
<<
endl
;
for
(
auto
&
it
:
loglevels
)
for
(
const
auto
&
it
:
loglevels
)
mylog
->
debug
(
it
)
<<
myname
<<
": test log print..."
<<
endl
;
mylog
->
debug
(
it
)
<<
myname
<<
": test log print..."
<<
endl
;
cerr
<<
"======= END LOG PRINT ======"
<<
endl
;
cerr
<<
"======= END LOG PRINT ======"
<<
endl
;
...
...
src/Communications/Modbus/ModbusTypes.cc
View file @
a92eeafd
...
@@ -2750,7 +2750,7 @@ namespace uniset
...
@@ -2750,7 +2750,7 @@ namespace uniset
{
{
os
<<
endl
;
os
<<
endl
;
for
(
auto
&
it
:
m
.
dlist
)
for
(
const
auto
&
it
:
m
.
dlist
)
os
<<
" "
<<
rdi2str
(
it
.
id
)
<<
" : "
<<
it
.
val
<<
endl
;
os
<<
" "
<<
rdi2str
(
it
.
id
)
<<
" : "
<<
it
.
val
<<
endl
;
}
}
...
@@ -2766,7 +2766,7 @@ namespace uniset
...
@@ -2766,7 +2766,7 @@ namespace uniset
{
{
if
(
!
dlist
.
empty
()
)
if
(
!
dlist
.
empty
()
)
{
{
for
(
auto
&
it
:
dlist
)
for
(
const
auto
&
it
:
dlist
)
os
<<
" "
<<
rdi2str
(
it
.
id
)
<<
" : "
<<
it
.
val
<<
endl
;
os
<<
" "
<<
rdi2str
(
it
.
id
)
<<
" : "
<<
it
.
val
<<
endl
;
}
}
...
...
src/Core/Configuration.cc
View file @
a92eeafd
...
@@ -389,7 +389,7 @@ namespace uniset
...
@@ -389,7 +389,7 @@ namespace uniset
int
i
=
0
;
int
i
=
0
;
// формируем новые, используя i в качестве индекса
// формируем новые, используя i в качестве индекса
for
(
auto
&
it
:
lnodes
)
for
(
const
auto
&
it
:
lnodes
)
{
{
// делаем uni_strdup чтобы потом не думая
// делаем uni_strdup чтобы потом не думая
// "где мы выделяли, а где не мы"
// "где мы выделяли, а где не мы"
...
@@ -415,7 +415,7 @@ namespace uniset
...
@@ -415,7 +415,7 @@ namespace uniset
assert
(
i
<
onum
);
assert
(
i
<
onum
);
}
}
for
(
auto
&
p
:
omniParams
)
for
(
const
auto
&
p
:
omniParams
)
{
{
// делаем uni_strdup чтобы потом не думая
// делаем uni_strdup чтобы потом не думая
// "где мы выделяли, а где не мы"
// "где мы выделяли, а где не мы"
...
...
src/Processes/IOController.cc
View file @
a92eeafd
...
@@ -484,7 +484,7 @@ IOController_i::SensorInfoSeq* IOController::getSensorsMap()
...
@@ -484,7 +484,7 @@ IOController_i::SensorInfoSeq* IOController::getSensorsMap()
unsigned
int
i
=
0
;
unsigned
int
i
=
0
;
for
(
auto
&
it
:
ioList
)
for
(
const
auto
&
it
:
ioList
)
{
{
uniset_rwmutex_rlock
lock
(
it
.
second
->
val_lock
);
uniset_rwmutex_rlock
lock
(
it
.
second
->
val_lock
);
(
*
res
)[
i
]
=
*
(
it
.
second
.
get
());
(
*
res
)[
i
]
=
*
(
it
.
second
.
get
());
...
...
src/Processes/ProxyManager.cc
View file @
a92eeafd
...
@@ -73,7 +73,7 @@ bool ProxyManager::activateObject()
...
@@ -73,7 +73,7 @@ bool ProxyManager::activateObject()
return
false
;
return
false
;
// Регистрируемся от имени объектов
// Регистрируемся от имени объектов
for
(
auto
&
it
:
omap
)
for
(
const
auto
&
it
:
omap
)
{
{
try
try
{
{
...
@@ -163,7 +163,7 @@ void ProxyManager::processingMessage( const uniset::VoidMessage* msg )
...
@@ -163,7 +163,7 @@ void ProxyManager::processingMessage( const uniset::VoidMessage* msg )
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
void
ProxyManager
::
allMessage
(
const
uniset
::
VoidMessage
*
msg
)
void
ProxyManager
::
allMessage
(
const
uniset
::
VoidMessage
*
msg
)
{
{
for
(
auto
&
o
:
omap
)
for
(
const
auto
&
o
:
omap
)
{
{
try
try
{
{
...
...
tests/test_mutex.cc
View file @
a92eeafd
...
@@ -147,7 +147,7 @@ TEST_CASE("uniset_rwmutex_{wr|r} thread lock", "[mutex][threadlock][basic]" )
...
@@ -147,7 +147,7 @@ TEST_CASE("uniset_rwmutex_{wr|r} thread lock", "[mutex][threadlock][basic]" )
msleep
(
10
);
msleep
(
10
);
// read захватывают сразу без задержек..
// read захватывают сразу без задержек..
for
(
auto
&
&
i
:
vr
)
for
(
auto
&
i
:
vr
)
{
{
if
(
i
.
valid
()
)
if
(
i
.
valid
()
)
REQUIRE
(
i
.
get
()
==
true
);
REQUIRE
(
i
.
get
()
==
true
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment