Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
ab3f39d7
Commit
ab3f39d7
authored
Sep 12, 2011
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
strcat, sprintf and doc fix
parent
6867b35d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
46 deletions
+46
-46
src/lib/rt/src/rt_gdh.c
src/lib/rt/src/rt_gdh.c
+1
-1
wb/lib/wb/src/wb_c_attrref.cpp
wb/lib/wb/src/wb_c_attrref.cpp
+9
-9
wb/lib/wb/src/wb_c_object.cpp
wb/lib/wb/src/wb_c_object.cpp
+33
-33
wb/lib/wb/src/wb_c_objid.cpp
wb/lib/wb/src/wb_c_objid.cpp
+3
-3
No files found.
src/lib/rt/src/rt_gdh.c
View file @
ab3f39d7
...
...
@@ -3297,7 +3297,7 @@ gdh_RefObjectInfoList (
* pwr_tSubid subid;
* pwr_tFloat32 *valuep;
*
* sts = RefObjectInfo( name, &valuep, &subid, sizeof(*valuep));
* sts =
gdh_
RefObjectInfo( name, &valuep, &subid, sizeof(*valuep));
* if ( EVEN(sts)) throw co_error(sts);
* ...
* sts = gdh_UnrefObjectInfo( subid);
...
...
wb/lib/wb/src/wb_c_attrref.cpp
View file @
ab3f39d7
...
...
@@ -168,9 +168,9 @@ static pwr_tStatus Connect (
sts
=
ldh_AttrRefToName
(
ip
->
PointedSession
,
&
ip
->
Pointed
,
ldh_eName_VolPath
,
&
name_p
,
&
size
);
if
(
ODD
(
sts
))
{
str
cpy
(
name
,
name_p
);
str
cat
(
name
,
"."
);
str
cat
(
name
,
mb
.
MethodArguments
[
0
]
);
str
ncpy
(
name
,
name_p
,
sizeof
(
name
)
);
str
ncat
(
name
,
"."
,
sizeof
(
name
)
);
str
ncat
(
name
,
mb
.
MethodArguments
[
0
],
sizeof
(
name
)
);
sts
=
ldh_NameToAttrRef
(
ip
->
PointedSession
,
name
,
&
PattrRef
);
if
(
ODD
(
sts
))
...
...
@@ -191,8 +191,8 @@ static pwr_tStatus Connect (
if
(
EVEN
(
sts
))
cdh_ObjidToString
(
name
,
aref
.
Objid
,
1
);
else
str
cpy
(
name
,
name_p
);
s
printf
(
msg
,
"%s connected to: %s"
,
mb
.
MethodArguments
[
0
],
name
);
str
ncpy
(
name
,
name_p
,
sizeof
(
name
)
);
s
nprintf
(
msg
,
sizeof
(
msg
)
,
"%s connected to: %s"
,
mb
.
MethodArguments
[
0
],
name
);
ip
->
wtt
->
message
(
'I'
,
msg
);
}
else
{
...
...
@@ -349,8 +349,8 @@ static pwr_tStatus IoConnect (
sts
=
ldh_AttrRefToName
(
ip
->
PointedSession
,
&
ip
->
Pointed
,
ldh_eName_VolPath
,
&
name_p
,
&
size
);
if
(
ODD
(
sts
))
{
str
cpy
(
name
,
name_p
);
str
cat
(
name
,
".IoConnect"
);
str
ncpy
(
name
,
name_p
,
sizeof
(
name
)
);
str
ncat
(
name
,
".IoConnect"
,
sizeof
(
name
)
);
sts
=
ldh_NameToAttrRef
(
ip
->
PointedSession
,
name
,
&
PattrRef
);
if
(
ODD
(
sts
))
...
...
@@ -370,8 +370,8 @@ static pwr_tStatus IoConnect (
if
(
EVEN
(
sts
))
cdh_ObjidToString
(
name
,
aref
.
Objid
,
1
);
else
str
cpy
(
name
,
name_p
);
s
printf
(
msg
,
"Io connected to: %s"
,
name
);
str
ncpy
(
name
,
name_p
,
sizeof
(
name
)
);
s
nprintf
(
msg
,
sizeof
(
msg
)
,
"Io connected to: %s"
,
name
);
ip
->
wtt
->
message
(
'I'
,
msg
);
}
else
{
...
...
wb/lib/wb/src/wb_c_object.cpp
View file @
ab3f39d7
...
...
@@ -334,7 +334,7 @@ static pwr_tStatus DeleteObject (
if
(
sts
==
LDH__HAS_CHILD
)
{
sts
=
ldh_ObjidToName
(
ip
->
PointedSession
,
ip
->
Pointed
.
Objid
,
ldh_eName_Object
,
name
,
sizeof
(
name
),
&
size
);
s
printf
(
msg
,
s
nprintf
(
msg
,
sizeof
(
msg
)
,
"Object '%s' has children!
\n
Do you want to delete the whole object tree ?"
,
name
);
mc
=
(
ldh_sMenuCall
*
)
malloc
(
sizeof
(
*
mc
));
...
...
@@ -517,7 +517,7 @@ static pwr_tStatus OpenTemplate (
ldh_sMenuCall
*
ip
)
{
pwr_tStatus
sts
;
pwr_t
Full
Name
Name
;
pwr_t
O
Name
Name
;
pwr_tObjid
Template
;
pwr_sAttrRef
Aref
;
int
size
;
...
...
@@ -527,7 +527,7 @@ static pwr_tStatus OpenTemplate (
if
(
EVEN
(
sts
))
return
sts
;
str
cat
(
Name
,
"-Template"
);
str
ncat
(
Name
,
"-Template"
,
sizeof
(
Name
)
);
sts
=
ldh_NameToObjid
(
ip
->
PointedSession
,
&
Template
,
Name
);
if
(
EVEN
(
sts
))
return
sts
;
...
...
@@ -542,7 +542,7 @@ static pwr_tStatus SetDefaults (
ldh_sMenuCall
*
ip
)
{
pwr_tStatus
sts
;
pwr_t
Full
Name
Name
;
pwr_t
O
Name
Name
;
pwr_tObjid
Object
;
int
size
;
...
...
@@ -551,7 +551,7 @@ static pwr_tStatus SetDefaults (
if
(
EVEN
(
sts
))
return
sts
;
str
cat
(
Name
,
"-Defaults"
);
str
ncat
(
Name
,
"-Defaults"
,
sizeof
(
Name
)
);
sts
=
ldh_NameToObjid
(
ip
->
PointedSession
,
&
Object
,
Name
);
if
(
EVEN
(
sts
))
return
sts
;
...
...
@@ -578,9 +578,9 @@ static pwr_tStatus ClassHelp( ldh_sMenuCall *ip)
if
(
EVEN
(
sts
))
return
sts
;
if
(
cname
[
0
]
==
'$'
)
s
printf
(
cmd
,
"help %s /strict"
,
&
cname
[
1
]);
s
nprintf
(
cmd
,
sizeof
(
cmd
)
,
"help %s /strict"
,
&
cname
[
1
]);
else
s
printf
(
cmd
,
"help %s /strict"
,
cname
);
s
nprintf
(
cmd
,
sizeof
(
cmd
)
,
"help %s /strict"
,
cname
);
ip
->
wnav
->
command
(
cmd
);
return
1
;
...
...
@@ -612,7 +612,7 @@ static pwr_tStatus HelpClass( ldh_sMenuCall *ip)
if
(
EVEN
(
sts
))
return
sts
;
cdh_ToLower
(
vname
,
vname
);
s
printf
(
cmd
,
"help %s /helpfile=
\"
$pwr_exe/%s/%s_xtthelp.dat
\"
/strict"
,
cname
,
s
nprintf
(
cmd
,
sizeof
(
cmd
)
,
"help %s /helpfile=
\"
$pwr_exe/%s/%s_xtthelp.dat
\"
/strict"
,
cname
,
lng_get_language_str
(),
vname
);
ip
->
wnav
->
command
(
cmd
);
...
...
@@ -620,9 +620,9 @@ static pwr_tStatus HelpClass( ldh_sMenuCall *ip)
}
if
(
cname
[
0
]
==
'$'
)
s
printf
(
cmd
,
"help %s /strict"
,
&
cname
[
1
]);
s
nprintf
(
cmd
,
sizeof
(
cmd
)
,
"help %s /strict"
,
&
cname
[
1
]);
else
s
printf
(
cmd
,
"help %s /strict"
,
cname
);
s
nprintf
(
cmd
,
sizeof
(
cmd
)
,
"help %s /strict"
,
cname
);
ip
->
wnav
->
command
(
cmd
);
return
1
;
...
...
@@ -652,7 +652,7 @@ static pwr_tStatus Help( ldh_sMenuCall *ip)
return
LDH__SUCCESS
;
}
s
printf
(
cmd
,
"help %s /strict"
,
topic
);
s
nprintf
(
cmd
,
sizeof
(
cmd
)
,
"help %s /strict"
,
topic
);
free
(
topic
);
ip
->
wnav
->
command
(
cmd
);
...
...
@@ -882,7 +882,7 @@ static pwr_tStatus configure_attrmask( ldh_sMenuCall *ip, pwr_tAttrRef *parent,
vect_cnt
=
0
;
s
=
strchr
(
str1
,
'('
);
if
(
s
)
{
str
cpy
(
str2
,
s
+
1
);
str
ncpy
(
str2
,
s
+
1
,
sizeof
(
str2
)
);
if
(
str2
[
strlen
(
str2
)
-
1
]
!=
')'
)
return
LDH__COMPSYNTAX
;
...
...
@@ -994,7 +994,7 @@ static pwr_tStatus ConfigureComponent( ldh_sMenuCall *ip)
if
(
sscanf
(
item
[
1
],
"%d"
,
&
disable_mask
)
!=
1
)
disable_mask
=
0
;
str
cpy
(
aname
,
item
[
0
]
);
str
ncpy
(
aname
,
item
[
0
],
sizeof
(
aname
)
);
sts
=
ldh_ArefANameToAref
(
ip
->
PointedSession
,
&
ip
->
Pointed
,
aname
,
&
aaref
);
...
...
@@ -1007,10 +1007,10 @@ static pwr_tStatus ConfigureComponent( ldh_sMenuCall *ip)
}
else
{
// New syntax, eg '(7 (CircuitBreaker 4, Contactor 5))'
char
str1
[
80
];
char
str1
[
256
];
char
*
s
;
str
cpy
(
str1
,
&
mb
.
MethodArguments
[
0
][
1
]
);
str
ncpy
(
str1
,
&
mb
.
MethodArguments
[
0
][
1
],
sizeof
(
str1
)
);
s
=
strrchr
(
str1
,
')'
);
if
(
!
s
)
return
LDH__COMPSYNTAX
;
...
...
@@ -1057,8 +1057,8 @@ static pwr_tStatus ConfigureComponent( ldh_sMenuCall *ip)
if
(
sscanf
(
item
[
1
],
"%d"
,
&
graph_configuration
)
!=
1
)
graph_configuration
=
0
;
str
cpy
(
aname
,
item
[
0
]
);
str
cat
(
aname
,
".GraphConfiguration"
);
str
ncpy
(
aname
,
item
[
0
],
sizeof
(
aname
)
);
str
ncat
(
aname
,
".GraphConfiguration"
,
sizeof
(
aname
)
);
sts
=
ldh_ArefANameToAref
(
ip
->
PointedSession
,
&
ip
->
Pointed
,
aname
,
&
aaref
);
...
...
@@ -1121,7 +1121,7 @@ static pwr_tStatus History( ldh_sMenuCall *ip)
sts
=
ldh_GetObjectPar
(
ip
->
PointedSession
,
ip
->
Pointed
.
Objid
,
"RtBody"
,
"Action"
,
&
action
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
str
cpy
(
item
,
action
);
str
ncpy
(
item
,
action
,
sizeof
(
item
)
);
free
(
action
);
if
(
(
s
=
strstr
(
item
,
".pwg"
)))
...
...
@@ -1129,7 +1129,7 @@ static pwr_tStatus History( ldh_sMenuCall *ip)
else
return
1
;
str
cpy
(
categories
,
mb
.
MethodArguments
[
0
]
);
str
ncpy
(
categories
,
mb
.
MethodArguments
[
0
],
sizeof
(
categories
)
);
showitem
=
1
;
break
;
}
...
...
@@ -1140,10 +1140,10 @@ static pwr_tStatus History( ldh_sMenuCall *ip)
sts
=
ldh_GetObjectPar
(
ip
->
PointedSession
,
ip
->
Pointed
.
Objid
,
"RtBody"
,
"NodeName"
,
&
nodename
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
str
cpy
(
item
,
nodename
);
str
ncpy
(
item
,
nodename
,
sizeof
(
item
)
);
free
(
nodename
);
str
cpy
(
categories
,
mb
.
MethodArguments
[
0
]
);
str
ncpy
(
categories
,
mb
.
MethodArguments
[
0
],
sizeof
(
categories
)
);
showitem
=
1
;
break
;
}
...
...
@@ -1157,26 +1157,26 @@ static pwr_tStatus History( ldh_sMenuCall *ip)
sts
=
ldh_ObjidToName
(
ip
->
PointedSession
,
ip
->
Pointed
.
Objid
,
ldh_eName_Object
,
vname
,
sizeof
(
vname
),
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
str
cpy
(
item
,
vname
);
str
ncpy
(
item
,
vname
,
sizeof
(
item
)
);
str
cpy
(
categories
,
mb
.
MethodArguments
[
0
]
);
str
ncpy
(
categories
,
mb
.
MethodArguments
[
0
],
sizeof
(
categories
)
);
showitem
=
1
;
break
;
}
default:
// Item is object name
str
cpy
(
item
,
oname
);
str
ncpy
(
item
,
oname
,
sizeof
(
item
)
);
str
cpy
(
categories
,
mb
.
MethodArguments
[
0
]
);
str
ncpy
(
categories
,
mb
.
MethodArguments
[
0
],
sizeof
(
categories
)
);
if
(
strcmp
(
mb
.
MethodArguments
[
1
],
"Descendants"
)
==
0
)
{
str
cat
(
item
,
"*"
);
str
ncat
(
item
,
"*"
,
sizeof
(
item
)
);
showitem
=
1
;
}
}
s
printf
(
cmd
,
"open history/item=
\"
%s
\"
/categories=
\"
%s
\"
"
,
item
,
categories
);
s
nprintf
(
cmd
,
sizeof
(
cmd
)
,
"open history/item=
\"
%s
\"
/categories=
\"
%s
\"
"
,
item
,
categories
);
if
(
showitem
)
str
cat
(
cmd
,
"/showitem"
);
str
ncat
(
cmd
,
"/showitem"
,
sizeof
(
cmd
)
);
ip
->
wnav
->
command
(
cmd
);
return
1
;
...
...
@@ -1201,7 +1201,7 @@ static pwr_tStatus Crossreferences( ldh_sMenuCall *ip)
&
namep
,
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
s
printf
(
cmd
,
"cross/wind/name=%s"
,
namep
);
s
nprintf
(
cmd
,
sizeof
(
cmd
)
,
"cross/wind/name=%s"
,
namep
);
ip
->
wnav
->
command
(
cmd
);
return
1
;
...
...
@@ -1226,7 +1226,7 @@ static pwr_tStatus PM_SyntaxCheck( ldh_sMenuCall *ip)
ldh_eName_VolPath
,
oname
,
sizeof
(
oname
),
&
size
);
if
(
EVEN
(
sts
))
return
sts
;
s
printf
(
cmd
,
"check syntax/name=%s"
,
oname
);
s
nprintf
(
cmd
,
sizeof
(
cmd
)
,
"check syntax/name=%s"
,
oname
);
ip
->
wnav
->
command
(
cmd
);
return
1
;
...
...
@@ -1263,8 +1263,8 @@ static pwr_tStatus ConnectAttribute (
if
(
EVEN
(
sts
))
return
0
;
strncpy
(
aname
,
aname_p
,
sizeof
(
aname
));
str
cat
(
aname
,
"."
);
str
cat
(
aname
,
mb
.
MethodArguments
[
0
]
);
str
ncat
(
aname
,
"."
,
sizeof
(
aname
)
);
str
ncat
(
aname
,
mb
.
MethodArguments
[
0
],
sizeof
(
aname
)
);
sts
=
ldh_NameToAttrRef
(
ip
->
PointedSession
,
aname
,
&
PattrRef
);
if
(
ODD
(
sts
))
...
...
@@ -1283,7 +1283,7 @@ static pwr_tStatus ConnectAttribute (
strncpy
(
name
,
aname_p
,
sizeof
(
name
));
else
cdh_ObjidToString
(
name
,
ip
->
Selected
[
0
].
Objid
,
1
);
s
printf
(
msg
,
"%s connected to: %s"
,
mb
.
MethodArguments
[
0
],
name
);
s
nprintf
(
msg
,
sizeof
(
msg
)
,
"%s connected to: %s"
,
mb
.
MethodArguments
[
0
],
name
);
ip
->
wtt
->
message
(
'I'
,
msg
);
}
else
{
...
...
wb/lib/wb/src/wb_c_objid.cpp
View file @
ab3f39d7
...
...
@@ -152,8 +152,8 @@ static pwr_tStatus Connect (
if
(
EVEN
(
sts
))
return
0
;
strncpy
(
aname
,
aname_p
,
sizeof
(
aname
));
str
cat
(
aname
,
"."
);
str
cat
(
aname
,
mb
.
MethodArguments
[
0
]
);
str
ncat
(
aname
,
"."
,
sizeof
(
aname
)
);
str
ncat
(
aname
,
mb
.
MethodArguments
[
0
],
sizeof
(
aname
)
);
sts
=
ldh_NameToAttrRef
(
ip
->
PointedSession
,
aname
,
&
PattrRef
);
//sts = ldh_GetAttrRef(ip->PointedSession, ip->Pointed.Objid,
...
...
@@ -173,7 +173,7 @@ static pwr_tStatus Connect (
name
,
sizeof
(
name
),
&
len
);
if
(
EVEN
(
sts
))
cdh_ObjidToString
(
name
,
ip
->
Selected
[
0
].
Objid
,
1
);
s
printf
(
msg
,
"%s connected to: %s"
,
mb
.
MethodArguments
[
0
],
name
);
s
nprintf
(
msg
,
sizeof
(
msg
)
,
"%s connected to: %s"
,
mb
.
MethodArguments
[
0
],
name
);
ip
->
wtt
->
message
(
'I'
,
msg
);
}
else
{
...
...
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