Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LabComm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Anders Blomdell
LabComm
Commits
a6f1423c
Commit
a6f1423c
authored
11 years ago
by
Anders Blomdell
Browse files
Options
Downloads
Patches
Plain Diff
Made C declarations use explicitly sized integer types (stdint.h)
parent
8dfb066b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
compiler/C_CodeGen.jrag
+8
-4
8 additions, 4 deletions
compiler/C_CodeGen.jrag
with
8 additions
and
4 deletions
compiler/C_CodeGen.jrag
+
8
−
4
View file @
a6f1423c
...
...
@@ -161,6 +161,7 @@ aspect C_CodeGen {
env.println("");
// Include
env.println("#include <stdint.h>");
env.println("#include \"labcomm.h\"");
for (int i = 0 ; i < includes.size() ; i++) {
env.println("#include \"" + includes.get(i) + "\"");
...
...
@@ -260,11 +261,14 @@ aspect C_Type {
public void PrimType.C_emitType(C_env env, String name) {
switch (getToken()) {
case LABCOMM_BOOLEAN: { env.print("unsigned char"); } break;
case LABCOMM_BYTE: { env.print("unsigned char"); } break;
case LABCOMM_BOOLEAN: { env.print("uint8_t"); } break;
case LABCOMM_BYTE: { env.print("uint8_t"); } break;
case LABCOMM_SHORT: { env.print("int16_t"); } break;
case LABCOMM_INT: { env.print("int32_t"); } break;
case LABCOMM_LONG: { env.print("int64_t"); } break;
case LABCOMM_FLOAT: { env.print("float"); } break;
case LABCOMM_DOUBLE: { env.print("double"); } break;
case LABCOMM_STRING: { env.print("char*"); } break;
case LABCOMM_LONG: { env.print("long long"); } break;
default: { env.print(getName()); } break;
}
env.print(" " + name);
}
...
...
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