Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sven Gestegård Robertz
LabComm
Commits
a6f1423c
Commit
a6f1423c
authored
May 16, 2013
by
Anders Blomdell
Browse files
Made C declarations use explicitly sized integer types (stdint.h)
parent
8dfb066b
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/C_CodeGen.jrag
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);
}
...
...
Write
Preview
Supports
Markdown
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