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
a5b7e561
Commit
a5b7e561
authored
Jan 18, 2007
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Calculation of max input size for attributes improved
parent
6eef3267
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
88 additions
and
75 deletions
+88
-75
src/lib/co/src/co_cdh.c
src/lib/co/src/co_cdh.c
+74
-1
src/lib/co/src/co_cdh.h
src/lib/co/src/co_cdh.h
+3
-1
wb/lib/wb/src/wb_wattnav.cpp
wb/lib/wb/src/wb_wattnav.cpp
+3
-18
wb/lib/wb/src/wb_wnav.cpp
wb/lib/wb/src/wb_wnav.cpp
+5
-36
xtt/lib/xtt/src/xtt_xattnav.cpp
xtt/lib/xtt/src/xtt_xattnav.cpp
+3
-19
No files found.
src/lib/co/src/co_cdh.c
View file @
a5b7e561
/**
* Proview $Id: co_cdh.c,v 1.1
8 2007-01-04 07:51:42
claes Exp $
* Proview $Id: co_cdh.c,v 1.1
9 2007-01-18 07:49:00
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -2621,6 +2621,79 @@ void cdh_SuppressSuper( char *out, char *in)
s
+=
6
;
strcpy
(
out
,
s
);
}
int
cdh_TypeToMaxStrSize
(
pwr_eType
type
,
int
attr_size
,
int
attr_elements
)
{
int
size
;
switch
(
type
)
{
case
pwr_eType_Boolean
:
size
=
1
;
break
;
case
pwr_eType_Int64
:
size
=
20
;
break
;
case
pwr_eType_UInt64
:
size
=
20
;
break
;
case
pwr_eType_Enum
:
case
pwr_eType_Mask
:
case
pwr_eType_Status
:
case
pwr_eType_NetStatus
:
case
pwr_eType_Int32
:
size
=
11
;
break
;
case
pwr_eType_UInt32
:
size
=
10
;
break
;
case
pwr_eType_Int16
:
size
=
6
;
break
;
case
pwr_eType_UInt16
:
size
=
5
;
break
;
case
pwr_eType_Int8
:
size
=
4
;
break
;
case
pwr_eType_UInt8
:
size
=
3
;
break
;
case
pwr_eType_Char
:
size
=
1
;
break
;
case
pwr_eType_Float32
:
size
=
40
;
break
;
case
pwr_eType_Float64
:
size
=
40
;
break
;
case
pwr_eType_Time
:
size
=
23
;
break
;
case
pwr_eType_DeltaTime
:
size
=
40
;
break
;
case
pwr_eType_AttrRef
:
size
=
sizeof
(
pwr_tAName
)
-
1
;
break
;
case
pwr_eType_TypeId
:
case
pwr_eType_ClassId
:
case
pwr_eType_Objid
:
size
=
sizeof
(
pwr_tOName
)
-
1
;
break
;
case
pwr_eType_VolumeId
:
size
=
sizeof
(
pwr_tObjName
)
-
1
;
break
;
case
pwr_eType_String
:
case
pwr_eType_Text
:
size
=
attr_size
/
attr_elements
;
break
;
default:
size
=
80
;
}
return
size
;
}
/*@}*/
...
...
src/lib/co/src/co_cdh.h
View file @
a5b7e561
/**
* Proview $Id: co_cdh.h,v 1.2
4 2007-01-04 07:51:42
claes Exp $
* Proview $Id: co_cdh.h,v 1.2
5 2007-01-18 07:49:00
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -1005,6 +1005,8 @@ pwr_sAttrRef cdh_ArefAdd( pwr_sAttrRef *arp1, pwr_sAttrRef *arp2);
void
cdh_SuppressSuper
(
char
*
out
,
char
*
in
);
int
cdh_TypeToMaxStrSize
(
pwr_eType
type
,
int
attr_size
,
int
attr_elements
);
/*@}*/
#ifdef __cplusplus
...
...
wb/lib/wb/src/wb_wattnav.cpp
View file @
a5b7e561
/*
* Proview $Id: wb_wattnav.cpp,v 1.1
5 2007-01-15 13:23:17
claes Exp $
* Proview $Id: wb_wattnav.cpp,v 1.1
6 2007-01-18 07:49:19
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -126,23 +126,8 @@ int WAttNav::check_attr( int *multiline, brow_tObject *node,
wnav_attrvalue_to_string
(
ldhses
,
item
->
type_id
,
p
,
init_value
,
&
len
);
free
(
p
);
switch
(
item
->
type_id
)
{
case
pwr_eType_Objid
:
case
pwr_eType_AttrRef
:
case
pwr_eType_ClassId
:
*
size
=
sizeof
(
pwr_tOName
)
-
1
;
break
;
case
pwr_eType_VolumeId
:
case
pwr_eType_TypeId
:
*
size
=
sizeof
(
pwr_tObjName
)
-
1
;
break
;
case
pwr_eType_Time
:
case
pwr_eType_DeltaTime
:
*
size
=
40
;
break
;
default:
*
size
=
item
->
size
;
}
*
size
=
cdh_TypeToMaxStrSize
(
(
pwr_eType
)
item
->
type_id
,
item
->
size
,
1
);
if
(
item
->
type_id
==
pwr_eType_Text
)
*
multiline
=
1
;
else
...
...
wb/lib/wb/src/wb_wnav.cpp
View file @
a5b7e561
/*
* Proview $Id: wb_wnav.cpp,v 1.3
4 2007-01-15 13:23:45
claes Exp $
* Proview $Id: wb_wnav.cpp,v 1.3
5 2007-01-18 07:49:19
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -739,23 +739,7 @@ int WNav::check_attr_value( brow_tObject node, int *multiline,
&
len
);
free
(
p
);
switch
(
item
->
type_id
)
{
case
pwr_eType_Objid
:
case
pwr_eType_AttrRef
:
case
pwr_eType_ClassId
:
*
size
=
sizeof
(
pwr_tOName
)
-
1
;
break
;
case
pwr_eType_VolumeId
:
case
pwr_eType_TypeId
:
*
size
=
sizeof
(
pwr_tObjName
)
-
1
;
break
;
case
pwr_eType_Time
:
case
pwr_eType_DeltaTime
:
*
size
=
40
;
break
;
default:
*
size
=
item
->
size
;
}
*
size
=
cdh_TypeToMaxStrSize
(
(
pwr_eType
)
item
->
type_id
,
item
->
size
,
1
);
if
(
item
->
type_id
==
pwr_eType_Text
)
*
multiline
=
1
;
...
...
@@ -780,23 +764,8 @@ int WNav::check_attr_value( brow_tObject node, int *multiline,
&
len
);
free
(
p
);
switch
(
item
->
type_id
)
{
case
pwr_eType_Objid
:
case
pwr_eType_AttrRef
:
case
pwr_eType_ClassId
:
*
size
=
sizeof
(
pwr_tOName
)
-
1
;
break
;
case
pwr_eType_VolumeId
:
case
pwr_eType_TypeId
:
*
size
=
sizeof
(
pwr_tObjName
)
-
1
;
break
;
case
pwr_eType_Time
:
case
pwr_eType_DeltaTime
:
*
size
=
40
;
break
;
default:
*
size
=
item
->
size
;
}
*
size
=
cdh_TypeToMaxStrSize
(
(
pwr_eType
)
item
->
type_id
,
item
->
size
,
1
);
if
(
item
->
type_id
==
pwr_eType_Text
)
*
multiline
=
1
;
else
...
...
@@ -2689,7 +2658,7 @@ int WNav::volume_attached( ldh_tWBContext wbcontext, ldh_tSesContext ldhsession,
ldhses
=
ldhsession
;
wbctx
=
wbcontext
;
wccm_store_ldhses
(
(
void
*
)
this
,
ldhses
);
if
(
window_type
!=
wnav_eWindowType_No
)
if
(
brow
&&
window_type
!=
wnav_eWindowType_No
)
show_volume
(
pop
);
return
1
;
}
...
...
xtt/lib/xtt/src/xtt_xattnav.cpp
View file @
a5b7e561
/*
* Proview $Id: xtt_xattnav.cpp,v 1.1
7 2007-01-15 13:18:00
claes Exp $
* Proview $Id: xtt_xattnav.cpp,v 1.1
8 2007-01-18 07:49:28
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -115,24 +115,8 @@ int XAttNav::check_attr( int *multiline, brow_tObject *node, char *name,
strcpy
(
name
,
item
->
attr
);
sts
=
gdh_GetAttributeCharacteristics
(
name
,
&
a_tid
,
&
a_size
,
&
a_offs
,
&
a_elem
);
if
(
ODD
(
sts
))
{
switch
(
item
->
type_id
)
{
case
pwr_eType_Objid
:
case
pwr_eType_AttrRef
:
case
pwr_eType_ClassId
:
*
size
=
sizeof
(
pwr_tAName
)
-
1
;
case
pwr_eType_VolumeId
:
case
pwr_eType_TypeId
:
*
size
=
sizeof
(
pwr_tObjName
)
-
1
;
break
;
case
pwr_eType_Time
:
case
pwr_eType_DeltaTime
:
*
size
=
40
;
break
;
default:
*
size
=
a_size
/
a_elem
;
}
}
if
(
ODD
(
sts
))
*
size
=
cdh_TypeToMaxStrSize
(
(
pwr_eType
)
item
->
type_id
,
a_size
,
a_elem
);
else
*
size
=
80
;
...
...
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