~ubuntu-branches/ubuntu/raring/codeblocks/raring-proposed

« back to all changes in this revision

Viewing changes to src/include/scripting/squirrel/sqfuncproto.h

  • Committer: Bazaar Package Importer
  • Author(s): Cosme Domínguez Díaz
  • Date: 2010-08-09 04:38:38 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20100809043838-a59ygguym4eg0jgw
Tags: 10.05-0ubuntu1
* New upstream release. Closes (LP: #322350)
 - Switch to dpkg-source 3.0 (quilt) format
 - Remove unneeded README.source
 - Add debian/get-source-orig script that removes all
   Windows prebuilt binaries
* Bump Standards-Version to 3.9.1
 - Stop shipping *.la files
* debian/control
 - Add cdbs package as Build-Depend
 - Add libbz2-dev and zlib1g-dev packages as
   Build-Depends (needed by libhelp_plugin.so)
 - Remove dpatch package of Build-Depends
 - Add codeblocks-contrib-debug package
 - Split architecture-independent files of codeblocks
   package in codeblocks-common package
* debian/rules
 - Switch to CDBS rules system
 - Add parallel build support
 - Add a call to debian/get-source-orig script
 - Use lzma compression (saves 23,5 MB of free space)
* debian/patches
 - Refresh 01_codeblocks_plugin_path
 - Add 02_no_Makefiles_in_debian_dir to remove any link
   in codeblocks build system to deleted Makefiles of debian directory
 - Drop 02_ftbfs_gcc44 and 03_ftbfs_glib221 (merged in upstream)
* debian/watch
 - Update to use the new host (berlios.de)

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
typedef sqvector<SQLocalVarInfo> SQLocalVarInfoVec;
54
54
typedef sqvector<SQLineInfo> SQLineInfoVec;
55
55
 
56
 
#define _FUNC_SIZE(ni,nl,nparams,nfuncs,nouters,nlineinf,localinf) (sizeof(SQFunctionProto) \
 
56
#define _FUNC_SIZE(ni,nl,nparams,nfuncs,nouters,nlineinf,localinf,defparams) (sizeof(SQFunctionProto) \
57
57
                +((ni-1)*sizeof(SQInstruction))+(nl*sizeof(SQObjectPtr)) \
58
58
                +(nparams*sizeof(SQObjectPtr))+(nfuncs*sizeof(SQObjectPtr)) \
59
59
                +(nouters*sizeof(SQOuterVar))+(nlineinf*sizeof(SQLineInfo)) \
60
 
                +(localinf*sizeof(SQLocalVarInfo)))
 
60
                +(localinf*sizeof(SQLocalVarInfo))+(defparams*sizeof(SQInteger)))
61
61
 
62
62
#define _CONSTRUCT_VECTOR(type,size,ptr) { \
63
63
        for(SQInteger n = 0; n < size; n++) { \
80
80
        static SQFunctionProto *Create(SQInteger ninstructions,
81
81
                SQInteger nliterals,SQInteger nparameters,
82
82
                SQInteger nfunctions,SQInteger noutervalues,
83
 
                SQInteger nlineinfos,SQInteger nlocalvarinfos)
 
83
                SQInteger nlineinfos,SQInteger nlocalvarinfos,SQInteger ndefaultparams)
84
84
        {
85
85
                SQFunctionProto *f;
86
86
                //I compact the whole class and members in a single memory allocation
87
 
                f = (SQFunctionProto *)sq_vm_malloc(_FUNC_SIZE(ninstructions,nliterals,nparameters,nfunctions,noutervalues,nlineinfos,nlocalvarinfos));
 
87
                f = (SQFunctionProto *)sq_vm_malloc(_FUNC_SIZE(ninstructions,nliterals,nparameters,nfunctions,noutervalues,nlineinfos,nlocalvarinfos,ndefaultparams));
88
88
                new (f) SQFunctionProto;
89
89
                f->_ninstructions = ninstructions;
90
90
                f->_literals = (SQObjectPtr*)&f->_instructions[ninstructions];
99
99
                f->_nlineinfos = nlineinfos;
100
100
                f->_localvarinfos = (SQLocalVarInfo *)&f->_lineinfos[nlineinfos];
101
101
                f->_nlocalvarinfos = nlocalvarinfos;
 
102
                f->_defaultparams = (SQInteger *)&f->_localvarinfos[nlocalvarinfos];
 
103
                f->_ndefaultparams = ndefaultparams;
102
104
 
103
105
                _CONSTRUCT_VECTOR(SQObjectPtr,f->_nliterals,f->_literals);
104
106
                _CONSTRUCT_VECTOR(SQObjectPtr,f->_nparameters,f->_parameters);
115
117
                _DESTRUCT_VECTOR(SQOuterVar,_noutervalues,_outervalues);
116
118
                //_DESTRUCT_VECTOR(SQLineInfo,_nlineinfos,_lineinfos); //not required are 2 integers
117
119
                _DESTRUCT_VECTOR(SQLocalVarInfo,_nlocalvarinfos,_localvarinfos);
118
 
                SQInteger size = _FUNC_SIZE(_ninstructions,_nliterals,_nparameters,_nfunctions,_noutervalues,_nlineinfos,_nlocalvarinfos);
 
120
                SQInteger size = _FUNC_SIZE(_ninstructions,_nliterals,_nparameters,_nfunctions,_noutervalues,_nlineinfos,_nlocalvarinfos,_ndefaultparams);
119
121
                this->~SQFunctionProto();
120
122
                sq_vm_free(this,size);
121
123
        }
147
149
 
148
150
        SQInteger _noutervalues;
149
151
        SQOuterVar *_outervalues;
 
152
 
 
153
        SQInteger _ndefaultparams;
 
154
        SQInteger *_defaultparams;
150
155
        
151
156
        SQInteger _ninstructions;
152
157
        SQInstruction _instructions[1];