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
5bfc7d38
Commit
5bfc7d38
authored
Feb 26, 2009
by
Claes pwr46/data0/x4-6-0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Size check of input and float format changed to %g
parent
7ed6d14a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
38 deletions
+38
-38
xtt/lib/xtt/src/xtt_xnav.cpp
xtt/lib/xtt/src/xtt_xnav.cpp
+38
-38
No files found.
xtt/lib/xtt/src/xtt_xnav.cpp
View file @
5bfc7d38
...
...
@@ -441,9 +441,9 @@ void XNav::attrvalue_to_string( int type_id, pwr_tTid tid, void *value_ptr,
switch
(
type_id
)
{
case
pwr_eType_Boolean
:
{
if
(
!
format
)
*
len
=
s
printf
(
str
,
"%d"
,
*
(
pwr_tBoolean
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
"%d"
,
*
(
pwr_tBoolean
*
)
value_ptr
);
else
*
len
=
s
printf
(
str
,
format
,
*
(
pwr_tBoolean
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
format
,
*
(
pwr_tBoolean
*
)
value_ptr
);
break
;
}
case
pwr_eType_Float32
:
{
...
...
@@ -457,38 +457,38 @@ void XNav::attrvalue_to_string( int type_id, pwr_tTid tid, void *value_ptr,
}
else
{
if
(
!
format
)
*
len
=
s
printf
(
str
,
"%f
"
,
*
(
float
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
"%g
"
,
*
(
float
*
)
value_ptr
);
else
*
len
=
s
printf
(
str
,
format
,
*
(
float
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
format
,
*
(
float
*
)
value_ptr
);
}
break
;
}
case
pwr_eType_Float64
:
{
if
(
!
format
)
*
len
=
s
printf
(
str
,
"%f
"
,
*
(
double
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
"%g
"
,
*
(
double
*
)
value_ptr
);
else
*
len
=
s
printf
(
str
,
format
,
*
(
double
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
format
,
*
(
double
*
)
value_ptr
);
break
;
}
case
pwr_eType_Char
:
{
if
(
!
format
)
*
len
=
s
printf
(
str
,
"%c"
,
*
(
char
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
"%c"
,
*
(
char
*
)
value_ptr
);
else
*
len
=
s
printf
(
str
,
format
,
*
(
char
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
format
,
*
(
char
*
)
value_ptr
);
break
;
}
case
pwr_eType_Int8
:
{
if
(
!
format
)
*
len
=
s
printf
(
str
,
"%d"
,
*
(
char
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
"%d"
,
*
(
char
*
)
value_ptr
);
else
*
len
=
s
printf
(
str
,
format
,
*
(
char
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
format
,
*
(
char
*
)
value_ptr
);
break
;
}
case
pwr_eType_Int16
:
{
if
(
!
format
)
*
len
=
s
printf
(
str
,
"%hd"
,
*
(
short
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
"%hd"
,
*
(
short
*
)
value_ptr
);
else
*
len
=
s
printf
(
str
,
format
,
*
(
short
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
format
,
*
(
short
*
)
value_ptr
);
break
;
}
case
pwr_eType_Int32
:
{
...
...
@@ -502,47 +502,47 @@ void XNav::attrvalue_to_string( int type_id, pwr_tTid tid, void *value_ptr,
}
else
{
if
(
!
format
)
*
len
=
s
printf
(
str
,
"%d"
,
*
(
int
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
"%d"
,
*
(
int
*
)
value_ptr
);
else
*
len
=
s
printf
(
str
,
format
,
*
(
int
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
format
,
*
(
int
*
)
value_ptr
);
}
break
;
}
case
pwr_eType_Int64
:
{
if
(
!
format
)
*
len
=
s
printf
(
str
,
"%lld"
,
*
(
pwr_tInt64
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
"%lld"
,
*
(
pwr_tInt64
*
)
value_ptr
);
else
*
len
=
s
printf
(
str
,
format
,
*
(
pwr_tInt64
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
format
,
*
(
pwr_tInt64
*
)
value_ptr
);
break
;
}
case
pwr_eType_UInt8
:
{
if
(
!
format
)
*
len
=
s
printf
(
str
,
"%u"
,
*
(
unsigned
char
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
"%u"
,
*
(
unsigned
char
*
)
value_ptr
);
else
*
len
=
s
printf
(
str
,
format
,
*
(
unsigned
char
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
format
,
*
(
unsigned
char
*
)
value_ptr
);
break
;
}
case
pwr_eType_UInt16
:
{
if
(
!
format
)
*
len
=
s
printf
(
str
,
"%hu"
,
*
(
unsigned
short
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
"%hu"
,
*
(
unsigned
short
*
)
value_ptr
);
else
*
len
=
s
printf
(
str
,
format
,
*
(
unsigned
short
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
format
,
*
(
unsigned
short
*
)
value_ptr
);
break
;
}
case
pwr_eType_UInt32
:
case
pwr_eType_Mask
:
case
pwr_eType_DisableAttr
:
{
if
(
!
format
)
*
len
=
s
printf
(
str
,
"%u"
,
*
(
unsigned
int
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
"%u"
,
*
(
unsigned
int
*
)
value_ptr
);
else
*
len
=
s
printf
(
str
,
format
,
*
(
unsigned
int
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
format
,
*
(
unsigned
int
*
)
value_ptr
);
break
;
}
case
pwr_eType_UInt64
:
{
if
(
!
format
)
*
len
=
s
printf
(
str
,
"%llu"
,
*
(
pwr_tUInt64
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
"%llu"
,
*
(
pwr_tUInt64
*
)
value_ptr
);
else
*
len
=
s
printf
(
str
,
format
,
*
(
pwr_tUInt64
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
format
,
*
(
pwr_tUInt64
*
)
value_ptr
);
break
;
}
case
pwr_eType_Enum
:
{
...
...
@@ -565,9 +565,9 @@ void XNav::attrvalue_to_string( int type_id, pwr_tTid tid, void *value_ptr,
}
if
(
!
converted
)
{
if
(
!
format
)
*
len
=
s
printf
(
str
,
"%d"
,
*
(
unsigned
int
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
"%d"
,
*
(
unsigned
int
*
)
value_ptr
);
else
*
len
=
s
printf
(
str
,
format
,
*
(
unsigned
int
*
)
value_ptr
);
*
len
=
s
nprintf
(
str
,
size
,
format
,
*
(
unsigned
int
*
)
value_ptr
);
break
;
}
break
;
...
...
@@ -606,7 +606,7 @@ void XNav::attrvalue_to_string( int type_id, pwr_tTid tid, void *value_ptr,
*
len
=
0
;
break
;
}
*
len
=
s
printf
(
str
,
"%s"
,
hiername
);
*
len
=
s
nprintf
(
str
,
size
,
"%s"
,
hiername
);
break
;
}
case
pwr_eType_AttrRef
:
{
...
...
@@ -619,7 +619,7 @@ void XNav::attrvalue_to_string( int type_id, pwr_tTid tid, void *value_ptr,
*
len
=
0
;
break
;
}
*
len
=
s
printf
(
str
,
"%s"
,
hiername
);
*
len
=
s
nprintf
(
str
,
size
,
"%s"
,
hiername
);
break
;
}
case
pwr_eType_DataRef
:
{
...
...
@@ -633,7 +633,7 @@ void XNav::attrvalue_to_string( int type_id, pwr_tTid tid, void *value_ptr,
*
len
=
0
;
break
;
}
*
len
=
s
printf
(
str
,
"%s"
,
hiername
);
*
len
=
s
nprintf
(
str
,
size
,
"%s"
,
hiername
);
break
;
}
case
pwr_eType_Time
:
{
...
...
@@ -641,7 +641,7 @@ void XNav::attrvalue_to_string( int type_id, pwr_tTid tid, void *value_ptr,
timstr
,
sizeof
(
timstr
));
if
(
EVEN
(
sts
))
strcpy
(
timstr
,
"-"
);
*
len
=
s
printf
(
str
,
"%s"
,
timstr
);
*
len
=
s
nprintf
(
str
,
size
,
"%s"
,
timstr
);
break
;
}
case
pwr_eType_DeltaTime
:
{
...
...
@@ -649,12 +649,12 @@ void XNav::attrvalue_to_string( int type_id, pwr_tTid tid, void *value_ptr,
timstr
,
sizeof
(
timstr
));
if
(
EVEN
(
sts
))
strcpy
(
timstr
,
"Undefined time"
);
*
len
=
s
printf
(
str
,
"%s"
,
timstr
);
*
len
=
s
nprintf
(
str
,
size
,
"%s"
,
timstr
);
break
;
}
case
pwr_eType_ObjectIx
:
{
*
len
=
s
printf
(
str
,
"%s"
,
cdh_ObjectIxToString
(
NULL
,
*
(
pwr_tObjectIx
*
)
value_ptr
,
1
));
*
len
=
s
nprintf
(
str
,
size
,
"%s"
,
cdh_ObjectIxToString
(
NULL
,
*
(
pwr_tObjectIx
*
)
value_ptr
,
1
));
break
;
}
case
pwr_eType_ClassId
:
{
...
...
@@ -667,7 +667,7 @@ void XNav::attrvalue_to_string( int type_id, pwr_tTid tid, void *value_ptr,
*
len
=
0
;
break
;
}
*
len
=
s
printf
(
str
,
"%s"
,
hiername
);
*
len
=
s
nprintf
(
str
,
size
,
"%s"
,
hiername
);
break
;
}
case
pwr_eType_TypeId
:
...
...
@@ -681,16 +681,16 @@ void XNav::attrvalue_to_string( int type_id, pwr_tTid tid, void *value_ptr,
*
len
=
0
;
break
;
}
*
len
=
s
printf
(
str
,
"%s"
,
hiername
);
*
len
=
s
nprintf
(
str
,
size
,
"%s"
,
hiername
);
break
;
}
case
pwr_eType_VolumeId
:
{
*
len
=
s
printf
(
str
,
"%s"
,
cdh_VolumeIdToString
(
NULL
,
*
len
=
s
nprintf
(
str
,
size
,
"%s"
,
cdh_VolumeIdToString
(
NULL
,
*
(
pwr_tVolumeId
*
)
value_ptr
,
1
,
0
));
break
;
}
case
pwr_eType_RefId
:
{
*
len
=
s
printf
(
str
,
"%s"
,
cdh_SubidToString
(
NULL
,
*
len
=
s
nprintf
(
str
,
size
,
"%s"
,
cdh_SubidToString
(
NULL
,
*
(
pwr_tSubid
*
)
value_ptr
,
1
));
break
;
}
...
...
@@ -707,7 +707,7 @@ void XNav::attrvalue_to_string( int type_id, pwr_tTid tid, void *value_ptr,
timstr
,
sizeof
(
timstr
));
if
(
EVEN
(
sts
))
strcpy
(
timstr
,
"Undefined time"
);
*
len
=
s
printf
(
str
,
"%s"
,
timstr
);
*
len
=
s
nprintf
(
str
,
size
,
"%s"
,
timstr
);
break
;
}
case
xnav_eType_GdbNodeFlags
:
{
...
...
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