diff options
author | Raphael Langella <raphael.langella@gmail.com> | 2012-08-26 22:50:06 +0200 |
---|---|---|
committer | Raphael Langella <raphael.langella@gmail.com> | 2012-08-26 23:06:30 +0200 |
commit | 770bcbd1844b97b671d0e47ea8313cdf2c74c5ea (patch) | |
tree | e030cf61afce9ca69b74bb38eb73734bf10f633e /crawl-ref/source/clua.h | |
parent | a6c16c7f2066c854a01f25e9e6c3d8e44282a638 (diff) | |
download | crawl-ref-770bcbd1844b97b671d0e47ea8313cdf2c74c5ea.tar.gz crawl-ref-770bcbd1844b97b671d0e47ea8313cdf2c74c5ea.zip |
Use std namespace.
I had to rename distance() (in coord.h) to distance2() because it conflicts
with the STL function to compare 2 iterators. Not a bad change given how it
returns the square of the distance anyway.
I also had to rename the message global variable (in message.cc) to buffer.
I tried to fix and improve the coding style has much as I could, but I
probably missed a few given how huge and tedious it is.
I also didn't touch crawl-gdb.py, and the stuff in prebuilt, rltiles/tool
and util/levcomp.*, because I have no clue about those.
Diffstat (limited to 'crawl-ref/source/clua.h')
-rw-r--r-- | crawl-ref/source/clua.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/crawl-ref/source/clua.h b/crawl-ref/source/clua.h index 808c552bc3..a0f8c87823 100644 --- a/crawl-ref/source/clua.h +++ b/crawl-ref/source/clua.h @@ -40,7 +40,7 @@ public: private: CLua *lua; - typedef std::map<lua_State *, CLua *> lua_clua_map; + typedef map<lua_State *, CLua *> lua_clua_map; static lua_clua_map lua_map; }; @@ -109,7 +109,7 @@ public: // Assigns the value on top of the stack to a unique name in the registry // and returns the name. - std::string setuniqregistry(); + string setuniqregistry(); void setregistry(const char *name); void getregistry(const char *name); @@ -123,7 +123,7 @@ public: bool die_on_fail = false, bool force = false); - void pushglobal(const std::string &name); + void pushglobal(const string &name); maybe_bool callmbooleanfn(const char *fn, const char *params, ...); bool callbooleanfn(bool defval, const char *fn, const char *params, ...); @@ -138,14 +138,14 @@ public: static int file_write(lua_State *ls); static int loadfile(lua_State *ls, const char *file, bool trusted = false, bool die_on_fail = false); - static bool is_path_safe(std::string file, bool trusted = false); + static bool is_path_safe(string file, bool trusted = false); static bool is_managed_vm(lua_State *ls); void print_stack(); public: - std::string error; + string error; // If managed_vm is set, we have to take steps to control badly-behaved // scripts. @@ -166,11 +166,11 @@ public: private: lua_State *_state; - typedef std::set<std::string> sfset; + typedef set<string> sfset; sfset sourced_files; unsigned int uniqindex; - std::vector<lua_shutdown_listener*> shutdown_listeners; + vector<lua_shutdown_listener*> shutdown_listeners; private: void init_lua(); @@ -208,28 +208,28 @@ private: class lua_text_pattern : public base_pattern { public: - lua_text_pattern(const std::string &pattern); + lua_text_pattern(const string &pattern); ~lua_text_pattern(); bool valid() const; - bool matches(const std::string &s) const; - const std::string &tostring() const { return pattern; } + bool matches(const string &s) const; + const string &tostring() const { return pattern; } - static bool is_lua_pattern(const std::string &s); + static bool is_lua_pattern(const string &s); private: bool translated; bool isvalid; - std::string pattern; - std::string lua_fn_name; + string pattern; + string lua_fn_name; static unsigned int lfndx; bool translate() const; - void pre_pattern(std::string &pat, std::string &fn) const; - void post_pattern(std::string &pat, std::string &fn) const; + void pre_pattern(string &pat, string &fn) const; + void post_pattern(string &pat, string &fn) const; - static std::string new_fn_name(); + static string new_fn_name(); }; // Defined in main.cc @@ -240,6 +240,6 @@ extern CLua clua; void lua_set_exclusive_item(const item_def *item = NULL); -std::string quote_lua_string(const std::string &s); +string quote_lua_string(const string &s); #endif |