Skip to content

Commit

Permalink
PST: Rewrite several places to be able to build with VS2013.
Browse files Browse the repository at this point in the history
  • Loading branch information
lazyhamster committed Mar 30, 2016
1 parent 9d87f6b commit 29853e1
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/modules/pst/pstsdk/ltp/nameid.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,13 @@ inline std::vector<prop_id> pstsdk::name_id_map::get_prop_list() const
std::vector<prop_id> props;

m_entry_stream.seekg(0, std::ios_base::beg);
while(m_entry_stream.read((char*)&entry, sizeof(entry)) != 0)
props.push_back(nameid_get_prop_index(entry) + 0x8000);
while(!m_entry_stream.eof())
{
m_entry_stream.read((char*)&entry, sizeof(entry));
if (m_entry_stream.gcount() == 0) break;

props.push_back(nameid_get_prop_index(entry) + 0x8000);
}

m_entry_stream.clear();

Expand Down Expand Up @@ -312,9 +317,12 @@ inline pstsdk::prop_id pstsdk::name_id_map::lookup(const named_prop& p) const

prop_stream bucket(const_cast<name_id_map*>(this)->m_bag.open_prop_stream(get_bucket_prop(hash_value)));
disk::nameid_hash_entry entry;
while(bucket.read((char*)&entry, sizeof(entry)) != 0)
while(!bucket.eof())
{
if( (entry.hash_base == hash_base) &&
bucket.read((char*)&entry, sizeof(entry));
if (bucket.gcount() == 0) break;

if( (entry.hash_base == hash_base) &&
(disk::nameid_is_string(entry) == p.is_string()) &&
(disk::nameid_get_guid_index(entry) == guid_index)
)
Expand Down

0 comments on commit 29853e1

Please sign in to comment.