Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hammer
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vyrus
hammer
Commits
8f427b5a
Commit
8f427b5a
authored
11 years ago
by
Meredith L. Patterson
Committed by
Dan Hirsch
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fixed nested unions
parent
49f22e2a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/bindings/swig/hammer.i
+1
-0
1 addition, 0 deletions
src/bindings/swig/hammer.i
src/hammer.h
+27
-0
27 additions, 0 deletions
src/hammer.h
with
28 additions
and
0 deletions
src/bindings/swig/hammer.i
+
1
−
0
View file @
8f427b5a
...
...
@@ -2,3 +2,4 @@
%
import
"
hammer/allocator.h
"
%
import
"
hammer/hammer.h
"
This diff is collapsed.
Click to expand it.
src/hammer.h
+
27
−
0
View file @
8f427b5a
...
...
@@ -70,8 +70,21 @@ typedef struct HBytes_ {
size_t
len
;
}
HBytes
;
#ifdef SWIG
typedef
union
{
HBytes
bytes
;
int64_t
sint
;
uint64_t
uint
;
double
dbl
;
float
flt
;
HCountedArray
*
seq
;
void
*
user
;
}
HTokenData
;
#endif
typedef
struct
HParsedToken_
{
HTokenType
token_type
;
#ifndef SWIG
union
{
HBytes
bytes
;
int64_t
sint
;
...
...
@@ -81,6 +94,9 @@ typedef struct HParsedToken_ {
HCountedArray
*
seq
;
// a sequence of HParsedToken's
void
*
user
;
};
#else
HTokenData
token_data
;
#endif
size_t
index
;
char
bit_offset
;
}
HParsedToken
;
...
...
@@ -144,12 +160,23 @@ typedef struct HParserTestcase_ {
char
*
output_unambiguous
;
}
HParserTestcase
;
#ifdef SWIG
typedef
union
{
const
char
*
actual_results
;
size_t
parse_time
;
}
HResultTiming
;
#endif
typedef
struct
HCaseResult_
{
bool
success
;
#ifndef SWIG
union
{
const
char
*
actual_results
;
// on failure, filled in with the results of h_write_result_unamb
size_t
parse_time
;
// on success, filled in with time for a single parse, in nsec
};
#else
HResultTiming
timestamp
;
#endif
}
HCaseResult
;
typedef
struct
HBackendResults_
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment