diff options
author | simka <fastinetserver@gmail.com> | 2010-06-11 23:44:31 +0300 |
---|---|---|
committer | simka <fastinetserver@gmail.com> | 2010-06-11 23:44:31 +0300 |
commit | 3b7bd9a511c34a57776887d8fe1db3eb26b927ea (patch) | |
tree | 8a8df57b1d44da6763d7206007a52912a263f687 /segget/pkg.cpp | |
parent | Add total_size and distfiles_count calculation (diff) | |
download | idfetch-3b7bd9a511c34a57776887d8fe1db3eb26b927ea.tar.gz idfetch-3b7bd9a511c34a57776887d8fe1db3eb26b927ea.tar.bz2 idfetch-3b7bd9a511c34a57776887d8fe1db3eb26b927ea.zip |
Restart segment if unsuccessful. Make distfiles->segments queue more correct.
Diffstat (limited to 'segget/pkg.cpp')
-rw-r--r-- | segget/pkg.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/segget/pkg.cpp b/segget/pkg.cpp index 805b862..673b8a1 100644 --- a/segget/pkg.cpp +++ b/segget/pkg.cpp @@ -6,13 +6,14 @@ #include "distfile.cpp" using namespace std; +typedef unsigned int uint; class Tpkg{ public: Tdistfile **Pdistfile_list; string name; string category; - int distfile_count; + uint distfile_count; void load_distfile_list(json_object* json_array_distfile_list); Tpkg(): Pdistfile_list(0),name(""),category(""), distfile_count(0){}; Tpkg(const Tpkg &L); // copy constructor @@ -23,7 +24,7 @@ class Tpkg{ void Tpkg::load_distfile_list(json_object* json_array_distfile_list){ distfile_count=json_object_array_length(json_array_distfile_list); Pdistfile_list= new Tdistfile* [distfile_count]; - for(int distfile_array_item_num=0;distfile_array_item_num<distfile_count;distfile_array_item_num++){ + for(uint distfile_array_item_num=0;distfile_array_item_num<distfile_count;distfile_array_item_num++){ Pdistfile_list[distfile_array_item_num]=new Tdistfile(); Pdistfile_list[distfile_array_item_num]->load_distfile_from_json(json_object_array_get_idx(json_array_distfile_list,distfile_array_item_num)); } @@ -38,7 +39,7 @@ void Tpkg::load_pkg_from_json(json_object* json_obj_pkg){ } Tpkg::~Tpkg(){ - for (int i=0;i<distfile_count;i++) + for (uint i=0;i<distfile_count;i++) delete Pdistfile_list[i]; delete [] Pdistfile_list; -}
\ No newline at end of file +} |