Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abseil-cpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
abseil-cpp
Commits
4791df7d
Unverified
Commit
4791df7d
authored
Feb 09, 2018
by
Daniel M. Katz
Committed by
GitHub
Feb 09, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #91 from gjasny/printf-attributes
Annotate printf-like functions as such
parents
8311b419
4f459039
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
absl/base/internal/raw_logging.cc
+7
-0
No files found.
absl/base/internal/raw_logging.cc
View file @
4791df7d
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include <cstdlib>
#include <cstdlib>
#include <cstring>
#include <cstring>
#include "absl/base/attributes.h"
#include "absl/base/config.h"
#include "absl/base/config.h"
#include "absl/base/internal/atomic_hook.h"
#include "absl/base/internal/atomic_hook.h"
#include "absl/base/log_severity.h"
#include "absl/base/log_severity.h"
...
@@ -81,6 +82,8 @@ static const char kTruncated[] = " ... (message truncated)\n";
...
@@ -81,6 +82,8 @@ static const char kTruncated[] = " ... (message truncated)\n";
// consumed bytes, and return whether the message fit without truncation. If
// consumed bytes, and return whether the message fit without truncation. If
// truncation occurred, if possible leave room in the buffer for the message
// truncation occurred, if possible leave room in the buffer for the message
// kTruncated[].
// kTruncated[].
inline
static
bool
VADoRawLog
(
char
**
buf
,
int
*
size
,
const
char
*
format
,
va_list
ap
)
ABSL_PRINTF_ATTRIBUTE
(
3
,
0
);
inline
static
bool
VADoRawLog
(
char
**
buf
,
int
*
size
,
inline
static
bool
VADoRawLog
(
char
**
buf
,
int
*
size
,
const
char
*
format
,
va_list
ap
)
{
const
char
*
format
,
va_list
ap
)
{
int
n
=
vsnprintf
(
*
buf
,
*
size
,
format
,
ap
);
int
n
=
vsnprintf
(
*
buf
,
*
size
,
format
,
ap
);
...
@@ -129,6 +132,8 @@ bool DoRawLog(char** buf, int* size, const char* format, ...) {
...
@@ -129,6 +132,8 @@ bool DoRawLog(char** buf, int* size, const char* format, ...) {
}
}
void
RawLogVA
(
absl
::
LogSeverity
severity
,
const
char
*
file
,
int
line
,
void
RawLogVA
(
absl
::
LogSeverity
severity
,
const
char
*
file
,
int
line
,
const
char
*
format
,
va_list
ap
)
ABSL_PRINTF_ATTRIBUTE
(
4
,
0
);
void
RawLogVA
(
absl
::
LogSeverity
severity
,
const
char
*
file
,
int
line
,
const
char
*
format
,
va_list
ap
)
{
const
char
*
format
,
va_list
ap
)
{
char
buffer
[
kLogBufSize
];
char
buffer
[
kLogBufSize
];
char
*
buf
=
buffer
;
char
*
buf
=
buffer
;
...
@@ -204,6 +209,8 @@ void SafeWriteToStderr(const char *s, size_t len) {
...
@@ -204,6 +209,8 @@ void SafeWriteToStderr(const char *s, size_t len) {
}
}
void
RawLog
(
absl
::
LogSeverity
severity
,
const
char
*
file
,
int
line
,
void
RawLog
(
absl
::
LogSeverity
severity
,
const
char
*
file
,
int
line
,
const
char
*
format
,
...)
ABSL_PRINTF_ATTRIBUTE
(
4
,
5
);
void
RawLog
(
absl
::
LogSeverity
severity
,
const
char
*
file
,
int
line
,
const
char
*
format
,
...)
{
const
char
*
format
,
...)
{
va_list
ap
;
va_list
ap
;
va_start
(
ap
,
format
);
va_start
(
ap
,
format
);
...
...
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