diff options
author | Adam Borowski <kilobyte@angband.pl> | 2010-07-29 12:08:57 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2010-07-30 18:45:16 +0200 |
commit | 558f088e9aa6ef75589cdea4ebd908c5b3985eb0 (patch) | |
tree | 498ecba031c0ce0bc21563c76866ee316d3d7f85 /crawl-ref/source/travel.h | |
parent | 4817bb3d806b3156bea1d2bc2b648f04bb0e04e5 (diff) | |
download | crawl-ref-558f088e9aa6ef75589cdea4ebd908c5b3985eb0.tar.gz crawl-ref-558f088e9aa6ef75589cdea4ebd908c5b3985eb0.zip |
Rename chars used as numbers to int8_t/uint8_t. Fix some other type usage.
This should help against the signed char problems, and is good for
code readability. Now, if you have a char, it's either an untyped
in-memory byte, or a symbol inside a string. Small numbers are instead
[u]int8_t, ints, an enum type, or, in so many cases, bools.
I didn't touch any of the tiles code, as it's currently broken and I don't
want to risk making it unbroken harder.
Diffstat (limited to 'crawl-ref/source/travel.h')
-rw-r--r-- | crawl-ref/source/travel.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crawl-ref/source/travel.h b/crawl-ref/source/travel.h index e1e5ab054d..fe561402fe 100644 --- a/crawl-ref/source/travel.h +++ b/crawl-ref/source/travel.h @@ -62,7 +62,7 @@ void stop_running(void); void travel_init_load_level(); void travel_init_new_level(); -unsigned char is_waypoint(const coord_def &p); +uint8_t is_waypoint(const coord_def &p); command_type direction_to_command(int x, int y); bool is_resting(void); void explore_pickup_event(int did_pickup, int tried_pickup); @@ -99,7 +99,7 @@ void start_travel(const coord_def& p); command_type travel(); -int travel_direction(unsigned char branch, int subdungeondepth); +int travel_direction(uint8_t branch, int subdungeondepth); void prevent_travel_to(const std::string &dungeon_feature_name); @@ -325,7 +325,7 @@ struct LevelInfo } void save(writer&) const; - void load(reader&, char minorVersion); + void load(reader&, int minorVersion); std::vector<stair_info> &get_stairs() { @@ -363,7 +363,7 @@ struct LevelInfo // Returns true if the given branch is known to be accessible from the // current level. - bool is_known_branch(unsigned char branch) const; + bool is_known_branch(uint8_t branch) const; FixedVector<int, NUM_DA_COUNTERS> da_counters; @@ -438,7 +438,7 @@ public: void add_waypoint(int x = -1, int y = -1); void delete_waypoint(); - unsigned char is_waypoint(const level_pos &lp) const; + uint8_t is_waypoint(const level_pos &lp) const; void list_waypoints() const; void update_waypoints() const; @@ -446,9 +446,9 @@ public: void update(); void save(writer&) const; - void load(reader&, char minorVersion); + void load(reader&, int minorVersion); - bool is_known_branch(unsigned char branch) const; + bool is_known_branch(uint8_t branch) const; void update_da_counters(); // of the current level |