Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
f3513a79
Commit
f3513a79
authored
Oct 21, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more snprintf...
parent
63920158
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
126 additions
and
126 deletions
+126
-126
ndb/src/common/debugger/EventLogger.cpp
ndb/src/common/debugger/EventLogger.cpp
+105
-105
ndb/src/common/logger/FileLogHandler.cpp
ndb/src/common/logger/FileLogHandler.cpp
+2
-2
ndb/src/common/logger/LogHandler.cpp
ndb/src/common/logger/LogHandler.cpp
+2
-2
ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp
ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp
+1
-1
ndb/src/common/logger/loggertest/LoggerUnitTest.cpp
ndb/src/common/logger/loggertest/LoggerUnitTest.cpp
+1
-1
ndb/src/common/util/File.cpp
ndb/src/common/util/File.cpp
+2
-2
ndb/src/common/util/NdbErrHnd.cpp
ndb/src/common/util/NdbErrHnd.cpp
+8
-8
ndb/src/mgmsrv/ConfigInfo.cpp
ndb/src/mgmsrv/ConfigInfo.cpp
+4
-4
ndb/test/ndbapi/userInterface.cpp
ndb/test/ndbapi/userInterface.cpp
+1
-1
No files found.
ndb/src/common/debugger/EventLogger.cpp
View file @
f3513a79
This diff is collapsed.
Click to expand it.
ndb/src/common/logger/FileLogHandler.cpp
View file @
f3513a79
...
...
@@ -153,11 +153,11 @@ FileLogHandler::createNewFile()
if
(
fileNo
>=
m_maxNoFiles
)
{
fileNo
=
1
;
::
snprintf
(
newName
,
sizeof
(
newName
),
BaseString
::
snprintf
(
newName
,
sizeof
(
newName
),
"%s.%d"
,
m_pLogFile
->
getName
(),
fileNo
);
break
;
}
::
snprintf
(
newName
,
sizeof
(
newName
),
BaseString
::
snprintf
(
newName
,
sizeof
(
newName
),
"%s.%d"
,
m_pLogFile
->
getName
(),
fileNo
++
);
}
while
(
File_class
::
exists
(
newName
));
...
...
ndb/src/common/logger/LogHandler.cpp
View file @
f3513a79
...
...
@@ -45,7 +45,7 @@ LogHandler::getDefaultHeader(char* pStr, const char* pCategory,
Logger
::
LoggerLevel
level
)
const
{
char
time
[
MAX_DATE_TIME_HEADER_LENGTH
];
::
snprintf
(
pStr
,
MAX_HEADER_LENGTH
,
"%s [%s] %s -- "
,
BaseString
::
snprintf
(
pStr
,
MAX_HEADER_LENGTH
,
"%s [%s] %s -- "
,
getTimeAsString
((
char
*
)
time
),
pCategory
,
Logger
::
LoggerLevelNames
[
level
]);
...
...
@@ -84,7 +84,7 @@ LogHandler::getTimeAsString(char* pStr) const
tm_now
=
::
localtime
(
&
now
);
//uses the "current" timezone
#endif
::
snprintf
(
pStr
,
MAX_DATE_TIME_HEADER_LENGTH
,
BaseString
::
snprintf
(
pStr
,
MAX_DATE_TIME_HEADER_LENGTH
,
m_pDateTimeFormat
,
tm_now
->
tm_year
+
1900
,
tm_now
->
tm_mon
+
1
,
//month is [0,11]. +1 -> [1,12]
...
...
ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp
View file @
f3513a79
...
...
@@ -128,7 +128,7 @@ LogHandlerListUnitTest::testTraverseNext(const char* msg)
{
char
*
str
=
new
char
[
3
];
pHandlers
[
i
]
=
new
ConsoleLogHandler
();
::
snprintf
(
str
,
3
,
"%d"
,
i
);
BaseString
::
snprintf
(
str
,
3
,
"%d"
,
i
);
pHandlers
[
i
]
->
setDateTimeFormat
(
str
);
list
.
add
(
pHandlers
[
i
]);
}
...
...
ndb/src/common/logger/loggertest/LoggerUnitTest.cpp
View file @
f3513a79
...
...
@@ -86,7 +86,7 @@ NDB_COMMAND(loggertest, "loggertest", "loggertest -console | -file",
{
ndbout
<<
"-- "
<<
" Test "
<<
i
+
1
<<
" ["
<<
testCases
[
i
].
name
<<
"] --"
<<
endl
;
::
snprintf
(
str
,
256
,
"%s %s %s %d"
,
"Logging "
,
BaseString
::
snprintf
(
str
,
256
,
"%s %s %s %d"
,
"Logging "
,
testCases
[
i
].
name
,
" message "
,
i
);
if
(
testCases
[
i
].
test
(
str
))
{
...
...
ndb/src/common/util/File.cpp
View file @
f3513a79
...
...
@@ -83,7 +83,7 @@ File_class::File_class(const char* aFileName, const char* mode) :
m_file
(
NULL
),
m_fileMode
(
mode
)
{
::
snprintf
(
m_fileName
,
MAX_FILE_NAME_SIZE
,
aFileName
);
BaseString
::
snprintf
(
m_fileName
,
MAX_FILE_NAME_SIZE
,
aFileName
);
}
bool
...
...
@@ -99,7 +99,7 @@ File_class::open(const char* aFileName, const char* mode)
/**
* Only copy if it's not the same string
*/
::
snprintf
(
m_fileName
,
MAX_FILE_NAME_SIZE
,
aFileName
);
BaseString
::
snprintf
(
m_fileName
,
MAX_FILE_NAME_SIZE
,
aFileName
);
}
m_fileMode
=
mode
;
bool
rc
=
true
;
...
...
ndb/src/common/util/NdbErrHnd.cpp
View file @
f3513a79
...
...
@@ -346,15 +346,15 @@ extern "C" OSBOOLEAN ndb_err_hnd(bool user_called,
file_name
=
"ose_err.h"
;
}
snprintf
(
error_message
.
header1
,
BaseString
::
snprintf
(
error_message
.
header1
,
BUFSIZE
,
"This is the OSE Example System Error handler
\r\n
"
);
snprintf
(
error_message
.
err_hnd_file
,
BaseString
::
snprintf
(
error_message
.
err_hnd_file
,
BUFSIZE
,
"located in: "
__FILE__
"
\r\n
"
);
snprintf
(
error_message
.
header2
,
BaseString
::
snprintf
(
error_message
.
header2
,
BUFSIZE
,
"An Error has been reported:
\r\n
"
);
...
...
@@ -371,28 +371,28 @@ extern "C" OSBOOLEAN ndb_err_hnd(bool user_called,
user_called
);
}
snprintf
(
error_message
.
error_code_line
,
BaseString
::
snprintf
(
error_message
.
error_code_line
,
BUFSIZE
,
"error code: 0x%08x
\r\n
"
,
error_code
);
snprintf
(
error_message
.
subcode_line
,
BaseString
::
snprintf
(
error_message
.
subcode_line
,
BUFSIZE
,
" subcode: %s (0x%08x)
\r\n
"
,
subcode_mnemonic
,
(
subcode
<<
16
));
snprintf
(
error_message
.
product_line
,
BaseString
::
snprintf
(
error_message
.
product_line
,
BUFSIZE
,
" product: %s
\r\n
"
,
product_name
);
snprintf
(
error_message
.
header_file_line
,
BaseString
::
snprintf
(
error_message
.
header_file_line
,
BUFSIZE
,
" header file: %s
\r\n
"
,
file_name
);
snprintf
(
error_message
.
extra_line
,
BaseString
::
snprintf
(
error_message
.
extra_line
,
BUFSIZE
,
"extra: 0x%08x
\r\n
"
,
extra
);
...
...
ndb/src/mgmsrv/ConfigInfo.cpp
View file @
f3513a79
...
...
@@ -3405,9 +3405,9 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>§ions,
s
.
m_sectionType
=
BaseString
(
"TCP"
);
s
.
m_sectionData
=
new
Properties
(
true
);
char
buf
[
16
];
snprintf
(
buf
,
sizeof
(
buf
),
"%u"
,
nodeId1
);
BaseString
::
snprintf
(
buf
,
sizeof
(
buf
),
"%u"
,
nodeId1
);
s
.
m_sectionData
->
put
(
"NodeId1"
,
buf
);
snprintf
(
buf
,
sizeof
(
buf
),
"%u"
,
nodeId2
);
BaseString
::
snprintf
(
buf
,
sizeof
(
buf
),
"%u"
,
nodeId2
);
s
.
m_sectionData
->
put
(
"NodeId2"
,
buf
);
sections
.
push_back
(
s
);
}
...
...
@@ -3422,9 +3422,9 @@ add_node_connections(Vector<ConfigInfo::ConfigRuleSection>§ions,
s
.
m_sectionType
=
BaseString
(
"TCP"
);
s
.
m_sectionData
=
new
Properties
(
true
);
char
buf
[
16
];
snprintf
(
buf
,
sizeof
(
buf
),
"%u"
,
nodeId1
);
BaseString
::
snprintf
(
buf
,
sizeof
(
buf
),
"%u"
,
nodeId1
);
s
.
m_sectionData
->
put
(
"NodeId1"
,
buf
);
snprintf
(
buf
,
sizeof
(
buf
),
"%u"
,
nodeId2
);
BaseString
::
snprintf
(
buf
,
sizeof
(
buf
),
"%u"
,
nodeId2
);
s
.
m_sectionData
->
put
(
"NodeId2"
,
buf
);
sections
.
push_back
(
s
);
}
...
...
ndb/test/ndbapi/userInterface.cpp
View file @
f3513a79
...
...
@@ -103,7 +103,7 @@ void showTime()
now
=
::
time
((
time_t
*
)
NULL
);
tm_now
=
::
gmtime
(
&
now
);
::
snprintf
(
buf
,
128
,
BaseString
::
snprintf
(
buf
,
128
,
"%d-%.2d-%.2d %.2d:%.2d:%.2d"
,
tm_now
->
tm_year
+
1900
,
tm_now
->
tm_mon
,
...
...
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