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

« back to all changes in this revision

Viewing changes to src/include/scripting/squirrel/sqarray.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:
61
61
        void Extend(const SQArray *a);
62
62
        SQObjectPtr &Top(){return _values.top();}
63
63
        void Pop(){_values.pop_back(); ShrinkIfNeeded(); }
64
 
        void Insert(const SQObject& idx,const SQObject &val){_values.insert((SQUnsignedInteger)tointeger(idx),val);}
 
64
        bool Insert(SQInteger idx,const SQObject &val){
 
65
                if(idx < 0 || idx > (SQInteger)_values.size())
 
66
                        return false;
 
67
                _values.insert(idx,val);
 
68
                return true;
 
69
        }
65
70
        void ShrinkIfNeeded() {
66
71
                if(_values.size() <= _values.capacity()>>2) //shrink the array
67
72
                        _values.shrinktofit();
68
73
        }
69
 
        void Remove(SQUnsignedInteger idx){
 
74
        bool Remove(SQInteger idx){
 
75
                if(idx < 0 || idx >= (SQInteger)_values.size())
 
76
                        return false;
70
77
                _values.remove(idx);
71
78
                ShrinkIfNeeded();
 
79
                return true;
72
80
        }
73
81
        void Release()
74
82
        {