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
52a2f55d
Commit
52a2f55d
authored
Nov 22, 2005
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix in buffer size
parent
8995c6bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
xtt/lib/xtt/src/xtt_logging.cpp
xtt/lib/xtt/src/xtt_logging.cpp
+19
-5
xtt/lib/xtt/src/xtt_logging.h
xtt/lib/xtt/src/xtt_logging.h
+2
-1
No files found.
xtt/lib/xtt/src/xtt_logging.cpp
View file @
52a2f55d
/*
* Proview $Id: xtt_logging.cpp,v 1.
4 2005-11-04 11:52:35
claes Exp $
* Proview $Id: xtt_logging.cpp,v 1.
5 2005-11-22 12:16:50
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -93,7 +93,8 @@ XttLogging::XttLogging() :
xnav
(
0
),
index
(
0
),
active
(
0
),
intern
(
0
),
stop_logg
(
0
),
logg_type
(
xtt_LoggType_Cont
),
logg_priority
(
0
),
condition_ptr
(
0
),
logg_time
(
200
),
logg_file
(
0
),
line_size
(
10000
),
parameter_count
(
0
),
print_shortname
(
0
),
buffer_size
(
100
),
buffer_count
(
0
),
buffer_ptr
(
0
)
print_shortname
(
0
),
buffer_size
(
100
),
wanted_buffer_size
(
100
),
buffer_count
(
0
),
buffer_ptr
(
0
)
{
for
(
int
i
=
0
;
i
<
RTT_LOGG_MAXPAR
;
i
++
)
{
parameterstr
[
i
][
0
]
=
0
;
...
...
@@ -160,9 +161,10 @@ int XttLogging::logging_set(
if
(
a_buffer_size
!=
0
||
buffer_ptr
==
0
)
{
if
(
a_buffer_size
!=
0
)
if
(
a_buffer_size
!=
0
)
{
buffer_size
=
a_buffer_size
;
wanted_buffer_size
=
a_buffer_size
;
}
/* Reallocate the buffer to store logging info in */
if
(
buffer_ptr
!=
0
)
free
(
buffer_ptr
);
...
...
@@ -172,6 +174,7 @@ int XttLogging::logging_set(
message
(
'E'
,
"Buffer is to large"
);
/* set default buffer */
buffer_size
=
RTT_BUFFER_DEFSIZE
;
wanted_buffer_size
=
RTT_BUFFER_DEFSIZE
;
/* Reallocate the buffer to store logging info in */
buffer_ptr
=
(
char
*
)
calloc
(
1
,
buffer_size
*
512
);
...
...
@@ -485,7 +488,7 @@ int XttLogging::store(
fprintf
(
outfile
,
"logging set/entry=current/time=%d
\n
"
,
logg_time
);
fprintf
(
outfile
,
"logging set/entry=current/buffer=%d
\n
"
,
buffer_size
);
wanted_
buffer_size
);
fprintf
(
outfile
,
"logging set/entry=current/line_size=%d
\n
"
,
line_size
);
fprintf
(
outfile
,
"logging set/entry=current/priority=%d
\n
"
,
...
...
@@ -548,6 +551,17 @@ int XttLogging::start()
return
XNAV__HOLDCOMMAND
;
}
if
(
wanted_buffer_size
!=
buffer_size
)
{
// Reallocate
if
(
buffer_ptr
!=
0
)
free
(
buffer_ptr
);
buffer_ptr
=
(
char
*
)
calloc
(
1
,
wanted_buffer_size
*
512
);
if
(
buffer_ptr
==
0
)
exit
(
XNAV__NOMEMORY
);
buffer_size
=
wanted_buffer_size
;
}
/* Get the parameters */
found
=
0
;
for
(
i
=
0
;
i
<
RTT_LOGG_MAXPAR
;
i
++
)
...
...
xtt/lib/xtt/src/xtt_logging.h
View file @
52a2f55d
/*
* Proview $Id: xtt_logging.h,v 1.
3 2005-10-21 16:11:22
claes Exp $
* Proview $Id: xtt_logging.h,v 1.
4 2005-11-22 12:16:50
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -81,6 +81,7 @@ class XttLogging {
int
parameter_count
;
int
print_shortname
;
int
buffer_size
;
int
wanted_buffer_size
;
int
buffer_count
;
char
*
buffer_ptr
;
...
...
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