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
0682df68
Commit
0682df68
authored
Jun 18, 2013
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wb_attribute contstructor element index ambiguity fix
parent
946b7365
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
7 deletions
+10
-7
wb/lib/wb/src/wb_attribute.cpp
wb/lib/wb/src/wb_attribute.cpp
+8
-5
wb/lib/wb/src/wb_attribute.h
wb/lib/wb/src/wb_attribute.h
+1
-1
wb/lib/wb/src/wb_volume.cpp
wb/lib/wb/src/wb_volume.cpp
+1
-1
No files found.
wb/lib/wb/src/wb_attribute.cpp
View file @
0682df68
...
...
@@ -231,7 +231,7 @@ wb_attribute::wb_attribute(pwr_tStatus sts, wb_orep* orep, const char *bname, co
}
}
wb_attribute
::
wb_attribute
(
const
wb_attribute
&
pa
,
int
idx
,
const
char
*
aname
)
:
wb_attribute
::
wb_attribute
(
const
wb_attribute
&
pa
,
int
pidx
,
const
char
*
aname
,
int
aidx
)
:
wb_status
(
LDH__NOSUCHATTR
),
m_orep
(
0
),
m_adrep
(
0
),
m_size
(
0
),
m_offset
(
0
),
m_tid
(
0
),
m_elements
(
1
),
m_type
(
pwr_eType_
),
m_flags
(
0
),
m_bix
(
pwr_eBix__
),
m_body
(
0
),
m_shadowed
(
false
)
{
...
...
@@ -243,20 +243,23 @@ wb_attribute::wb_attribute(const wb_attribute& pa, int idx, const char *aname) :
return
;
if
(
pa
.
m_flags
&
PWR_MASK_ARRAY
&&
(
idx
<
0
||
idx
>=
pa
.
m_elements
))
(
pidx
<
0
||
p
idx
>=
pa
.
m_elements
))
throw
wb_error_str
(
"Invalid subscript"
);
if
(
pidx
==
-
1
)
pidx
=
pa
.
m_idx
;
strcpy
(
attrname
,
pa
.
attrName
());
if
(
pa
.
m_flags
&
PWR_MASK_ARRAY
)
{
if
(
attrname
[
strlen
(
attrname
)
-
1
]
==
']'
)
{
// Replace the index
char
*
s
=
strrchr
(
attrname
,
'['
);
if
(
s
)
sprintf
(
s
,
"[%d]"
,
idx
);
sprintf
(
s
,
"[%d]"
,
p
idx
);
}
else
// Add index
sprintf
(
&
attrname
[
strlen
(
attrname
)],
"[%d]"
,
idx
);
sprintf
(
&
attrname
[
strlen
(
attrname
)],
"[%d]"
,
p
idx
);
}
strcat
(
attrname
,
"."
);
if
(
aname
!=
0
)
...
...
@@ -312,7 +315,7 @@ wb_attribute::wb_attribute(const wb_attribute& pa, int idx, const char *aname) :
m_elements
=
m_adrep
->
nElement
();
m_flags
=
m_adrep
->
flags
();
m_type
=
m_adrep
->
type
();
m_idx
=
idx
;
m_idx
=
a
idx
;
m_orep
=
pa
.
m_orep
;
m_orep
->
ref
();
...
...
wb/lib/wb/src/wb_attribute.h
View file @
0682df68
...
...
@@ -86,7 +86,7 @@ public:
wb_attribute
(
pwr_tStatus
,
wb_orep
*
,
wb_adrep
*
,
int
idx
=
-
1
);
wb_attribute
(
pwr_tStatus
,
wb_orep
*
,
const
char
*
bname
);
wb_attribute
(
pwr_tStatus
,
wb_orep
*
,
const
char
*
bname
,
const
char
*
aname
);
wb_attribute
(
const
wb_attribute
&
pa
,
int
idx
,
const
char
*
aname
);
wb_attribute
(
const
wb_attribute
&
pa
,
int
pidx
,
const
char
*
aname
,
int
aidx
=
0
);
~
wb_attribute
();
wb_attribute
&
operator
=
(
const
wb_attribute
&
);
...
...
wb/lib/wb/src/wb_volume.cpp
View file @
0682df68
...
...
@@ -531,7 +531,7 @@ pwr_tStatus wb_volume::syntaxCheckAttr(wb_attribute& a, int *errorcount, int *wa
if
(
adef
.
flags
()
&
PWR_MASK_ARRAY
)
{
for
(
int
i
=
0
;
i
<
adef
.
nElement
();
i
++
)
{
wb_attribute
attr
(
a
,
i
,
adef
.
name
()
);
wb_attribute
attr
(
a
,
-
1
,
adef
.
name
(),
i
);
asts
=
syntaxCheckAttr
(
attr
,
errorcount
,
warningcount
);
if
(
EVEN
(
asts
))
sts
=
asts
;
...
...
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