Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trackrdrd
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
trackrdrd
Commits
97c6e426
Commit
97c6e426
authored
Mar 18, 2017
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enforce const and restrict in the parser interface.
parent
16ee4716
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
parse.c
src/parse.c
+7
-4
trackrdrd.h
src/trackrdrd.h
+6
-3
No files found.
src/parse.c
View file @
97c6e426
...
@@ -39,7 +39,8 @@
...
@@ -39,7 +39,8 @@
#include "vas.h"
#include "vas.h"
static
int
static
int
parse_UnsignedDec
(
const
char
*
str
,
int
len
,
unsigned
*
num
)
parse_UnsignedDec
(
const
char
*
const
restrict
str
,
const
int
len
,
unsigned
*
const
restrict
num
)
{
{
unsigned
new
;
unsigned
new
;
*
num
=
0
;
*
num
=
0
;
...
@@ -58,8 +59,9 @@ parse_UnsignedDec(const char *str, int len, unsigned *num)
...
@@ -58,8 +59,9 @@ parse_UnsignedDec(const char *str, int len, unsigned *num)
len is length from that char to end of data
len is length from that char to end of data
*/
*/
int
int
Parse_VCL_Log
(
const
char
*
ptr
,
int
len
,
const
char
**
data
,
int
*
datalen
,
Parse_VCL_Log
(
const
char
*
const
ptr
,
const
int
len
,
vcl_log_t
*
type
)
const
char
**
const
restrict
data
,
int
*
const
restrict
datalen
,
vcl_log_t
*
const
restrict
type
)
{
{
const
char
*
c
=
ptr
;
const
char
*
c
=
ptr
;
...
@@ -83,7 +85,8 @@ Parse_VCL_Log(const char *ptr, int len, const char **data, int *datalen,
...
@@ -83,7 +85,8 @@ Parse_VCL_Log(const char *ptr, int len, const char **data, int *datalen,
}
}
int
int
Parse_Timestamp
(
const
char
*
ptr
,
int
len
,
struct
timeval
*
t
)
Parse_Timestamp
(
const
char
*
const
restrict
ptr
,
const
int
len
,
struct
timeval
*
const
restrict
t
)
{
{
unsigned
num
;
unsigned
num
;
const
char
*
p
=
ptr
+
(
sizeof
(
"Resp: "
)
-
1
);
const
char
*
p
=
ptr
+
(
sizeof
(
"Resp: "
)
-
1
);
...
...
src/trackrdrd.h
View file @
97c6e426
...
@@ -288,6 +288,9 @@ void MON_StatsUpdate(stats_update_t update, unsigned nchunks, unsigned nbytes);
...
@@ -288,6 +288,9 @@ void MON_StatsUpdate(stats_update_t update, unsigned nchunks, unsigned nbytes);
/* Whether a VCL_Log entry contains a data payload or a shard key */
/* Whether a VCL_Log entry contains a data payload or a shard key */
typedef
enum
{
VCL_LOG_DATA
,
VCL_LOG_KEY
}
vcl_log_t
;
typedef
enum
{
VCL_LOG_DATA
,
VCL_LOG_KEY
}
vcl_log_t
;
int
Parse_VCL_Log
(
const
char
*
ptr
,
int
len
,
const
char
**
data
,
int
*
datalen
,
int
Parse_VCL_Log
(
const
char
*
const
ptr
,
int
len
,
vcl_log_t
*
type
);
const
char
**
const
restrict
data
,
int
Parse_Timestamp
(
const
char
*
ptr
,
int
len
,
struct
timeval
*
t
);
int
*
const
restrict
datalen
,
vcl_log_t
*
const
restrict
type
);
int
Parse_Timestamp
(
const
char
*
const
restrict
ptr
,
int
len
,
struct
timeval
*
const
restrictt
);
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