error_code fix. added is_error_code_enum template specialization and using the abbreviated syntax to build error_codes

This commit is contained in:
Arvid Norberg
2009-11-29 07:06:38 +00:00
parent 6070c59b46
commit 1f5859d31f
27 changed files with 249 additions and 238 deletions

View File

@@ -887,7 +887,7 @@ namespace libtorrent
{
// this means the file wasn't big enough for this read
p.storage->get_storage_impl()->set_error(""
, error_code(errors::file_too_short, libtorrent_category));
, errors::file_too_short);
free_piece(p, l);
return -1;
}
@@ -918,7 +918,7 @@ namespace libtorrent
{
// this means the file wasn't big enough for this read
p.storage->get_storage_impl()->set_error(""
, error_code(errors::file_too_short, libtorrent_category));
, errors::file_too_short);
free_piece(p, l);
return -1;
}
@@ -1612,7 +1612,7 @@ namespace libtorrent
if (ret == -3)
{
j.storage->mark_failed(j.piece);
j.error = error_code(errors::failed_hash_check, libtorrent_category);
j.error = errors::failed_hash_check;
j.str.clear();
j.buffer = 0;
break;
@@ -1680,7 +1680,7 @@ namespace libtorrent
{
// this means the file wasn't big enough for this read
j.buffer = 0;
j.error = error_code(errors::file_too_short, libtorrent_category);
j.error = errors::file_too_short;
j.error_file.clear();
j.str.clear();
ret = -1;