Changeset 58775d30 in mainline for tools/autogen.py


Ignore:
Timestamp:
2015-03-16T16:07:21Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2003739
Parents:
6069061 (diff), 795e2bf (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/autogen.py

    r6069061 r58775d30  
    6666        for i in range(len(struct['members'])):
    6767                member = struct['members'][i]
    68                 code = code + ("\temit_constant(%s_OFFSET_%s, offsetof(%s_t, %s));\n" % 
     68                code = code + ("\temit_constant(%s_OFFSET_%s, offsetof(%s_t, %s));\n" %
    6969                    (struct['name'].upper(), member['name'].upper(), struct['name'],
    7070                    member['name']))
    71                 code = code + ("\temit_constant(%s_SIZE_%s, sizeof(((%s_t *) 0)->%s));\n" % 
     71                code = code + ("\temit_constant(%s_SIZE_%s, sizeof(((%s_t *) 0)->%s));\n" %
    7272                    (struct['name'].upper(), member['name'].upper(), struct['name'],
    7373                    member['name']))
    7474                if 'elements' in member.keys():
    75                         code = code + ("\temit_constant(%s_%s_ITEM_SIZE, sizeof(%s));\n" % 
     75                        code = code + ("\temit_constant(%s_%s_ITEM_SIZE, sizeof(%s));\n" %
    7676                            (struct['name'].upper(), member['name'].upper(), member['type']))
    7777                       
     
    8383
    8484        code = """
    85 %s             
     85%s
    8686
    8787#define str(s) #s
     
    9292%s
    9393
    94 int main()
     94extern int main(int, char *[]);
     95
     96int main(int argc, char *argv[])
    9597{
    9698%s
     
    100102        """ % (generate_includes(struct), generate_struct(struct),
    101103            generate_probes(struct), name.upper(), typename)
    102 
     104       
    103105        return code
    104106
     
    167169
    168170run()
    169 
Note: See TracChangeset for help on using the changeset viewer.