summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/decks.cc
diff options
context:
space:
mode:
authorpauldubois <pauldubois@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-10 03:30:55 +0000
committerpauldubois <pauldubois@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-10 03:30:55 +0000
commit77b5cadac636ddee4ed39bcaf1344c270fcaa447 (patch)
tree909c1ce1e1fa67eb83548c97790da2287c4d01e1 /crawl-ref/source/decks.cc
parentde978e5fed84aaa1b077fed70b93eba1a3d82edc (diff)
downloadcrawl-ref-77b5cadac636ddee4ed39bcaf1344c270fcaa447.tar.gz
crawl-ref-77b5cadac636ddee4ed39bcaf1344c270fcaa447.zip
Batch of tiny changes for MSVC compiles.
Most of these fall into the category: - don't use struct to refer to a class, and vice versa - msvc doesn't like unistd.h or dirent.h Doesn't fix all the struct/class problems; I think I'll silence those for now and move on because it's not all that important. Tested on OS X. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3571 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/decks.cc')
-rw-r--r--crawl-ref/source/decks.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc
index a060dbed1d..aaad67e19f 100644
--- a/crawl-ref/source/decks.cc
+++ b/crawl-ref/source/decks.cc
@@ -207,11 +207,11 @@ static void shuffle_deck(item_def &deck)
// Don't use std::shuffle(), since we want to apply exactly the
// same shuffling to both the cards vector and the flags vector.
- std::vector<long> pos;
+ std::vector<vec_size> pos;
for (unsigned long i = 0; i < cards.size(); i++)
pos.push_back(random2(cards.size()));
- for (unsigned long i = 0; i < pos.size(); i++)
+ for (vec_size i = 0; i < pos.size(); i++)
{
std::swap(cards[i], cards[pos[i]]);
std::swap(flags[i], flags[pos[i]]);
@@ -527,13 +527,13 @@ static bool check_buggy_deck(item_def& deck)
CrawlVector &cards = props["cards"].get_vector();
CrawlVector &flags = props["card_flags"].get_vector();
- unsigned long num_cards = cards.size();
- unsigned long num_flags = flags.size();
+ vec_size num_cards = cards.size();
+ vec_size num_flags = flags.size();
unsigned int num_buggy = 0;
unsigned int num_marked = 0;
- for (unsigned long i = 0; i < num_cards; i++)
+ for (vec_size i = 0; i < num_cards; i++)
{
unsigned char card = cards[i].get_byte();
unsigned char _flags = flags[i].get_byte();
@@ -2671,8 +2671,8 @@ void init_deck(item_def &item)
props.set_default_flags(SFLAG_CONST_TYPE);
- props["cards"].new_vector(SV_BYTE).resize(item.plus);
- props["card_flags"].new_vector(SV_BYTE).resize(item.plus);
+ props["cards"].new_vector(SV_BYTE).resize((vec_size)item.plus);
+ props["card_flags"].new_vector(SV_BYTE).resize((vec_size)item.plus);
props["drawn_cards"].new_vector(SV_BYTE);
for (int i = 0; i < item.plus; i++)