Remove partial exception specifiers

These are deprecated in newer C++ versions.
This commit is contained in:
Ilari Liusvaara 2019-01-30 19:15:18 +02:00
parent da27ae0ce3
commit 436b1d183d
145 changed files with 949 additions and 1054 deletions

View file

@ -41,7 +41,7 @@ public:
* Parameter id: The ID of dumper.
* Throws std::bad_alloc: Not enough memory.
*/
dumper_factory_base(const std::string& id) throw(std::bad_alloc);
dumper_factory_base(const std::string& id);
/**
* Unregister a dumper.
*/
@ -58,14 +58,14 @@ public:
* Returns: The set.
* Throws std::bad_alloc: Not enough memory.
*/
static std::set<dumper_factory_base*> get_dumper_set() throw(std::bad_alloc);
static std::set<dumper_factory_base*> get_dumper_set();
/**
* List all valid submodes.
*
* Returns: List of all valid submodes. Empty list means this dumper has no submodes.
* Throws std::bad_alloc: Not enough memory.
*/
virtual std::set<std::string> list_submodes() throw(std::bad_alloc) = 0;
virtual std::set<std::string> list_submodes() = 0;
/**
* Get mode details
*
@ -86,7 +86,7 @@ public:
* Returns: The name.
* Throws std::bad_alloc: Not enough memory.
*/
virtual std::string name() throw(std::bad_alloc) = 0;
virtual std::string name() = 0;
/**
* Get human-readable name for submode.
*
@ -94,7 +94,7 @@ public:
* Returns: The name.
* Throws std::bad_alloc: Not enough memory.
*/
virtual std::string modename(const std::string& mode) throw(std::bad_alloc) = 0;
virtual std::string modename(const std::string& mode) = 0;
/**
* Start dump.
*
@ -105,7 +105,7 @@ public:
* Throws std::runtime_error: Can't start dump.
*/
virtual dumper_base* start(master_dumper& _mdumper, const std::string& mode, const std::string& targetname)
throw(std::bad_alloc, std::runtime_error) = 0;
= 0;
/**
* Is hidden?
*/
@ -142,7 +142,7 @@ public:
/**
* Construct game info.
*/
gameinfo() throw(std::bad_alloc);
gameinfo();
/**
* Game name.
*/
@ -167,7 +167,7 @@ public:
* Returns: The time formated.
* Throws std::bad_alloc: Not enough memory.
*/
std::string get_readable_time(unsigned digits) const throw(std::bad_alloc);
std::string get_readable_time(unsigned digits) const;
/**
* Get number of authors.
*
@ -181,7 +181,7 @@ public:
* Returns: The short name.
* Throws std::bad_alloc: Not enough memory.
*/
std::string get_author_short(size_t idx) const throw(std::bad_alloc);
std::string get_author_short(size_t idx) const;
/**
* Get long name of author (full name and nickname if present).
*
@ -189,7 +189,7 @@ public:
* Returns: The long name.
* Throws std::bad_alloc: Not enough memory.
*/
std::string get_author_long(size_t idx) const throw(std::bad_alloc);
std::string get_author_long(size_t idx) const;
/**
* Get rerecord count as a number. If rerecord count is too high, returns the maximum representatible count.
*
@ -224,8 +224,7 @@ public:
/**
* Call start on dumper.
*/
dumper_base* start(dumper_factory_base& factory, const std::string& mode, const std::string& targetname)
throw(std::bad_alloc, std::runtime_error);
dumper_base* start(dumper_factory_base& factory, const std::string& mode, const std::string& targetname);
/**
* Add dumper update notifier object.
*/

View file

@ -59,22 +59,21 @@ bool audioapi_driver_initialized();
* Parameter pdev: The new sound device (playback).
* Parameter rdev: The new sound device (recording)
*/
void audioapi_driver_set_device(const std::string& pdev, const std::string& rdev) throw(std::bad_alloc,
std::runtime_error);
void audioapi_driver_set_device(const std::string& pdev, const std::string& rdev);
/**
* Get current sound device (playback).
*
* Returns: The current sound device.
*/
std::string audioapi_driver_get_device(bool rec) throw(std::bad_alloc);
std::string audioapi_driver_get_device(bool rec);
/**
* Get available sound devices (playback).
*
* Returns: The map of devices. Keyed by name of the device, values are human-readable names for devices.
*/
std::map<std::string, std::string> audioapi_driver_get_devices(bool rec) throw(std::bad_alloc);
std::map<std::string, std::string> audioapi_driver_get_devices(bool rec);
/**
* Identification for sound plugin.

View file

@ -65,7 +65,7 @@ public:
* Parameter ptype: The new types for ports.
* Throws std::runtime_error: Illegal port type.
*/
void set_ports(const portctrl::type_set& ptype) throw(std::runtime_error);
void set_ports(const portctrl::type_set& ptype);
/**
* Get status of current controls (with autohold/autofire factored in).
*

View file

@ -50,7 +50,7 @@ public:
*
* throws std::bad_alloc: Not enough memory.
*/
static void init_special_screens() throw(std::bad_alloc);
static void init_special_screens();
/**
* Copy framebuffer to backing store, running Lua hooks if any.
*/
@ -62,7 +62,7 @@ public:
/**
* Return last complete framebuffer.
*/
framebuffer::raw get_framebuffer() throw(std::bad_alloc);
framebuffer::raw get_framebuffer();
/**
* Render framebuffer to main screen.
*/
@ -74,7 +74,7 @@ public:
/**
* Take a screenshot to specified file.
*/
void take_screenshot(const std::string& file) throw(std::bad_alloc, std::runtime_error);
void take_screenshot(const std::string& file);
/**
* Kill pending requests associated with object.
*/

View file

@ -9,8 +9,7 @@
/**
* \brief Emulator main loop.
*/
void main_loop(struct loaded_rom& rom, struct moviefile& settings, bool load_has_to_succeed = false)
throw(std::bad_alloc, std::runtime_error);
void main_loop(struct loaded_rom& rom, struct moviefile& settings, bool load_has_to_succeed = false);
std::vector<std::string> get_jukebox_names();
void set_jukebox_names(const std::vector<std::string>& newj);
void init_main_callbacks();

View file

@ -15,7 +15,7 @@ class cart_mappings_refresher
{
public:
cart_mappings_refresher(memory_space& _mspace, movie_logic& _mlogic, loaded_rom& _rom);
void operator()() throw(std::bad_alloc);
void operator()();
private:
memory_space& mspace;
movie_logic& mlogic;

View file

@ -20,7 +20,7 @@ void fatal_error() throw();
* \return The config directory path.
* \throw std::bad_alloc Not enough memory.
*/
std::string get_config_path() throw(std::bad_alloc);
std::string get_config_path();
/**
* \brief Panic on OOM.

View file

@ -29,7 +29,7 @@ public:
*
* returns: The movie instance.
*/
movie& get_movie() throw(std::runtime_error);
movie& get_movie();
/**
* Set the movie instance associated.
@ -39,7 +39,7 @@ public:
/**
* Get the current movie file.
*/
moviefile& get_mfile() throw(std::runtime_error);
moviefile& get_mfile();
/**
* Set the current movie file.
@ -48,7 +48,7 @@ public:
/**
* Get current rrdata.
*/
rrdata_set& get_rrdata() throw(std::runtime_error);
rrdata_set& get_rrdata();
/**
* Set current rrdata.
@ -58,7 +58,7 @@ public:
/**
* Notify about new frame starting.
*/
void new_frame_starting(bool dont_poll) throw(std::bad_alloc, std::runtime_error);
void new_frame_starting(bool dont_poll);
/**
* Poll for input.
@ -70,21 +70,21 @@ public:
* throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Error polling for input.
*/
short input_poll(unsigned port, unsigned dev, unsigned id) throw(std::bad_alloc, std::runtime_error);
short input_poll(unsigned port, unsigned dev, unsigned id);
/**
* Called when movie code needs new controls snapshot.
*
* parameter subframe: True if this is for subframe update, false if for frame update.
*/
portctrl::frame update_controls(bool subframe, bool forced = false) throw(std::bad_alloc, std::runtime_error);
portctrl::frame update_controls(bool subframe, bool forced = false);
/**
* Notify user poll (exit poll advance).
*
* returns: If true, update_controls is forced.
*/
bool notify_user_poll() throw(std::bad_alloc, std::runtime_error);
bool notify_user_poll();
/**
* Release memory for mov, mf and rrd.
*/

View file

@ -31,13 +31,12 @@
#define SAVE_MOVIE 1
std::string resolve_relative_path(const std::string& path);
std::pair<std::string, std::string> split_author(const std::string& author) throw(std::bad_alloc,
std::runtime_error);
std::pair<std::string, std::string> split_author(const std::string& author);
void do_save_state(const std::string& filename, int binary) throw(std::bad_alloc, std::runtime_error);
void do_save_movie(const std::string& filename, int binary) throw(std::bad_alloc, std::runtime_error);
void do_load_rom() throw(std::bad_alloc, std::runtime_error);
void do_load_rewind() throw(std::bad_alloc, std::runtime_error);
void do_save_state(const std::string& filename, int binary);
void do_save_movie(const std::string& filename, int binary);
void do_load_rom();
void do_load_rewind();
void do_load_state(struct moviefile& _movie, int lmode, bool& used);
bool do_load_state(const std::string& filename, int lmode);
std::string translate_name_mprefix(std::string original, int& binary, int save);

View file

@ -138,7 +138,7 @@ struct moviefile
*
* throws std::bad_alloc: Not enough memory.
*/
moviefile() throw(std::bad_alloc);
moviefile();
/**
* This constructor loads a movie/savestate file and fills structure accordingly.
@ -148,7 +148,7 @@ struct moviefile
* throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Can't load the movie file
*/
moviefile(const std::string& filename, core_type& romtype) throw(std::bad_alloc, std::runtime_error);
moviefile(const std::string& filename, core_type& romtype);
/**
* Fill a stub movie with specified loaded ROM.
@ -171,12 +171,11 @@ struct moviefile
* throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Can't save the movie file.
*/
void save(const std::string& filename, unsigned compression, bool binary, rrdata_set& rrd, bool as_state)
throw(std::bad_alloc, std::runtime_error);
void save(const std::string& filename, unsigned compression, bool binary, rrdata_set& rrd, bool as_state);
/**
* Reads this movie structure and saves it to stream (uncompressed ZIP).
*/
void save(std::ostream& outstream, rrdata_set& rrd, bool as_state) throw(std::bad_alloc, std::runtime_error);
void save(std::ostream& outstream, rrdata_set& rrd, bool as_state);
/**
* Force loading as corrupt.
*/
@ -322,10 +321,10 @@ struct moviefile
private:
moviefile(const moviefile&);
moviefile& operator=(const moviefile&);
void binary_io(int stream, rrdata_set& rrd, bool as_state) throw(std::bad_alloc, std::runtime_error);
void binary_io(int stream, struct core_type& romtype) throw(std::bad_alloc, std::runtime_error);
void save(zip::writer& w, rrdata_set& rrd, bool as_state) throw(std::bad_alloc, std::runtime_error);
void load(zip::reader& r, core_type& romtype) throw(std::bad_alloc, std::runtime_error);
void binary_io(int stream, rrdata_set& rrd, bool as_state);
void binary_io(int stream, struct core_type& romtype);
void save(zip::writer& w, rrdata_set& rrd, bool as_state);
void load(zip::reader& r, core_type& romtype);
memtracker::autorelease tracker;
std::string filename;
};

View file

@ -83,7 +83,7 @@ struct input_queue
*
* Parameter k: The keypress to queue.
*/
void queue(const keypress_info& k) throw(std::bad_alloc);
void queue(const keypress_info& k);
/**
* Queue command.
*
@ -91,7 +91,7 @@ struct input_queue
*
* Parameter c: The command to queue.
*/
void queue(const std::string& c) throw(std::bad_alloc);
void queue(const std::string& c);
/**
* Queue command and arguments.
*
@ -100,7 +100,7 @@ struct input_queue
* Parameter c: The command to queue.
* Parameter a: The arguments for function.
*/
void queue(const char* c, const std::string& a) throw(std::bad_alloc);
void queue(const char* c, const std::string& a);
/**
* Queue function to be called in emulation thread.
*
@ -111,8 +111,7 @@ struct input_queue
* Parameter arg: Argument to pass to the function.
* Parameter sync: If true, execute function call synchronously, else asynchronously.
*/
void queue(std::function<void()> f, std::function<void(std::exception& e)> onerror, bool sync)
throw(std::bad_alloc);
void queue(std::function<void()> f, std::function<void(std::exception& e)> onerror, bool sync);
/**
* Run all queues.
*/

View file

@ -15,7 +15,7 @@
* \return The random hexadecimal string.
* \throws std::bad_alloc Not enough memory.
*/
std::string get_random_hexstring(size_t length) throw(std::bad_alloc);
std::string get_random_hexstring(size_t length);
/**
* \brief Set random seed
@ -25,7 +25,7 @@ std::string get_random_hexstring(size_t length) throw(std::bad_alloc);
* \param seed The value to use as seed.
* \throw std::bad_alloc Not enough memory.
*/
void set_random_seed(const std::string& seed) throw(std::bad_alloc);
void set_random_seed(const std::string& seed);
/**
* \brief Set random seed to (hopefully) unique value
@ -35,7 +35,7 @@ void set_random_seed(const std::string& seed) throw(std::bad_alloc);
*
* \throw std::bad_alloc Not enough memory.
*/
void set_random_seed() throw(std::bad_alloc);
void set_random_seed();
/**
* Mix some entropy.

View file

@ -27,7 +27,7 @@ struct loaded_rom
* throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Loading ROM file failed.
*/
loaded_rom(rom_image_handle _image) throw(std::bad_alloc, std::runtime_error);
loaded_rom(rom_image_handle _image);
/**
* Switches the active cartridge to this cartridge. The compatiblity between selected region and original region
* is checked. Region is updated after cartridge has been loaded.
@ -35,8 +35,7 @@ struct loaded_rom
* throws std::bad_alloc: Not enough memory
* throws std::runtime_error: Switching cartridges failed.
*/
void load(std::map<std::string, std::string>& settings, uint64_t rtc_sec, uint64_t rtc_subsec)
throw(std::bad_alloc, std::runtime_error);
void load(std::map<std::string, std::string>& settings, uint64_t rtc_sec, uint64_t rtc_subsec);
/**
* Reset the emulation state to state just before last load.
*/
@ -47,7 +46,7 @@ struct loaded_rom
* returns: The saved state.
* throws std::bad_alloc: Not enough memory.
*/
std::vector<char> save_core_state(bool nochecksum = false) throw(std::bad_alloc, std::runtime_error);
std::vector<char> save_core_state(bool nochecksum = false);
/**
* Loads core state from buffer.
@ -55,7 +54,7 @@ struct loaded_rom
* parameter buf: The buffer containing the state.
* throws std::runtime_error: Loading state failed.
*/
void load_core_state(const std::vector<char>& buf, bool nochecksum = false) throw(std::runtime_error);
void load_core_state(const std::vector<char>& buf, bool nochecksum = false);
/**
* Get internal type representation.
@ -130,8 +129,8 @@ struct loaded_rom
std::pair<uint64_t, uint64_t> get_bus_map() { return rtype().get_bus_map(); }
std::list<core_region*> get_regions() { return image->get_regions(); }
const std::string& get_iname() { return rtype().get_iname(); }
std::map<std::string, std::vector<char>> save_sram() throw(std::bad_alloc) { return rtype().save_sram(); }
void load_sram(std::map<std::string, std::vector<char>>& sram) throw(std::bad_alloc)
std::map<std::string, std::vector<char>> save_sram() { return rtype().save_sram(); }
void load_sram(std::map<std::string, std::vector<char>>& sram)
{
rtype().load_sram(sram);
}
@ -188,8 +187,7 @@ std::pair<core_type*, core_region*> get_current_rom_info() throw();
* throws std::bad_alloc: Out of memory.
* throws std::runtime_error: Failed to load.
*/
std::map<std::string, std::vector<char>> load_sram_commandline(const std::vector<std::string>& cmdline)
throw(std::bad_alloc, std::runtime_error);
std::map<std::string, std::vector<char>> load_sram_commandline(const std::vector<std::string>& cmdline);
struct romload_request
{

View file

@ -43,8 +43,7 @@ public:
* throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Loading ROM file failed.
*/
rom_image(const std::string& file, const std::string& tmpprefer = "") throw(std::bad_alloc,
std::runtime_error);
rom_image(const std::string& file, const std::string& tmpprefer = "");
/**
* Take a ROM and load it.
*/
@ -63,7 +62,7 @@ public:
* throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Loading ROM file failed.
*/
rom_image(const std::string& file, core_type& ctype) throw(std::bad_alloc, std::runtime_error);
rom_image(const std::string& file, core_type& ctype);
/**
* Destroy ROM image.
*/
@ -112,7 +111,7 @@ public:
* retruns: True if gamepak, false if not.
* throws std::runtime_error: No such file.
*/
static bool is_gamepak(const std::string& filename) throw(std::bad_alloc, std::runtime_error);
static bool is_gamepak(const std::string& filename);
//ROM functions.
std::list<core_region*> get_regions() { return rtype->get_regions(); }
const std::string& get_hname() { return rtype->get_hname(); }
@ -144,8 +143,7 @@ private:
bool put() { threads::alock l(usage_lock); return !--usage_count; }
friend class rom_image_handle;
//Handle bundle load case.
void load_bundle(const std::string& file, std::istream& spec, const std::string& tmpprefer)
throw(std::bad_alloc, std::runtime_error);
void load_bundle(const std::string& file, std::istream& spec, const std::string& tmpprefer);
//Tracker.
memtracker::autorelease tracker;
};

View file

@ -93,7 +93,7 @@ struct platform
* returns: The output stream.
* throws std::bad_alloc: Not enough memory.
*/
static std::ostream& out() throw(std::bad_alloc);
static std::ostream& out();
/**
* Message buffer.
*/
@ -110,7 +110,7 @@ struct platform
* parameter msg: The messages to add (split by '\n').
* throws std::bad_alloc: Not enough memory.
*/
static void message(const std::string& msg) throw(std::bad_alloc);
static void message(const std::string& msg);
/**
* Displays fatal error message, quitting after the user acks it (called by fatal_error()).
*
@ -140,7 +140,7 @@ struct platform
/**
* Get sound device description.
*/
static std::string get_sound_device_description(bool rec) throw(std::bad_alloc);
static std::string get_sound_device_description(bool rec);
/**
* Show error message dialog after UI thread becomes free.
*

View file

@ -324,8 +324,8 @@ struct core_core
double get_PAR();
std::pair<uint32_t, uint32_t> get_audio_rate();
std::string get_core_identifier() const;
std::map<std::string, std::vector<char>> save_sram() throw(std::bad_alloc);
void load_sram(std::map<std::string, std::vector<char>>& sram) throw(std::bad_alloc);
std::map<std::string, std::vector<char>> save_sram();
void load_sram(std::map<std::string, std::vector<char>>& sram);
void serialize(std::vector<char>& out);
void unserialize(const char* in, size_t insize);
core_region& get_region();
@ -393,13 +393,13 @@ protected:
/**
* Save all SRAMs.
*/
virtual std::map<std::string, std::vector<char>> c_save_sram() throw(std::bad_alloc) = 0;
virtual std::map<std::string, std::vector<char>> c_save_sram() = 0;
/**
* Load all SRAMs.
*
* Note: Must handle SRAM being missing or shorter or longer than expected.
*/
virtual void c_load_sram(std::map<std::string, std::vector<char>>& sram) throw(std::bad_alloc) = 0;
virtual void c_load_sram(std::map<std::string, std::vector<char>>& sram) = 0;
/**
* Serialize the system state.
*/
@ -578,8 +578,8 @@ public:
std::pair<uint32_t, uint32_t> get_audio_rate() { return core->get_audio_rate(); }
std::string get_core_identifier() { return core->get_core_identifier(); }
std::string get_core_shortname() const { return core->get_core_shortname(); }
std::map<std::string, std::vector<char>> save_sram() throw(std::bad_alloc) { return core->save_sram(); }
void load_sram(std::map<std::string, std::vector<char>>& sram) throw(std::bad_alloc)
std::map<std::string, std::vector<char>> save_sram() { return core->save_sram(); }
void load_sram(std::map<std::string, std::vector<char>>& sram)
{
core->load_sram(sram);
}

View file

@ -40,7 +40,7 @@ struct core_setting_value
/**
* Create a new setting value.
*/
core_setting_value(const core_setting_value_param& p) throw(std::bad_alloc);
core_setting_value(const core_setting_value_param& p);
/**
* Internal value.
*/
@ -95,15 +95,15 @@ struct core_setting
/**
* Get set of human-readable strings.
*/
std::vector<std::string> hvalues() const throw(std::runtime_error);
std::vector<std::string> hvalues() const;
/**
* Translate hvalue to ivalue.
*/
std::string hvalue_to_ivalue(const std::string& hvalue) const throw(std::runtime_error);
std::string hvalue_to_ivalue(const std::string& hvalue) const;
/**
* Translate ivalue to index.
*/
signed ivalue_to_index(const std::string& ivalue) const throw(std::runtime_error);
signed ivalue_to_index(const std::string& ivalue) const;
/**
* Validate a value.
*
@ -138,14 +138,13 @@ struct core_setting_group
* Translate ivalue to index.
*/
signed ivalue_to_index(std::map<std::string, std::string>& values, const std::string& name) const
throw(std::runtime_error)
{
return settings.find(name)->second.ivalue_to_index(values[name]);
}
/**
* Fill a map of settings with defaults.
*/
void fill_defaults(std::map<std::string, std::string>& values) throw(std::bad_alloc);
void fill_defaults(std::map<std::string, std::string>& values);
/**
* Get set of settings.
*/

View file

@ -46,7 +46,7 @@ public:
/**
* Create a new set.
*/
set() throw(std::bad_alloc);
set();
/**
* Destroy a set.
*/
@ -54,17 +54,17 @@ public:
/**
* Add a command to set.
*/
void do_register(const std::string& name, factory_base& cmd) throw(std::bad_alloc);
void do_register(const std::string& name, factory_base& cmd);
/**
* Remove a command from set.
*/
void do_unregister(const std::string& name, factory_base& cmd) throw(std::bad_alloc);
void do_unregister(const std::string& name, factory_base& cmd);
/**
* Add a notification callback and call ccb on all.
*
* Parameter listener: The listener to add.
*/
void add_callback(listener& listener) throw(std::bad_alloc);
void add_callback(listener& listener);
/**
* Drop a notification callback and call dcb on all.
*
@ -84,7 +84,7 @@ public:
/**
* Create a new command group. This also places some builtin commands in that new group.
*/
group() throw(std::bad_alloc);
group();
/**
* Destroy a group.
*/
@ -105,31 +105,31 @@ public:
/**
* Get set of aliases.
*/
std::set<std::string> get_aliases() throw(std::bad_alloc);
std::set<std::string> get_aliases();
/**
* Get alias
*/
std::string get_alias_for(const std::string& aname) throw(std::bad_alloc);
std::string get_alias_for(const std::string& aname);
/**
* Set alias
*/
void set_alias_for(const std::string& aname, const std::string& avalue) throw(std::bad_alloc);
void set_alias_for(const std::string& aname, const std::string& avalue);
/**
* Is alias name valid.
*/
bool valid_alias_name(const std::string& aname) throw(std::bad_alloc);
bool valid_alias_name(const std::string& aname);
/**
* Register a command.
*/
void do_register(const std::string& name, base& cmd) throw(std::bad_alloc);
void do_register(const std::string& name, base& cmd);
/**
* Unregister a command.
*/
void do_unregister(const std::string& name, base& cmd) throw(std::bad_alloc);
void do_unregister(const std::string& name, base& cmd);
/**
* Add all commands (including future ones) in given set.
*/
void add_set(set& s) throw(std::bad_alloc);
void add_set(set& s);
/**
* Drop a set of commands.
*/
@ -175,7 +175,7 @@ public:
* parameter dynamic: Should the object be freed when its parent group dies?
* throws std::bad_alloc: Not enough memory.
*/
base(group& group, const std::string& cmd, bool dynamic) throw(std::bad_alloc);
base(group& group, const std::string& cmd, bool dynamic);
/**
* Deregister a command.
@ -189,16 +189,16 @@ public:
* throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Command execution failed.
*/
virtual void invoke(const std::string& arguments) throw(std::bad_alloc, std::runtime_error) = 0;
virtual void invoke(const std::string& arguments) = 0;
/**
* Get short help for command.
*/
virtual std::string get_short_help() throw(std::bad_alloc);
virtual std::string get_short_help();
/**
* Get long help for command.
*/
virtual std::string get_long_help() throw(std::bad_alloc);
virtual std::string get_long_help();
/**
* Get name of command.
*/
@ -231,7 +231,7 @@ public:
* parameter cmd: The command to register.
* throws std::bad_alloc: Not enough memory.
*/
void _factory_base(set& _set, const std::string& cmd) throw(std::bad_alloc);
void _factory_base(set& _set, const std::string& cmd);
/**
* Destructor.
*/
@ -316,7 +316,7 @@ public:
* parameter dynamic: Should the object be freed when its parent group dies?
*/
_fnptr(group& group, const std::string& name, const std::string& _description,
const std::string& _help, void (*_fn)(args... arguments), bool dynamic = false) throw(std::bad_alloc)
const std::string& _help, void (*_fn)(args... arguments), bool dynamic = false)
: base(group, name, dynamic)
{
shorthelp = _description;
@ -331,7 +331,7 @@ public:
* parameter fn: Function to call on command.
* parameter description Description&Help for the command
*/
_fnptr(group& _group, stub _name, std::function<void(args... arguments)> _fn) throw(std::bad_alloc)
_fnptr(group& _group, stub _name, std::function<void(args... arguments)> _fn)
: base(_group, _name.name, false)
{
shorthelp = _name.desc;
@ -349,7 +349,7 @@ public:
*
* parameter a: Arguments to function.
*/
void invoke(const std::string& a) throw(std::bad_alloc, std::runtime_error)
void invoke(const std::string& a)
{
invoke_fn(fn, a);
}
@ -359,7 +359,7 @@ public:
* returns: Description.
* throw std::bad_alloc: Not enough memory.
*/
std::string get_short_help() throw(std::bad_alloc)
std::string get_short_help()
{
return shorthelp;
}
@ -369,7 +369,7 @@ public:
* returns: help.
* throw std::bad_alloc: Not enough memory.
*/
std::string get_long_help() throw(std::bad_alloc)
std::string get_long_help()
{
return help;
}
@ -393,7 +393,7 @@ public:
* parameter desc: Command descriptor.
* parameter fn: Function to call on command.
*/
fnptr(set& _set, stub _name, void (*_fn)(args... arguments)) throw(std::bad_alloc)
fnptr(set& _set, stub _name, void (*_fn)(args... arguments))
{
shorthelp = _name.desc;
name = _name.name;
@ -411,7 +411,7 @@ public:
* parameter fn: Function to call on command.
*/
fnptr(set& _set, const std::string& _name, const std::string& _description,
const std::string& _help, void (*_fn)(args... arguments)) throw(std::bad_alloc)
const std::string& _help, void (*_fn)(args... arguments))
{
shorthelp = _description;
name = _name;
@ -428,7 +428,7 @@ public:
/**
* Make a command.
*/
base* make(group& grp) throw(std::bad_alloc)
base* make(group& grp)
{
return new _fnptr<args...>(grp, name, shorthelp, help, fn, true);
}
@ -463,7 +463,7 @@ public:
/**
* Make a command.
*/
base* make(group& grp) throw(std::bad_alloc)
base* make(group& grp)
{
return new T(grp, name);
}

View file

@ -10,7 +10,7 @@
namespace fileimage
{
std::vector<char> patch(const std::vector<char>& original, const std::vector<char>& patch,
int32_t offset) throw(std::bad_alloc, std::runtime_error);
int32_t offset);
/**
* ROM patcher.
@ -20,7 +20,7 @@ struct patcher
/**
* Constructor.
*/
patcher() throw(std::bad_alloc);
patcher();
/**
* Destructor.
*/
@ -36,7 +36,7 @@ struct patcher
* Do the patch.
*/
virtual void dopatch(std::vector<char>& out, const std::vector<char>& original,
const std::vector<char>& patch, int32_t offset) throw(std::bad_alloc, std::runtime_error) = 0;
const std::vector<char>& patch, int32_t offset) = 0;
};
}

View file

@ -161,7 +161,7 @@ struct image
*
* throws std::bad_alloc: Not enough memory.
*/
image() throw(std::bad_alloc);
image();
/**
* This constructor construct slot by reading data from file. If filename is "", constructs an empty slot.
@ -174,7 +174,7 @@ struct image
* throws std::runtime_error: Can't load the data.
*/
image(hash& hasher, const std::string& filename, const std::string& base,
const struct info& imginfo) throw(std::bad_alloc, std::runtime_error);
const struct info& imginfo);
/**
* This method patches this slot using specified IPS patch.
@ -186,7 +186,7 @@ struct image
* throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Bad IPS patch, or trying to patch file image.
*/
void patch(const std::vector<char>& patch, int32_t offset) throw(std::bad_alloc, std::runtime_error);
void patch(const std::vector<char>& patch, int32_t offset);
/**
* Type.
*/

View file

@ -31,9 +31,8 @@ public:
font2();
font2(const std::string& file);
font2(struct font& bfont);
void add(const std::u32string& key, const glyph& fglyph) throw(std::bad_alloc);
std::u32string best_ligature_match(const std::u32string& codepoints, size_t start) const
throw(std::bad_alloc);
void add(const std::u32string& key, const glyph& fglyph);
std::u32string best_ligature_match(const std::u32string& codepoints, size_t start) const;
const glyph& lookup_glyph(const std::u32string& key) const throw();
unsigned get_rowadvance() const throw() { return rowadvance; }
std::pair<uint32_t, uint32_t> get_metrics(const std::u32string& str, uint32_t xalign) const;

View file

@ -19,9 +19,9 @@ public:
void decode(uint64_t* target, const uint8_t* src, size_t width,
const auxpalette<true>& auxp) throw();
void set_palette(auxpalette<false>& auxp, uint8_t rshift, uint8_t gshift,
uint8_t bshift) throw(std::bad_alloc);
uint8_t bshift);
void set_palette(auxpalette<true>& auxp, uint8_t rshift, uint8_t gshift,
uint8_t bshift) throw(std::bad_alloc);
uint8_t bshift);
uint8_t get_bpp() throw();
uint8_t get_ss_bpp() throw();
uint32_t get_magic() throw();

View file

@ -20,9 +20,9 @@ public:
void decode(uint64_t* target, const uint8_t* src, size_t width,
const auxpalette<true>& auxp) throw();
void set_palette(auxpalette<false>& auxp, uint8_t rshift, uint8_t gshift,
uint8_t bshift) throw(std::bad_alloc);
uint8_t bshift);
void set_palette(auxpalette<true>& auxp, uint8_t rshift, uint8_t gshift,
uint8_t bshift) throw(std::bad_alloc);
uint8_t bshift);
uint8_t get_bpp() throw();
uint8_t get_ss_bpp() throw();
uint32_t get_magic() throw();

View file

@ -20,9 +20,9 @@ public:
void decode(uint64_t* target, const uint8_t* src, size_t width,
const auxpalette<true>& auxp) throw();
void set_palette(auxpalette<false>& auxp, uint8_t rshift, uint8_t gshift,
uint8_t bshift) throw(std::bad_alloc);
uint8_t bshift);
void set_palette(auxpalette<true>& auxp, uint8_t rshift, uint8_t gshift,
uint8_t bshift) throw(std::bad_alloc);
uint8_t bshift);
uint8_t get_bpp() throw();
uint8_t get_ss_bpp() throw();
uint32_t get_magic() throw();

View file

@ -20,9 +20,9 @@ public:
void decode(uint64_t* target, const uint8_t* src, size_t width,
const auxpalette<true>& auxp) throw();
void set_palette(auxpalette<false>& auxp, uint8_t rshift, uint8_t gshift,
uint8_t bshift) throw(std::bad_alloc);
uint8_t bshift);
void set_palette(auxpalette<true>& auxp, uint8_t rshift, uint8_t gshift,
uint8_t bshift) throw(std::bad_alloc);
uint8_t bshift);
uint8_t get_bpp() throw();
uint8_t get_ss_bpp() throw();
uint32_t get_magic() throw();

View file

@ -19,9 +19,9 @@ public:
void decode(uint64_t* target, const uint8_t* src, size_t width,
const auxpalette<true>& auxp) throw();
void set_palette(auxpalette<false>& auxp, uint8_t rshift, uint8_t gshift,
uint8_t bshift) throw(std::bad_alloc);
uint8_t bshift);
void set_palette(auxpalette<true>& auxp, uint8_t rshift, uint8_t gshift,
uint8_t bshift) throw(std::bad_alloc);
uint8_t bshift);
uint8_t get_bpp() throw();
uint8_t get_ss_bpp() throw();
uint32_t get_magic() throw();

View file

@ -19,7 +19,7 @@ public:
/**
* Register the pixel format.
*/
pixfmt() throw(std::bad_alloc);
pixfmt();
/**
* Decode pixel format data into RGB data (0, R, G, B).
*/
@ -39,12 +39,12 @@ public:
* Create aux palette.
*/
virtual void set_palette(auxpalette<false>& auxp, uint8_t rshift, uint8_t gshift,
uint8_t bshift) throw(std::bad_alloc) = 0;
uint8_t bshift) = 0;
/**
* Create aux palette.
*/
virtual void set_palette(auxpalette<true>& auxp, uint8_t rshift, uint8_t gshift,
uint8_t bshift) throw(std::bad_alloc) = 0;
uint8_t bshift) = 0;
/**
* Bytes per pixel in data.
*/

View file

@ -100,13 +100,13 @@ struct raw
*
* Parameter info: The framebuffer info.
*/
raw(const info& finfo) throw(std::bad_alloc);
raw(const info& finfo);
/**
* Create a new framebuffer backed by memory buffer.
*
* The resulting framebuffer can be written to.
*/
raw() throw(std::bad_alloc);
raw();
/**
* Copy a framebuffer.
*
@ -114,34 +114,34 @@ struct raw
*
* Parameter f: The framebuffer.
*/
raw(const raw& f) throw(std::bad_alloc);
raw(const raw& f);
/**
* Assign a framebuffer.
*
* Parameter f: The framebuffer.
* Throws std::runtime_error: The target framebuffer is not writable.
*/
raw& operator=(const raw& f) throw(std::bad_alloc, std::runtime_error);
raw& operator=(const raw& f);
/**
* Load contents of framebuffer.
*
* parameter data: The data to load.
* throws std::runtime_error: The target framebuffer is not writable.
*/
void load(const std::vector<char>& data) throw(std::bad_alloc, std::runtime_error);
void load(const std::vector<char>& data);
/**
* Save contents of framebuffer.
*
* parameter data: The vector to write the data to (in format compatible with load()).
*/
void save(std::vector<char>& data) throw(std::bad_alloc);
void save(std::vector<char>& data);
/**
* Save contents of framebuffer as a PNG.
*
* parameter file: The filename to save to.
* throws std::runtime_error: Can't save the PNG.
*/
void save_png(const std::string& file) throw(std::bad_alloc, std::runtime_error);
void save_png(const std::string& file);
/**
* Get width.
*
@ -226,7 +226,7 @@ struct fb
* parameter upside_down: If true, image is upside down in memory.
* throws std::bad_alloc: Not enough memory.
*/
void reallocate(size_t _width, size_t _height, bool upside_down = false) throw(std::bad_alloc);
void reallocate(size_t _width, size_t _height, bool upside_down = false);
/**
* Set origin
@ -278,7 +278,7 @@ struct fb
* parameter g Shift for green component
* parameter b Shift for blue component
*/
void set_palette(uint32_t r, uint32_t g, uint32_t b) throw(std::bad_alloc);
void set_palette(uint32_t r, uint32_t g, uint32_t b);
/**
* Get stride of image.
*
@ -375,7 +375,7 @@ struct object
/**
* Clone the object.
*/
virtual void clone(struct queue& q) const throw(std::bad_alloc) = 0;
virtual void clone(struct queue& q) const = 0;
};
/**
@ -422,7 +422,7 @@ struct color
set_palette(default_shift_r << 1, default_shift_g << 1, default_shift_b << 1, true);
//std::cerr << "Color " << color << " -> hi=" << hi << " lo=" << lo << " inv=" << inv << std::endl;
}
color(const std::string& color) throw(std::bad_alloc, std::runtime_error);
color(const std::string& color);
static std::string stringify(int64_t number);
void set_palette(unsigned rshift, unsigned gshift, unsigned bshift, bool X) throw();
template<bool X> void set_palette(struct fb<X>& s) throw()
@ -518,7 +518,7 @@ struct font
/**
* Constructor.
*/
font() throw(std::bad_alloc);
font();
/**
* Load a .hex format font.
*
@ -526,7 +526,7 @@ struct font
* Parameter size: The font data size in bytes.
* Throws std::runtime_error: Bad font data.
*/
void load_hex(const char* data, size_t size) throw(std::bad_alloc, std::runtime_error);
void load_hex(const char* data, size_t size);
/**
* Locate glyph.
*
@ -548,7 +548,7 @@ struct font
* Parameter string: The string to get layout of.
* Returns: String layout.
*/
std::vector<layout> dolayout(const std::string& string) throw(std::bad_alloc);
std::vector<layout> dolayout(const std::string& string);
/**
* Get width of string.
*
@ -604,7 +604,7 @@ private:
std::map<uint32_t, glyph> glyphs;
size_t tabstop;
std::vector<uint32_t> memory;
void load_hex_glyph(const char* data, size_t size) throw(std::bad_alloc, std::runtime_error);
void load_hex_glyph(const char* data, size_t size);
};
@ -633,7 +633,7 @@ struct queue
/**
* Get memory from internal allocator.
*/
void* alloc(size_t block) throw(std::bad_alloc);
void* alloc(size_t block);
/**
* Call object constructor on internal memory.
@ -645,7 +645,7 @@ struct queue
/**
* Copy objects from another render queue.
*/
void copy_from(queue& q) throw(std::bad_alloc);
void copy_from(queue& q);
/**
* Helper for clone.
*/
@ -675,7 +675,7 @@ struct queue
*/
~queue() throw();
private:
void add(struct object& obj) throw(std::bad_alloc);
void add(struct object& obj);
struct node { struct object* obj; struct node* next; bool killed; };
struct page {
char content[RENDER_PAGE_SIZE];

View file

@ -13,7 +13,7 @@ public:
/**
* Ctor, forces the object to be constructed (to avoid races).
*/
globalwrap() throw(std::bad_alloc)
globalwrap()
{
(*this)();
}
@ -23,7 +23,7 @@ public:
* returns: The wrapped object.
* throws std::bad_alloc: Not enough memory.
*/
T& operator()() throw(std::bad_alloc)
T& operator()()
{
if(!storage) {
if(!state) //State initializes to 0.

View file

@ -17,7 +17,7 @@ namespace hex
* Returns: Hex string.
* Throws std::bad_alloc: Not enough memory.
*/
std::string b_to(const uint8_t* data, size_t datalen, bool uppercase = false) throw(std::bad_alloc);
std::string b_to(const uint8_t* data, size_t datalen, bool uppercase = false);
/**
* Transform unsigned integer into full-width hexadecimal.
@ -27,7 +27,7 @@ std::string b_to(const uint8_t* data, size_t datalen, bool uppercase = false) th
* Returns: The hex string.
* Throws std::bad_alloc: Not enough memory.
*/
template<typename T> std::string to(T data, bool prefix = false) throw(std::bad_alloc);
template<typename T> std::string to(T data, bool prefix = false);
/**
* Transform uint8 into full-width hexadecimal.
@ -37,7 +37,7 @@ template<typename T> std::string to(T data, bool prefix = false) throw(std::bad_
* Returns: The hex string.
* Throws std::bad_alloc: Not enough memory.
*/
inline std::string to8(uint8_t data, bool prefix = false) throw(std::bad_alloc) { return to<uint8_t>(data, prefix); }
inline std::string to8(uint8_t data, bool prefix = false) { return to<uint8_t>(data, prefix); }
/**
* Transform uint16 into full-width hexadecimal.
@ -47,7 +47,7 @@ inline std::string to8(uint8_t data, bool prefix = false) throw(std::bad_alloc)
* Returns: The hex string.
* Throws std::bad_alloc: Not enough memory.
*/
inline std::string to16(uint16_t data, bool prefix = false) throw(std::bad_alloc)
inline std::string to16(uint16_t data, bool prefix = false)
{
return to<uint16_t>(data, prefix);
}
@ -60,7 +60,7 @@ inline std::string to16(uint16_t data, bool prefix = false) throw(std::bad_alloc
* Returns: The hex string.
* Throws std::bad_alloc: Not enough memory.
*/
std::string to24(uint32_t data, bool prefix = false) throw(std::bad_alloc);
std::string to24(uint32_t data, bool prefix = false);
/**
* Transform uint32 into full-width hexadecimal.
@ -70,7 +70,7 @@ std::string to24(uint32_t data, bool prefix = false) throw(std::bad_alloc);
* Returns: The hex string.
* Throws std::bad_alloc: Not enough memory.
*/
inline std::string to32(uint32_t data, bool prefix = false) throw(std::bad_alloc)
inline std::string to32(uint32_t data, bool prefix = false)
{
return to<uint32_t>(data, prefix);
}
@ -83,7 +83,7 @@ inline std::string to32(uint32_t data, bool prefix = false) throw(std::bad_alloc
* Returns: The hex string.
* Throws std::bad_alloc: Not enough memory.
*/
inline std::string to64(uint64_t data, bool prefix = false) throw(std::bad_alloc)
inline std::string to64(uint64_t data, bool prefix = false)
{
return to<uint64_t>(data, prefix);
}
@ -95,7 +95,7 @@ inline std::string to64(uint64_t data, bool prefix = false) throw(std::bad_alloc
* Parameter hex: The hexadecimal string.
* Throws std::runtime_error: Bad hexadecimal character in string.
*/
void b_from(uint8_t* buf, const std::string& hex) throw(std::runtime_error);
void b_from(uint8_t* buf, const std::string& hex);
/**
* Transform hexadecimal into unsigned integer.
@ -103,7 +103,7 @@ void b_from(uint8_t* buf, const std::string& hex) throw(std::runtime_error);
* Parameter hex: The hexadecimal string.
* Throws std::runtime_error: Bad hexadecimal character in string.
*/
template<typename T> T from(const std::string& hex) throw(std::runtime_error);
template<typename T> T from(const std::string& hex);
}
#endif

View file

@ -21,7 +21,7 @@ public:
* Returns: The number drawn.
* Throws std::bad_alloc: Not enough memory.
*/
uint64_t operator()() throw(std::bad_alloc);
uint64_t operator()();
/**
* Return a number into the pool.
*

View file

@ -182,21 +182,21 @@ class pointer
{
public:
pointer();
pointer(const std::string& ptr) throw(std::bad_alloc);
pointer(const std::u32string& ptr) throw(std::bad_alloc);
pointer pastend() const throw(std::bad_alloc) { return field(U"-"); }
pointer& pastend_inplace() throw(std::bad_alloc) { return field_inplace(U"-"); }
pointer index(uint64_t idx) const throw(std::bad_alloc);
pointer& index_inplace(uint64_t idx) throw(std::bad_alloc);
pointer field(const std::string& fld) const throw(std::bad_alloc) { return field(utf8::to32(fld)); }
pointer& field_inplace(const std::string& fld) throw(std::bad_alloc)
pointer(const std::string& ptr);
pointer(const std::u32string& ptr);
pointer pastend() const { return field(U"-"); }
pointer& pastend_inplace() { return field_inplace(U"-"); }
pointer index(uint64_t idx) const;
pointer& index_inplace(uint64_t idx);
pointer field(const std::string& fld) const { return field(utf8::to32(fld)); }
pointer& field_inplace(const std::string& fld)
{
return field_inplace(utf8::to32(fld));
}
pointer field(const std::u32string& fld) const throw(std::bad_alloc);
pointer& field_inplace(const std::u32string& fld) throw(std::bad_alloc);
pointer remove() const throw(std::bad_alloc);
pointer& remove_inplace() throw(std::bad_alloc);
pointer field(const std::u32string& fld) const;
pointer& field_inplace(const std::u32string& fld);
pointer remove() const;
pointer& remove_inplace();
std::string as_string8() const { return utf8::to8(_pointer); }
std::u32string as_string() const { return _pointer; }
friend std::ostream& operator<<(std::ostream& s, const pointer& p);
@ -299,8 +299,8 @@ public:
*/
node(null_tag) throw();
node(boolean_tag, bool b) throw();
node(string_tag, const std::u32string& str) throw(std::bad_alloc);
node(string_tag, const std::string& str) throw(std::bad_alloc);
node(string_tag, const std::u32string& str);
node(string_tag, const std::string& str);
node(number_tag, double n) throw();
node(number_tag, int64_t n) throw();
node(number_tag, uint64_t n) throw();
@ -314,15 +314,15 @@ public:
/**
* Copy Constructor.
*/
node(const node& _node) throw(std::bad_alloc);
node(const node& _node);
/**
* Construct object from description.
*/
node(const std::string& doc) throw(std::bad_alloc, error);
node(const std::string& doc);
/**
* Serialize document.
*/
std::string serialize(printer* printer = NULL) const throw(std::bad_alloc, error);
std::string serialize(printer* printer = NULL) const;
/**
* Get type of node.
*/
@ -330,68 +330,68 @@ public:
/**
* Get type of node by pointer.
*/
int type_of(const std::u32string& pointer) const throw(std::bad_alloc);
int type_of(const std::string& pointer) const throw(std::bad_alloc)
int type_of(const std::u32string& pointer) const;
int type_of(const std::string& pointer) const
{
return type_of(utf8::to32(pointer));
}
int type_of(const pointer& ptr) const throw(std::bad_alloc)
int type_of(const pointer& ptr) const
{
return type_of(ptr._pointer);
}
/**
* Get type of node by pointer (indirect).
*/
int type_of_indirect(const std::u32string& pointer) const throw(std::bad_alloc);
int type_of_indirect(const std::string& pointer) const throw(std::bad_alloc)
int type_of_indirect(const std::u32string& pointer) const;
int type_of_indirect(const std::string& pointer) const
{
return type_of_indirect(utf8::to32(pointer));
}
int type_of_indirect(const pointer& ptr) const throw(std::bad_alloc)
int type_of_indirect(const pointer& ptr) const
{
return type_of_indirect(ptr._pointer);
}
/**
* Resolve an indirect pointer
*/
std::u32string resolve_indirect(const std::u32string& pointer) const throw(std::bad_alloc);
std::string resolve_indirect(const std::string& pointer) const throw(std::bad_alloc)
std::u32string resolve_indirect(const std::u32string& pointer) const;
std::string resolve_indirect(const std::string& pointer) const
{
return utf8::to8(resolve_indirect(utf8::to32(pointer)));
}
pointer resolve_indirect(const pointer& ptr) const throw(std::bad_alloc)
pointer resolve_indirect(const pointer& ptr) const
{
return pointer(resolve_indirect(ptr._pointer));
}
/**
* Get double numeric value (NT_NUMBER).
*/
double as_double() const throw(error);
double as_double() const;
/**
* Get int64_t value (NT_NUMBER).
*/
int64_t as_int() const throw(error);
int64_t as_int() const;
/**
* Get uint64_t value (NT_NUMBER).
*/
uint64_t as_uint() const throw(error);
uint64_t as_uint() const;
/**
* Read the string as UTF-8 (NT_STRING).
*/
const std::u32string& as_string() const throw(std::bad_alloc, error);
std::string as_string8() const throw(std::bad_alloc, error) { return utf8::to8(as_string()); }
const std::u32string& as_string() const;
std::string as_string8() const { return utf8::to8(as_string()); }
/**
* Get boolean value (NT_BOOLEAN).
*/
bool as_bool() const throw(error);
bool as_bool() const;
/**
* Read number of indices in array (NT_ARRAY).
*/
size_t index_count() const throw(error);
size_t index_count() const;
/**
* Read specified index from array (NT_ARRAY).
*/
const node& index(size_t idx) const throw(error)
const node& index(size_t idx) const
{
const node* n;
auto e = index_soft(idx, n);
@ -401,30 +401,30 @@ public:
/**
* Read number of indices in object key (NT_OBJECT).
*/
size_t field_count(const std::u32string& key) const throw(error);
size_t field_count(const std::string& key) const throw(std::bad_alloc, error)
size_t field_count(const std::u32string& key) const;
size_t field_count(const std::string& key) const
{
return field_count(utf8::to32(key));
}
/**
* Specified field exists (NT_OBJECT)
*/
bool field_exists(const std::u32string& key) const throw(error);
bool field_exists(const std::string& key) const throw(std::bad_alloc, error)
bool field_exists(const std::u32string& key) const;
bool field_exists(const std::string& key) const
{
return field_exists(utf8::to32(key));
}
/**
* Read specified key from object (NT_OBJECT).
*/
const node& field(const std::u32string& key, size_t subindex = 0) const throw(error)
const node& field(const std::u32string& key, size_t subindex = 0) const
{
const node* n;
auto e = field_soft(key, subindex, n);
if(e != ERR_OK) throw error(e);
return *n;
}
const node& field(const std::string& key, size_t subindex = 0) const throw(std::bad_alloc, error)
const node& field(const std::string& key, size_t subindex = 0) const
{
return field(utf8::to32(key), subindex);
}
@ -432,40 +432,40 @@ public:
/**
* Apply JSON pointer (RFC 6901).
*/
const node& follow(const std::u32string& pointer) const throw(std::bad_alloc, error)
const node& follow(const std::u32string& pointer) const
{
const node* n;
auto e = follow_soft(pointer, n);
if(e != ERR_OK) throw error(e);
return *n;
}
const node& follow(const std::string& pointer) const throw(std::bad_alloc, error)
const node& follow(const std::string& pointer) const
{
return follow(utf8::to32(pointer));
}
const node& follow(const pointer& ptr) const throw(std::bad_alloc, error)
const node& follow(const pointer& ptr) const
{
return follow(ptr._pointer);
}
/**
* Apply JSON pointer (RFC 6901) following strings as indirect references.
*/
const node& follow_indirect(const std::u32string& pointer) const throw(std::bad_alloc, error)
const node& follow_indirect(const std::u32string& pointer) const
{
return follow(resolve_indirect(pointer));
}
const node& follow_indirect(const std::string& pointer) const throw(std::bad_alloc, error)
const node& follow_indirect(const std::string& pointer) const
{
return follow_indirect(utf8::to32(pointer));
}
const node& follow_indirect(const pointer& ptr) const throw(std::bad_alloc, error)
const node& follow_indirect(const pointer& ptr) const
{
return follow_indirect(ptr._pointer);
}
/**
* Set value of node (any).
*/
node& operator=(const node& node) throw(std::bad_alloc);
node& operator=(const node& node);
/**
* Set value of node.
*/
@ -474,15 +474,15 @@ public:
node& set(number_tag, double number) throw();
node& set(number_tag, int64_t number) throw();
node& set(number_tag, uint64_t number) throw();
node& set(string_tag, const std::u32string& key) throw(std::bad_alloc);
node& set(string_tag tag, const std::string& key) throw(std::bad_alloc)
node& set(string_tag, const std::u32string& key);
node& set(string_tag tag, const std::string& key)
{
return set(tag, utf8::to32(key));
}
/**
* Read/Write specified index from array (NT_ARRAY).
*/
node& index(size_t idx) throw(error)
node& index(size_t idx)
{
node* n;
auto e = index_soft(idx, n);
@ -492,141 +492,141 @@ public:
/**
* Append new element to array (NT_ARRAY).
*/
node& append(const node& node) throw(std::bad_alloc, error);
node& append(const node& node);
/**
* Read/Write specified key from object (NT_OBJECT).
*/
node& field(const std::u32string& key, size_t subindex = 0) throw(error)
node& field(const std::u32string& key, size_t subindex = 0)
{
node* n;
auto e = field_soft(key, subindex, n);
if(e != ERR_OK) throw error(e);
return *n;
}
node& field(const std::string& key, size_t subindex = 0) throw(std::bad_alloc, error)
node& field(const std::string& key, size_t subindex = 0)
{
return field(utf8::to32(key), subindex);
}
/**
* Insert new element to object (NT_OBJECT).
*/
node& insert(const std::u32string& key, const node& node) throw(std::bad_alloc, error);
node& insert(const std::string& key, const node& node) throw(std::bad_alloc, error)
node& insert(const std::u32string& key, const node& node);
node& insert(const std::string& key, const node& node)
{
return insert(utf8::to32(key), node);
}
/**
* Apply JSON pointer (RFC 6901).
*/
node& follow(const std::u32string& pointer) throw(std::bad_alloc, error)
node& follow(const std::u32string& pointer)
{
node* n;
auto e = follow_soft(pointer, n);
if(e != ERR_OK) throw error(e);
return *n;
}
node& follow(const std::string& pointer) throw(std::bad_alloc, error)
node& follow(const std::string& pointer)
{
return follow(utf8::to32(pointer));
}
node& follow(const pointer& ptr) throw(std::bad_alloc, error)
node& follow(const pointer& ptr)
{
return follow(ptr._pointer);
}
/**
* Apply JSON pointer (RFC 6901) following strings as indirect references.
*/
node& follow_indirect(const std::u32string& pointer) throw(std::bad_alloc, error)
node& follow_indirect(const std::u32string& pointer)
{
return follow(resolve_indirect(pointer));
}
node& follow_indirect(const std::string& pointer) throw(std::bad_alloc, error)
node& follow_indirect(const std::string& pointer)
{
return follow_indirect(utf8::to32(pointer));
}
node& follow_indirect(const pointer& ptr) throw(std::bad_alloc, error)
node& follow_indirect(const pointer& ptr)
{
return follow_indirect(ptr._pointer);
}
/**
* Return node specified by JSON pointer (RFC 6901). If the last component doesn't exist, it is created as NULL.
*/
node& operator[](const std::u32string& pointer) throw(std::bad_alloc, error);
node& operator[](const std::string& pointer) throw(std::bad_alloc, error)
node& operator[](const std::u32string& pointer);
node& operator[](const std::string& pointer)
{
return (*this)[utf8::to32(pointer)];
}
node& operator[](const pointer& ptr) throw(std::bad_alloc, error)
node& operator[](const pointer& ptr)
{
return (*this)[ptr._pointer];
}
/**
* Create node at specified pointer and return it.
*/
node& insert_node(const std::u32string& pointer, const node& nwn) throw(std::bad_alloc, error);
node& insert_node(const std::string& pointer, const node& nwn) throw(std::bad_alloc, error)
node& insert_node(const std::u32string& pointer, const node& nwn);
node& insert_node(const std::string& pointer, const node& nwn)
{
return insert_node(utf8::to32(pointer), nwn);
}
node& insert_node(const pointer& ptr, const node& nwn) throw(std::bad_alloc, error)
node& insert_node(const pointer& ptr, const node& nwn)
{
return insert_node(ptr._pointer, nwn);
}
/**
* Delete a node by pointer and return what was deleted.
*/
node delete_node(const std::u32string& pointer) throw(std::bad_alloc, error);
node delete_node(const std::string& pointer) throw(std::bad_alloc, error)
node delete_node(const std::u32string& pointer);
node delete_node(const std::string& pointer)
{
return delete_node(utf8::to32(pointer));
}
node delete_node(const pointer& ptr) throw(std::bad_alloc, error)
node delete_node(const pointer& ptr)
{
return delete_node(ptr._pointer);
}
/**
* Synonym for follow().
*/
const node& operator[](const std::u32string& pointer) const throw(std::bad_alloc, error)
const node& operator[](const std::u32string& pointer) const
{
return follow(pointer);
}
const node& operator[](const std::string& pointer) const throw(std::bad_alloc, error)
const node& operator[](const std::string& pointer) const
{
return follow(pointer);
}
const node& operator[](const pointer& ptr) const throw(std::bad_alloc, error)
const node& operator[](const pointer& ptr) const
{
return follow(ptr._pointer);
}
/**
* Delete an array index. The rest are shifted.
*/
void erase_index(size_t idx) throw(error);
void erase_index(size_t idx);
/**
* Delete an array field. The rest are shifted.
*/
void erase_field(const std::u32string& fld, size_t idx = 0) throw(error);
void erase_field(const std::string& fld, size_t idx = 0) throw(std::bad_alloc, error)
void erase_field(const std::u32string& fld, size_t idx = 0);
void erase_field(const std::string& fld, size_t idx = 0)
{
erase_field(utf8::to32(fld), idx);
}
/**
* Delete an entiere array field.
*/
void erase_field_all(const std::u32string& fld) throw(error);
void erase_field_all(const std::string& fld) throw(std::bad_alloc, error)
void erase_field_all(const std::u32string& fld);
void erase_field_all(const std::string& fld)
{
erase_field_all(utf8::to32(fld));
}
/**
* Apply a JSON patch.
*/
node patch(const node& patch) const throw(std::bad_alloc, error);
node patch(const node& patch) const;
/**
* Clear entiere array or object.
*/
void clear() throw(error);
void clear();
/**
* Iterator.
*/
@ -639,14 +639,14 @@ public:
typedef node& reference;
typedef node* pointer;
iterator() throw();
iterator(node& n) throw(error);
std::u32string key() throw(std::bad_alloc, error);
std::string key8() throw(std::bad_alloc, error) { return utf8::to8(key()); }
size_t index() throw(error);
node& operator*() throw(error);
node* operator->() throw(error);
iterator operator++(int) throw(error);
iterator& operator++() throw(error);
iterator(node& n);
std::u32string key();
std::string key8() { return utf8::to8(key()); }
size_t index();
node& operator*();
node* operator->();
iterator operator++(int);
iterator& operator++();
bool operator==(const iterator& i) throw();
bool operator!=(const iterator& i) throw();
private:
@ -667,14 +667,14 @@ public:
typedef const node& reference;
typedef const node* pointer;
const_iterator() throw();
const_iterator(const node& n) throw(error);
std::u32string key() throw(std::bad_alloc, error);
std::string key8() throw(std::bad_alloc, error) { return utf8::to8(key()); }
size_t index() throw(error);
const node& operator*() throw(error);
const node* operator->() throw(error);
const_iterator operator++(int) throw(error);
const_iterator& operator++() throw(error);
const_iterator(const node& n);
std::u32string key();
std::string key8() { return utf8::to8(key()); }
size_t index();
const node& operator*();
const node* operator->();
const_iterator operator++(int);
const_iterator& operator++();
bool operator==(const const_iterator& i) throw();
bool operator!=(const const_iterator& i) throw();
private:
@ -685,14 +685,14 @@ public:
/**
* Iterators
*/
const_iterator begin() const throw(error) { return const_iterator(*this); }
const_iterator begin() const { return const_iterator(*this); }
const_iterator end() const throw() { return const_iterator(); }
iterator begin() throw(error) { return iterator(*this); }
iterator begin() { return iterator(*this); }
iterator end() throw() { return iterator(); }
/**
* Delete item pointed by iterator. The rest are shifted and new iterator is returned.
*/
iterator erase(iterator itr) throw(error);
iterator erase(iterator itr);
private:
class number_holder
{
@ -723,8 +723,8 @@ private:
friend class iterator;
friend class const_iterator;
void fixup_nodes(const node& _node);
void ctor(const std::string& doc, size_t& ptr, size_t len) throw(std::bad_alloc, error);
node(const std::string& doc, size_t& ptr, size_t len) throw(std::bad_alloc, error);
void ctor(const std::string& doc, size_t& ptr, size_t len);
node(const std::string& doc, size_t& ptr, size_t len);
template<typename T> void set_helper(T v)
{
std::u32string tmp;
@ -748,8 +748,8 @@ private:
std::list<node> xarray;
std::vector<node*> xarray_index;
std::map<std::u32string, std::list<node>> xobject;
errorcode follow_soft(const std::u32string& pointer, const node*& out) const throw(std::bad_alloc);
errorcode follow_soft(const std::u32string& pointer, node*& out) throw(std::bad_alloc);
errorcode follow_soft(const std::u32string& pointer, const node*& out) const;
errorcode follow_soft(const std::u32string& pointer, node*& out);
errorcode field_soft(const std::u32string& key, size_t subindex, node*& out) throw();
errorcode field_soft(const std::u32string& key, size_t subindex, const node*& out) const throw();
errorcode index_soft(size_t index, node*& out) throw();

View file

@ -18,7 +18,7 @@ class invbind;
class ctrlrkey;
std::pair<key*, unsigned> keymapper_lookup_subkey(keyboard& kbd, const std::string& name,
bool axis) throw(std::bad_alloc, std::runtime_error);
bool axis);
/**
* Key specifier
@ -28,17 +28,17 @@ struct keyspec
/**
* Create a new key specifier (invalid).
*/
keyspec() throw(std::bad_alloc);
keyspec();
/**
* Create a new key specifier from keyspec.
*
* Parameter keyspec: The key specifier.
*/
keyspec(const std::string& keyspec) throw(std::bad_alloc, std::runtime_error);
keyspec(const std::string& keyspec);
/**
* Get the key specifier as a keyspec.
*/
operator std::string() throw(std::bad_alloc);
operator std::string();
/**
* Is valid?
*/
@ -126,7 +126,7 @@ public:
/**
* Add a callback on new invese bind.
*/
void add_callback(listener& listener) throw(std::bad_alloc);
void add_callback(listener& listener);
/**
* Drop a callback on new inverse bind.
*/
@ -142,7 +142,7 @@ public:
/**
* Create new keyboard mapper.
*/
mapper(keyboard& kbd, command::group& domain) throw(std::bad_alloc);
mapper(keyboard& kbd, command::group& domain);
/**
* Destroy a keyboard mapper.
*/
@ -157,8 +157,7 @@ public:
* throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: The binding would conflict with existing one or invalid modifier/key.
*/
void bind(std::string mod, std::string modmask, std::string keyname, std::string command)
throw(std::bad_alloc, std::runtime_error);
void bind(std::string mod, std::string modmask, std::string keyname, std::string command);
/**
* Unbinds a key, erroring out if binding does not exist.
*
@ -168,68 +167,67 @@ public:
* throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: The binding does not exist.
*/
void unbind(std::string mod, std::string modmask, std::string keyname) throw(std::bad_alloc,
std::runtime_error);
void unbind(std::string mod, std::string modmask, std::string keyname);
/**
* Get keys bound.
*
* Returns: The set of keyspecs that are bound.
*/
std::list<keyspec> get_bindings() throw(std::bad_alloc);
std::list<keyspec> get_bindings();
/**
* Get command for key.
*/
std::string get(const keyspec& keyspec) throw(std::bad_alloc);
std::string get(const keyspec& keyspec);
/**
* Bind command for key.
*
* Parameter keyspec: The key specifier to bind to.
* Parameter cmd: The command to bind. If "", the key is unbound.
*/
void set(const keyspec& keyspec, const std::string& cmd) throw(std::bad_alloc, std::runtime_error);
void set(const keyspec& keyspec, const std::string& cmd);
/**
* Get set of inverse binds.
*
* Returns: The set of all inverses.
*/
std::set<invbind*> get_inverses() throw(std::bad_alloc);
std::set<invbind*> get_inverses();
/**
* Find inverse bind by command.
*
* Parameter command: The command.
* Returns: The inverse bind, or NULL if none.
*/
invbind* get_inverse(const std::string& command) throw(std::bad_alloc);
invbind* get_inverse(const std::string& command);
/**
* Get set of controller keys.
*
* Returns: The set of all controller keys.
*/
std::set<ctrlrkey*> get_controller_keys() throw(std::bad_alloc);
std::set<ctrlrkey*> get_controller_keys();
/**
* Get specific controller key.
*/
ctrlrkey* get_controllerkey(const std::string& command) throw(std::bad_alloc);
ctrlrkey* get_controllerkey(const std::string& command);
/**
* Get list of controller keys for specific keyboard key.
*/
std::list<ctrlrkey*> get_controllerkeys_kbdkey(key* kbdkey) throw(std::bad_alloc);
std::list<ctrlrkey*> get_controllerkeys_kbdkey(key* kbdkey);
/**
* Register inverse bind.
*/
void do_register(const std::string& name, invbind& bind) throw(std::bad_alloc);
void do_register(const std::string& name, invbind& bind);
/**
* Unregister inverse bind.
*/
void do_unregister(const std::string& name, invbind& bind) throw(std::bad_alloc);
void do_unregister(const std::string& name, invbind& bind);
/**
* Register controller key.
*/
void do_register(const std::string& name, ctrlrkey& ckey) throw(std::bad_alloc);
void do_register(const std::string& name, ctrlrkey& ckey);
/**
* Unregister inverse bind.
*/
void do_unregister(const std::string& name, ctrlrkey& ckey) throw(std::bad_alloc);
void do_unregister(const std::string& name, ctrlrkey& ckey);
/**
* Get keyboard.
*/
@ -245,7 +243,7 @@ public:
* Parameter polarity: Polarity (true is rising edge, false is falling edge).
* Returns: The fixed command, or "" if nothing should be run.
*/
static std::string fixup_command_polarity(std::string cmd, bool polarity) throw(std::bad_alloc);
static std::string fixup_command_polarity(std::string cmd, bool polarity);
/**
* Add a set of inverse binds.
*/
@ -268,7 +266,7 @@ public:
bool operator!=(const struct triplet& a) const { return !(a == *this); }
bool operator>=(const struct triplet& a) const { return !(a < *this); }
bool operator>(const struct triplet& a) const { return (a < *this); }
keyspec as_keyspec() const throw(std::bad_alloc);
keyspec as_keyspec() const;
bool index;
modifier_set mod;
modifier_set mask;
@ -311,8 +309,7 @@ public:
* Parameter _command: Command this is for.
* Parameter _name: Name of inverse key.
*/
invbind_info(invbind_set& set, const std::string& _command, const std::string& _name)
throw(std::bad_alloc);
invbind_info(invbind_set& set, const std::string& _command, const std::string& _name);
/**
* Destructor.
*/
@ -344,8 +341,7 @@ public:
* Parameter command: Command this is for.
* Parameter name: Name of inverse key.
*/
invbind(mapper& kmapper, const std::string& command, const std::string& name, bool dynamic = false)
throw(std::bad_alloc);
invbind(mapper& kmapper, const std::string& command, const std::string& name, bool dynamic = false);
/**
* Destructor.
*/
@ -356,25 +352,25 @@ public:
* Parameter index: Index of the keyspec to get.
* Returns: The keyspec.
*/
keyspec get(unsigned index) throw(std::bad_alloc);
keyspec get(unsigned index);
/**
* Clear key (subsequent keys fill the gap).
*
* Parameter index: Index of key to clear.
*/
void clear(unsigned index) throw(std::bad_alloc);
void clear(unsigned index);
/**
* Add key to set.
*
* Parameter keyspec: The new keyspec.
*/
void append(const keyspec& keyspec) throw(std::bad_alloc);
void append(const keyspec& keyspec);
/**
* Get name for command.
*
* Returns: The name.
*/
std::string getname() throw(std::bad_alloc);
std::string getname();
/**
* Notify mapper dying.
*/
@ -408,7 +404,7 @@ public:
* Parameter axis: If true, create a axis-type key.
*/
ctrlrkey(mapper& kmapper, const std::string& command, const std::string& name,
bool axis = false) throw(std::bad_alloc);
bool axis = false);
/**
* Destructor.
*/
@ -420,7 +416,7 @@ public:
/**
* Get the trigger key.
*/
std::string get_string(unsigned index) throw(std::bad_alloc);
std::string get_string(unsigned index);
/**
* Set the trigger key (appends).
*/
@ -428,7 +424,7 @@ public:
/**
* Set the trigger key (appends).
*/
void append(const std::string& key) throw(std::bad_alloc, std::runtime_error);
void append(const std::string& key);
/**
* Remove the trigger key.
*/

View file

@ -27,7 +27,7 @@ public:
/**
* Create a new instance.
*/
keyboard() throw(std::bad_alloc);
keyboard();
/**
* Destroy an instance.
*
@ -41,7 +41,7 @@ public:
* Returns: The modifier.
* Throws std::runtime_error: No such modifier.
*/
modifier& lookup_modifier(const std::string& name) throw(std::runtime_error);
modifier& lookup_modifier(const std::string& name);
/**
* Try lookup modifier by name.
*
@ -54,14 +54,14 @@ public:
*
* Returns: The set of modifiers.
*/
std::list<modifier*> all_modifiers() throw(std::bad_alloc);
std::list<modifier*> all_modifiers();
/**
* Register a modifier.
*
* Parameter name: The name of the modifier.
* Parameter mod: The modifier.
*/
void do_register(const std::string& name, modifier& mod) throw(std::bad_alloc);
void do_register(const std::string& name, modifier& mod);
/**
* Unregister a modifier.
*
@ -75,7 +75,7 @@ public:
* Returns: The key.
* Throws std::runtime_error: No such key.
*/
key& lookup_key(const std::string& name) throw(std::runtime_error);
key& lookup_key(const std::string& name);
/**
* Try lookup key by name.
*
@ -88,14 +88,14 @@ public:
*
* Returns: The set of keys.
*/
std::list<key*> all_keys() throw(std::bad_alloc);
std::list<key*> all_keys();
/**
* Register a key.
*
* Parameter name: The name of the key.
* Parameter mod: The key.
*/
void do_register(const std::string& name, key& mod) throw(std::bad_alloc);
void do_register(const std::string& name, key& mod);
/**
* Unregister a key.
*
@ -132,7 +132,7 @@ public:
* Parameter keyb: The keyboard these will be on.
* Parameter _name: The name of the modifier.
*/
modifier(keyboard& keyb, const std::string& _name) throw(std::bad_alloc)
modifier(keyboard& keyb, const std::string& _name)
: kbd(keyb), name(_name)
{
keyb.do_register(name, *this);
@ -144,7 +144,7 @@ public:
* Parameter _name: The name of the modifier.
* Parameter _link: The name of the modifier group this is in.
*/
modifier(keyboard& keyb, const std::string& _name, const std::string& _link) throw(std::bad_alloc)
modifier(keyboard& keyb, const std::string& _name, const std::string& _link)
: kbd(keyb), name(_name), link(_link)
{
keyb.do_register(name, *this);
@ -195,7 +195,7 @@ public:
* parameter really: If true, actually add the key. If false, do nothing.
* throws std::bad_alloc: Not enough memory.
*/
void add(modifier& mod, bool really = true) throw(std::bad_alloc);
void add(modifier& mod, bool really = true);
/**
* Remove a modifier from the set.
*
@ -203,7 +203,7 @@ public:
* parameter really: If true, actually remove the key. If false, do nothing.
* throws std::bad_alloc: Not enough memory.
*/
void remove(modifier& mod, bool really = true) throw(std::bad_alloc);
void remove(modifier& mod, bool really = true);
/**
* Construct modifier set from comma-separated string.
*
@ -213,8 +213,7 @@ public:
* throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Illegal modifier or wrong syntax.
*/
static modifier_set construct(keyboard& kbd, const std::string& modifiers) throw(std::bad_alloc,
std::runtime_error);
static modifier_set construct(keyboard& kbd, const std::string& modifiers);
/**
* Check modifier against its mask for validity.
*
@ -226,7 +225,7 @@ public:
* returns: True if set is valid, false if not.
* throws std::bad_alloc: Not enough memory.
*/
bool valid(modifier_set& mask) throw(std::bad_alloc);
bool valid(modifier_set& mask);
/**
* Check if this modifier set triggers the action.
*
@ -236,11 +235,11 @@ public:
* - Modifiers with this linkage group do not appear in either set nor trigger.
*
*/
bool triggers(const modifier_set& trigger, const modifier_set& mask) throw(std::bad_alloc);
bool triggers(const modifier_set& trigger, const modifier_set& mask);
/**
* Stringify.
*/
operator std::string() const throw(std::bad_alloc);
operator std::string() const;
/**
* Equality check.
*
@ -500,8 +499,7 @@ public:
* Parameter clazz: The class of the key.
* Parameter type: The type of key.
*/
key(keyboard& keyb, const std::string& name, const std::string& clazz, keytype type)
throw(std::bad_alloc);
key(keyboard& keyb, const std::string& name, const std::string& clazz, keytype type);
/**
* Destructor.
*/
@ -528,7 +526,7 @@ public:
* Parameter listener: The listener.
* Parameter analog: If true, also pass analog events.
*/
void add_listener(event_listener& listener, bool analog) throw(std::bad_alloc);
void add_listener(event_listener& listener, bool analog);
/**
* Remove listener.
*
@ -559,7 +557,7 @@ public:
/**
* Get the subkey suffixes.
*/
virtual std::vector<std::string> get_subkeys() throw(std::bad_alloc) = 0;
virtual std::vector<std::string> get_subkeys() = 0;
/**
* Dynamic cast to axis type.
*/
@ -601,7 +599,7 @@ public:
* Parameter name: The base name of the key.
* Parameter clazz: The class of the key.
*/
key_key(keyboard& keyb, const std::string& name, const std::string& clazz) throw(std::bad_alloc);
key_key(keyboard& keyb, const std::string& name, const std::string& clazz);
/**
* Destructor.
*/
@ -624,7 +622,7 @@ public:
/**
* Get the subkey suffixes.
*/
std::vector<std::string> get_subkeys() throw(std::bad_alloc);
std::vector<std::string> get_subkeys();
private:
key_key(key_key&);
key_key& operator=(key_key&);
@ -644,7 +642,7 @@ public:
* Parameter name: The base name of the key.
* Parameter clazz: The class of the key.
*/
key_hat(keyboard& keyb, const std::string& name, const std::string& clazz) throw(std::bad_alloc);
key_hat(keyboard& keyb, const std::string& name, const std::string& clazz);
/**
* Destructor.
*/
@ -667,7 +665,7 @@ public:
/**
* Get the subkey suffixes.
*/
std::vector<std::string> get_subkeys() throw(std::bad_alloc);
std::vector<std::string> get_subkeys();
private:
key_hat(key_hat&);
key_hat& operator=(key_hat&);
@ -688,8 +686,7 @@ public:
* Parameter clazz: The class of the key.
* Parameter mode: Initial mode: -1 => disabled, 0 => axis, 1 => pressure
*/
key_axis(keyboard& keyb, const std::string& name, const std::string& clazz, int mode)
throw(std::bad_alloc);
key_axis(keyboard& keyb, const std::string& name, const std::string& clazz, int mode);
/**
* Destructor.
*/
@ -712,7 +709,7 @@ public:
/**
* Get the subkey suffixes.
*/
std::vector<std::string> get_subkeys() throw(std::bad_alloc);
std::vector<std::string> get_subkeys();
/**
* Get mode.
*/
@ -745,7 +742,7 @@ public:
* Parameter cal: Initial calibration.
*/
key_mouse(keyboard& keyb, const std::string& name, const std::string& clazz,
mouse_calibration cal) throw(std::bad_alloc);
mouse_calibration cal);
/**
* Destructor.
*/
@ -768,7 +765,7 @@ public:
/**
* Get the subkey suffixes. Returns empty list.
*/
std::vector<std::string> get_subkeys() throw(std::bad_alloc);
std::vector<std::string> get_subkeys();
/**
* Get calibration.
*/

View file

@ -32,7 +32,7 @@ public:
* Throws std::bad_alloc: Not enough memory.
* Throws std::runtime_error: Error loading shared library.
*/
library(const std::string& filename) throw(std::bad_alloc, std::runtime_error)
library(const std::string& filename)
{
try {
set_loading(this);
@ -60,7 +60,7 @@ public:
* Throws std::bad_alloc: Not enough memory.
* Throws std::runtime_error: Error looking up the symbol.
*/
void* operator[](const std::string& symbol) const throw(std::bad_alloc, std::runtime_error)
void* operator[](const std::string& symbol) const
{
threads::alock h(global_mutex());
if(!lib) throw std::runtime_error("Symbol '" + symbol + "' not found");
@ -106,12 +106,12 @@ public:
*/
static library* loading() throw();
private:
void set_loading(library* lib) throw(std::bad_alloc);
void set_loading(library* lib);
struct internal
{
internal(const std::string& filename) throw(std::bad_alloc, std::runtime_error);
internal(const std::string& filename);
~internal() throw();
void* operator[](const std::string& symbol) const throw(std::bad_alloc, std::runtime_error);
void* operator[](const std::string& symbol) const;
internal(const internal&);
internal& operator=(const internal&);
void* handle;
@ -158,11 +158,11 @@ public:
/**
* Symbol lookup.
*/
void* operator[](const std::string& symbol) const throw(std::bad_alloc, std::runtime_error);
void* operator[](const std::string& symbol) const;
/**
* Variable symbol lookup.
*/
template<typename T> T* var(const std::string& symbol) const throw(std::bad_alloc, std::runtime_error)
template<typename T> T* var(const std::string& symbol) const
{
return (T*)(*this)[symbol];
}
@ -170,7 +170,6 @@ public:
* Function symbol lookup.
*/
template<typename T, typename... U> typename fntype<T, U...>::t fn(const std::string& symbol) const
throw(std::bad_alloc, std::runtime_error)
{
return (typename fntype<T, U...>::t)(*this)[symbol];
}

View file

@ -194,7 +194,7 @@ public:
/**
* Create a new state.
*/
state() throw(std::bad_alloc);
state();
/**
* Create a new state with specified master state.
*/
@ -235,7 +235,7 @@ public:
/**
* Reset the state.
*/
void reset() throw(std::runtime_error, std::bad_alloc);
void reset();
/**
* Deinit the state.
*/
@ -308,7 +308,7 @@ public:
* Returns: The string.
* Throws std::runtime_error: The specified argument is not a string.
*/
std::string get_string(int argindex, const std::string& fname) throw(std::runtime_error, std::bad_alloc)
std::string get_string(int argindex, const std::string& fname)
{
if(isnone(argindex))
(stringfmt() << "argument #" << argindex << " to " << fname << " must be string").throwex();
@ -326,7 +326,7 @@ public:
* Returns: The string.
* Throws std::runtime_error: The specified argument is not a boolean.
*/
bool get_bool(int argindex, const std::string& fname) throw(std::runtime_error, std::bad_alloc)
bool get_bool(int argindex, const std::string& fname)
{
if(isnone(argindex) || !isboolean(argindex))
(stringfmt() << "argument #" << argindex << " to " << fname << " must be boolean").throwex();

View file

@ -377,7 +377,6 @@ public:
* Throws std::runtime_error: Wrong type.
*/
static T* get(state& _state, int arg, const std::string& fname, bool optional = false)
throw(std::bad_alloc, std::runtime_error)
{
return objclass<T>()._get(_state, arg, fname, optional);
}
@ -433,8 +432,7 @@ public:
* Parameter fname: Name of function for error message purposes.
* Throws std::runtime_error: Wrong type.
*/
static objpin<T> pin(state& _state, int arg, const std::string& fname) throw(std::bad_alloc,
std::runtime_error)
static objpin<T> pin(state& _state, int arg, const std::string& fname)
{
return objclass<T>()._pin(_state, arg, fname);
}

View file

@ -17,10 +17,8 @@ struct render_context
uint32_t height;
};
framebuffer::color get_fb_color(lua::state& L, int index, const std::string& fname)
throw(std::bad_alloc, std::runtime_error);
framebuffer::color get_fb_color(lua::state& L, int index, const std::string& fname, int64_t dflt)
throw(std::bad_alloc, std::runtime_error);
framebuffer::color get_fb_color(lua::state& L, int index, const std::string& fname);
framebuffer::color get_fb_color(lua::state& L, int index, const std::string& fname, int64_t dflt);
}
#endif

View file

@ -58,7 +58,7 @@ public:
/**
* Register function.
*/
function(function_group& group, const std::string& name) throw(std::bad_alloc);
function(function_group& group, const std::string& name);
/**
* Unregister function.
*/

View file

@ -22,12 +22,12 @@ public:
*
* Parameter space: The memory space.
*/
memory_search(memory_space& space) throw(std::bad_alloc);
memory_search(memory_space& space);
/**
* Reset the context so all addresses are candidates again.
*/
void reset() throw(std::bad_alloc);
void reset();
/**
* This searches the memory space, leaving those addresses for which condition object returns true.
@ -54,7 +54,7 @@ public:
/**
* Returns list of all candidates. This function isn't lazy, so be careful when calling with many candidates.
*/
std::list<uint64_t> get_candidates() throw(std::bad_alloc);
std::list<uint64_t> get_candidates();
/**
* Is specified address a candidate?
*/

View file

@ -23,7 +23,7 @@ public:
/**
* Handle update.
*/
virtual void messagebuffer_update() throw(std::bad_alloc, std::runtime_error) = 0;
virtual void messagebuffer_update() = 0;
};
/**
* Create new message buffer with specified maximum message count.
@ -33,7 +33,7 @@ public:
* Throws std::bad_alloc: Not enough memory.
* Throws std::logic_error: Windowsize is greater than maxmessages or maxmessages is zero.
*/
messagebuffer(size_t maxmessages, size_t windowsize) throw(std::bad_alloc, std::logic_error);
messagebuffer(size_t maxmessages, size_t windowsize);
/**
* Add a new message to the buffer.
@ -42,7 +42,7 @@ public:
* Throws std::bad_alloc: Not enough memory.
* Throws std::runtime_error: Thrown through from update handler.
*/
void add_message(const std::string& msg) throw(std::bad_alloc, std::runtime_error);
void add_message(const std::string& msg);
/**
* Read a message.
@ -52,7 +52,7 @@ public:
* Throws std::bad_alloc: Not enough memory.
* Throws std::logic_error: Invalid message number.
*/
const std::string& get_message(size_t msgnum) throw(std::bad_alloc, std::logic_error);
const std::string& get_message(size_t msgnum);
/**
* Get the number of first message present.
@ -117,7 +117,7 @@ public:
* Throws std::bad_alloc: Not enough memory.
* Throws std::runtime_error: Thrown through from update handler.
*/
void scroll_beginning() throw(std::bad_alloc, std::runtime_error);
void scroll_beginning();
/**
* Scroll up one page.
@ -125,7 +125,7 @@ public:
* Throws std::bad_alloc: Not enough memory.
* Throws std::runtime_error: Thrown through from update handler.
*/
void scroll_up_page() throw(std::bad_alloc, std::runtime_error);
void scroll_up_page();
/**
* Scroll up one line.
@ -133,7 +133,7 @@ public:
* Throws std::bad_alloc: Not enough memory.
* Throws std::runtime_error: Thrown through from update handler.
*/
void scroll_up_line() throw(std::bad_alloc, std::runtime_error);
void scroll_up_line();
/**
* Scroll down one line.
@ -141,7 +141,7 @@ public:
* Throws std::bad_alloc: Not enough memory.
* Throws std::runtime_error: Thrown through from update handler.
*/
void scroll_down_line() throw(std::bad_alloc, std::runtime_error);
void scroll_down_line();
/**
* Scroll down one page.
@ -149,7 +149,7 @@ public:
* Throws std::bad_alloc: Not enough memory.
* Throws std::runtime_error: Thrown through from update handler.
*/
void scroll_down_page() throw(std::bad_alloc, std::runtime_error);
void scroll_down_page();
/**
* Scroll to beginning.
@ -157,7 +157,7 @@ public:
* Throws std::bad_alloc: Not enough memory.
* Throws std::runtime_error: Thrown through from update handler.
*/
void scroll_end() throw(std::bad_alloc, std::runtime_error);
void scroll_end();
/**
* Register an update handler.
@ -165,7 +165,7 @@ public:
* Parameter handler: The new handler.
* Throws std::bad_alloc: Not enough memory.
*/
void register_handler(update_handler& handler) throw(std::bad_alloc);
void register_handler(update_handler& handler);
/**
* Unregister an update handler.
@ -182,7 +182,7 @@ public:
* Throws std::bad_alloc: Not enough memory.
* Throws std::logic_error: Windowsize is greater than maxmessages or maxmessages is zero.
*/
void set_max_window_size(size_t windowsize) throw(std::bad_alloc, std::logic_error);
void set_max_window_size(size_t windowsize);
/**
* Read the window size.

View file

@ -18,7 +18,7 @@ public:
*
* throws std::bad_alloc: Not enough memory.
*/
movie() throw(std::bad_alloc);
movie();
/**
* Dtor.
@ -38,7 +38,7 @@ public:
* parameter enable: If true, switch to read-only mode, else to read-write mode.
* throws std::bad_alloc: Not enough memory.
*/
void readonly_mode(bool enable) throw(std::bad_alloc);
void readonly_mode(bool enable);
/**
* Returns the movie rerecord count (this is not the same thing as global rerecord count).
@ -46,7 +46,7 @@ public:
* returns: The movie rerecord count
* throws std::bad_alloc: Not enough memory.
*/
std::string rerecord_count() throw(std::bad_alloc);
std::string rerecord_count();
/**
* Sets the movie rerecord count (this is not the same thing as global rerecord count).
@ -54,7 +54,7 @@ public:
* parameter count: The new rerecord count
* throws std::bad_alloc: Not enough memory.
*/
void rerecord_count(const std::string& count) throw(std::bad_alloc);
void rerecord_count(const std::string& count);
/**
* Read project ID
@ -62,7 +62,7 @@ public:
* returns: The project ID
* throws std::bad_alloc: Not enough memory.
*/
std::string project_id() throw(std::bad_alloc);
std::string project_id();
/**
* brief Set project ID
@ -70,7 +70,7 @@ public:
* parameter id: New project ID.
* throws std::bad_alloc: Not enough memory.
*/
void project_id(const std::string& id) throw(std::bad_alloc);
void project_id(const std::string& id);
/**
* Get number of frames in movie
@ -101,7 +101,7 @@ public:
*
* throws std::bad_alloc: Not enough memory.
*/
void next_frame() throw(std::bad_alloc);
void next_frame();
/**
* Reads the data ready flag. On new frame, all data ready flags are unset. On reading control, its data ready
@ -112,7 +112,7 @@ public:
* returns: The read value.
* throws std::logic_error: Invalid control index.
*/
bool get_DRDY(unsigned port, unsigned controller, unsigned index) throw(std::logic_error);
bool get_DRDY(unsigned port, unsigned controller, unsigned index);
/**
* Set all data ready flags
@ -128,7 +128,7 @@ public:
* throws std::bad_alloc: Not enough memory.
* throws std::logic_error: Invalid port, controller or index or before movie start.
*/
short next_input(unsigned port, unsigned controller, unsigned index) throw(std::bad_alloc, std::logic_error);
short next_input(unsigned port, unsigned controller, unsigned index);
/**
* Set current control values. These are read in readwrite mode.
@ -154,8 +154,7 @@ public:
* throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Bad movie data.
*/
void load(const std::string& rerecs, const std::string& project_id, portctrl::frame_vector& input)
throw(std::bad_alloc, std::runtime_error);
void load(const std::string& rerecs, const std::string& project_id, portctrl::frame_vector& input);
/**
* This method serializes the state of movie code.
@ -167,7 +166,7 @@ public:
* throws std::bad_alloc: Not enough memory.
*/
void save_state(std::string& proj_id, uint64_t& curframe, uint64_t& lagframes,
std::vector<uint32_t>& pcounters) throw(std::bad_alloc);
std::vector<uint32_t>& pcounters);
/**
* Given previous serialized state from this movie, restore the state.
@ -183,8 +182,7 @@ public:
* Throws std::runtime_error: Movie check failure.
*/
size_t restore_state(uint64_t curframe, uint64_t lagframe, const std::vector<uint32_t>& pcounters, bool ro,
portctrl::frame_vector* old_movie, const std::string& old_projectid) throw(std::bad_alloc,
std::runtime_error);
portctrl::frame_vector* old_movie, const std::string& old_projectid);
/**
* Reset the state of movie to initial state.
*/

View file

@ -90,7 +90,7 @@ public:
* Parameter advance: The number of bytes in packet is stored here.
* Throws std::runtime_error: Bad packet.
*/
page(const char* buffer, size_t& advance) throw(std::runtime_error);
page(const char* buffer, size_t& advance);
/**
* Scan a buffer for pages.
*
@ -200,11 +200,11 @@ public:
/**
* Get debugging info for stream this page is from.
*/
std::string stream_debug_id() const throw(std::bad_alloc);
std::string stream_debug_id() const;
/**
* Get debugging info for this page.
*/
std::string page_debug_id() const throw(std::bad_alloc);
std::string page_debug_id() const;
/**
* The special granule pos for nothing.
*/
@ -343,14 +343,14 @@ public:
* Parameter size: The maximum size to read.
* Returns: The number of bytes actually read.
*/
virtual size_t read(char* buffer, size_t size) throw(std::exception) = 0;
virtual size_t read(char* buffer, size_t size) = 0;
/**
* Read a page from stream.
*
* Parameter page: The page is assigned here if successful.
* Returns: True if page was obtained, false if not.
*/
bool get_page(page& page) throw(std::exception);
bool get_page(page& page);
/**
* Set stream to report errors to.
*
@ -391,7 +391,7 @@ public:
*/
~stream_reader_iostreams() throw();
size_t read(char* buffer, size_t size) throw(std::exception);
size_t read(char* buffer, size_t size);
private:
std::istream& is;
};
@ -416,13 +416,13 @@ public:
* Parameter data: The data to write.
* Parameter size: The size to write.
*/
virtual void write(const char* buffer, size_t size) throw(std::exception) = 0;
virtual void write(const char* buffer, size_t size) = 0;
/**
* Write a page to stream.
*
* Parameter page: The page to write.
*/
void put_page(const page& page) throw(std::exception);
void put_page(const page& page);
private:
stream_writer(const stream_writer&);
stream_writer& operator=(const stream_writer&);
@ -445,7 +445,7 @@ public:
*/
~stream_writer_iostreams() throw();
void write(const char* buffer, size_t size) throw(std::exception);
void write(const char* buffer, size_t size);
private:
std::ostream& os;
};

View file

@ -27,14 +27,14 @@ struct ogg_header
* Parameter pacekt: The packet to parse.
* Throws std::runtime_error: Not valid OggOpus header page.
*/
void parse(struct ogg::packet& packet) throw(std::runtime_error);
void parse(struct ogg::packet& packet);
/**
* Serialize OggOpus header as an Ogg page.
*
* Returns: The serialized page.
* Throws std::runtime_error: Not valid OggOpus header packet.
*/
struct ogg::page serialize() throw(std::runtime_error);
struct ogg::page serialize();
};
/**
@ -50,7 +50,7 @@ struct ogg_tags
* Parameter packet: The packet to parse.
* Throws std::runtime_error: Not valid OggOpus comment packet.
*/
void parse(struct ogg::packet& packet) throw(std::bad_alloc, std::runtime_error);
void parse(struct ogg::packet& packet);
/**
* Serialize OggOpus comments as Ogg pages.
*
@ -59,8 +59,7 @@ struct ogg_tags
* Returns: Next sequence number to use.
* Throws std::runtime_error: Not valid OggOpus comments.
*/
uint32_t serialize(std::function<void(const ogg::page& p)> output, uint32_t strmid)
throw(std::bad_alloc, std::runtime_error);
uint32_t serialize(std::function<void(const ogg::page& p)> output, uint32_t strmid);
};
}
#endif

View file

@ -288,7 +288,7 @@ public:
* Parameter ssize: The storage size in bytes.
* Throws std::bad_alloc: Not enough memory.
*/
type(const std::string& iname, const std::string& hname, size_t ssize) throw(std::bad_alloc);
type(const std::string& iname, const std::string& hname, size_t ssize);
/**
* Unregister a port type.
*/
@ -396,8 +396,7 @@ public:
* Throws std::bad_alloc: Not enough memory.
* Throws std::runtime_error: Illegal port types.
*/
static type_set& make(std::vector<type*> types, struct index_map control_map)
throw(std::bad_alloc, std::runtime_error);
static type_set& make(std::vector<type*> types, struct index_map control_map);
/**
* Compare sets for equality.
*/
@ -413,7 +412,7 @@ public:
* Returns: The offset of port.
* Throws std::runtime_error: Bad port number.
*/
size_t port_offset(unsigned port) const throw(std::runtime_error)
size_t port_offset(unsigned port) const
{
if(port >= port_count)
throw std::runtime_error("Invalid port index");
@ -426,7 +425,7 @@ public:
* Returns: The port type.
* Throws std::runtime_error: Bad port number.
*/
const class type& port_type(unsigned port) const throw(std::runtime_error)
const class type& port_type(unsigned port) const
{
if(port >= port_count)
throw std::runtime_error("Invalid port index");
@ -464,7 +463,7 @@ public:
* Returns: The triplet (may not be valid).
* Throws std::runtime_error: Index out of range.
*/
index_triple index_to_triple(unsigned index) const throw(std::runtime_error)
index_triple index_to_triple(unsigned index) const
{
if(index >= _indices.size())
throw std::runtime_error("Invalid index");
@ -478,7 +477,7 @@ public:
* Parameter _index: The control index.
* Returns: The index, or 0xFFFFFFFFUL if specified triple is not valid.
*/
unsigned triple_to_index(unsigned port, unsigned controller, unsigned _index) const throw(std::runtime_error)
unsigned triple_to_index(unsigned port, unsigned controller, unsigned _index) const
{
size_t place = port * port_multiplier + controller * controller_multiplier + _index;
if(place >= indices_size)
@ -507,7 +506,7 @@ public:
* Returns: Physical controller index (port, controller).
* Throws std::runtime_error: No such controller.
*/
std::pair<unsigned, unsigned> lcid_to_pcid(unsigned lcid) const throw(std::runtime_error)
std::pair<unsigned, unsigned> lcid_to_pcid(unsigned lcid) const
{
if(lcid >= controllers.size())
throw std::runtime_error("Bad logical controller");
@ -527,7 +526,7 @@ public:
* Returns: The controller index.
* Throws std::runtime_error: No such controller.
*/
std::pair<unsigned, unsigned> legacy_pcid_to_pair(unsigned pcid) const throw(std::runtime_error)
std::pair<unsigned, unsigned> legacy_pcid_to_pair(unsigned pcid) const
{
if(pcid >= legacy_pcids.size())
throw std::runtime_error("Bad legacy PCID");
@ -560,14 +559,14 @@ public:
*
* Throws std::bad_alloc: Not enough memory.
*/
counters() throw(std::bad_alloc);
counters();
/**
* Create new pollcounter vector suitably sized for given type set.
*
* Parameter p: The port types.
* Throws std::bad_alloc: Not enough memory.
*/
counters(const type_set& p) throw(std::bad_alloc);
counters(const type_set& p);
/**
* Destructor.
*/
@ -575,11 +574,11 @@ public:
/**
* Copy the counters.
*/
counters(const counters& v) throw(std::bad_alloc);
counters(const counters& v);
/**
* Assign the counters.
*/
counters& operator=(const counters& v) throw(std::bad_alloc);
counters& operator=(const counters& v);
/**
* Zero all poll counters and clear all DRDY bits. System flag is cleared.
*/
@ -696,7 +695,7 @@ public:
* Parameter mem: The memory block to save to.
* Throws std::bad_alloc: Not enough memory.
*/
void save_state(std::vector<uint32_t>& mem) throw(std::bad_alloc);
void save_state(std::vector<uint32_t>& mem);
/**
* Load state from memory block.
*
@ -744,7 +743,7 @@ public:
*
* Parameter p: Types of ports.
*/
frame(const type_set& p) throw(std::runtime_error);
frame(const type_set& p);
/**
* Create subframe of controls with specified controller types and specified memory.
*
@ -754,8 +753,7 @@ public:
*
* Throws std::runtime_error: NULL memory.
*/
frame(unsigned char* memory, const type_set& p, frame_vector* host = NULL)
throw(std::runtime_error);
frame(unsigned char* memory, const type_set& p, frame_vector* host = NULL);
/**
* Copy construct a frame. The memory will be dedicated.
*
@ -769,7 +767,7 @@ public:
* Returns: Reference to this.
* Throws std::runtime_error: The types don't match and memory is not dedicated.
*/
frame& operator=(const frame& obj) throw(std::runtime_error);
frame& operator=(const frame& obj);
/**
* Get type of port.
*
@ -800,7 +798,7 @@ public:
* Parameter ptype: New port types.
* Throws std::runtime_error: Memory is mapped.
*/
void set_types(const type_set& ptype) throw(std::runtime_error)
void set_types(const type_set& ptype)
{
if(memory != backing)
throw std::runtime_error("Can't change type of mapped frame");
@ -832,7 +830,7 @@ public:
* Returns: The XOR result (dedicated memory).
* Throws std::runtime_error: Type mismatch.
*/
frame operator^(const frame& another) throw(std::runtime_error)
frame operator^(const frame& another)
{
frame x(*this);
if(types != another.types)
@ -959,7 +957,7 @@ public:
* Parameter buf: The buffer containing text representation. Terminated by NUL, CR or LF.
* Throws std::runtime_error: Bad serialized representation.
*/
inline void deserialize(const char* buf) throw(std::runtime_error);
inline void deserialize(const char* buf);
/**
* Serialize frame to text format.
*
@ -1063,7 +1061,7 @@ public:
* Parameter obj: The object to copy.
* Throws std::bad_alloc: Not enough memory.
*/
frame_vector(const frame_vector& vector) throw(std::bad_alloc);
frame_vector(const frame_vector& vector);
/**
* Assign controller frame vector.
*
@ -1071,13 +1069,13 @@ public:
* Returns: Reference to this.
* Throws std::bad_alloc: Not enough memory.
*/
frame_vector& operator=(const frame_vector& vector) throw(std::bad_alloc);
frame_vector& operator=(const frame_vector& vector);
/**
* Blank vector and change the type of ports.
*
* Parameter p: The port types.
*/
void clear(const type_set& p) throw(std::runtime_error);
void clear(const type_set& p);
/**
* Blank vector.
*/
@ -1125,7 +1123,7 @@ public:
* Throws std::bad_alloc: Not enough memory.
* Throws std::runtime_error: Port type mismatch.
*/
void append(frame frame) throw(std::bad_alloc, std::runtime_error);
void append(frame frame);
/**
* Change length of vector.
*
@ -1135,7 +1133,7 @@ public:
* Parameter newsize: New size of vector.
* Throws std::bad_alloc: Not enough memory.
*/
void resize(size_t newsize) throw(std::bad_alloc);
void resize(size_t newsize);
/**
* Walk the indexes of sync subframes.
*
@ -1221,7 +1219,7 @@ public:
* Parameter stream: The stream to save to.
* Throws std::runtime_error: Error saving.
*/
void save_binary(binarystream::output& stream) const throw(std::runtime_error);
void save_binary(binarystream::output& stream) const;
/**
* Load from binary form. May partially overwrite on failure.
*
@ -1229,7 +1227,7 @@ public:
* Throws std::bad_alloc: Not enough memory.
* Throws std::runtime_error: Error saving.
*/
void load_binary(binarystream::input& stream) throw(std::bad_alloc, std::runtime_error);
void load_binary(binarystream::input& stream);
/**
* Check that the movies are compatible up to a point.
*
@ -1365,7 +1363,7 @@ void frame::sync(bool x) throw()
if(host) host->notify_sync_change((backing[0] & 1) - old);
}
void frame::deserialize(const char* buf) throw(std::runtime_error)
void frame::deserialize(const char* buf)
{
short old = sync();
size_t offset = 0;

View file

@ -21,7 +21,7 @@ std::string pcs_write_classes(const std::vector<controller_set*>& p, unsigned& t
struct type_generic : public type
{
type_generic(const JSON::node& root, const std::string& ptr) throw(std::exception);
type_generic(const JSON::node& root, const std::string& ptr);
~type_generic() throw();
struct ser_instruction
{

View file

@ -127,7 +127,7 @@ public:
* parameter lazy: If true, just switch to project, don't read the IDs.
* throws std::bad_alloc: Not enough memory
*/
void read_base(const std::string& projectfile, bool lazy) throw(std::bad_alloc);
void read_base(const std::string& projectfile, bool lazy);
/**
* Is lazy?
*/
@ -143,7 +143,7 @@ public:
*
* parameter i: The load ID to add.
*/
void add(const struct instance& i) throw(std::bad_alloc);
void add(const struct instance& i);
/**
* Write compressed representation of current load ID set to stream.
*
@ -151,7 +151,7 @@ public:
* returns: Rerecord count.
* throws std::bad_alloc: Not enough memory.
*/
uint64_t write(std::vector<char>& strm) throw(std::bad_alloc);
uint64_t write(std::vector<char>& strm);
/**
* Get size for compressed representation.
*
@ -178,7 +178,7 @@ public:
* returns: Rerecord count.
* throws std::bad_alloc: Not enough memory.
*/
uint64_t read(std::vector<char>& strm) throw(std::bad_alloc);
uint64_t read(std::vector<char>& strm);
/**
* Load compressed representation of load ID set from stream, but don't do anything to it.
*
@ -186,7 +186,7 @@ public:
* returns: Rerecord count.
* throws std::bad_alloc: Not enough memory.
*/
static uint64_t count(std::vector<char>& strm) throw(std::bad_alloc);
static uint64_t count(std::vector<char>& strm);
/**
* Count number of rerecords.
*

View file

@ -81,7 +81,7 @@ public:
/**
* Add a callback on new supervariable.
*/
void add_callback(listener& listener) throw(std::bad_alloc);
void add_callback(listener& listener);
/**
* Drop a callback on new supervariable.
*/
@ -99,7 +99,7 @@ public:
/**
* Constructor.
*/
group() throw(std::bad_alloc);
group();
/**
* Destructor.
*/
@ -107,7 +107,7 @@ public:
/**
* Get all settings.
*/
std::set<std::string> get_settings_set() throw(std::bad_alloc);
std::set<std::string> get_settings_set();
/**
* Get setting.
*/
@ -115,19 +115,19 @@ public:
/**
* Add a listener.
*/
void add_listener(struct listener& _listener) throw(std::bad_alloc);
void add_listener(struct listener& _listener);
/**
* Remove a listener.
*/
void remove_listener(struct listener& _listener) throw(std::bad_alloc);
void remove_listener(struct listener& _listener);
/**
* Register a setting.
*/
void do_register(const std::string& name, base& _setting) throw(std::bad_alloc);
void do_register(const std::string& name, base& _setting);
/**
* Unregister a setting.
*/
void do_unregister(const std::string& name, base& _setting) throw(std::bad_alloc);
void do_unregister(const std::string& name, base& _setting);
/**
* Fire listener.
*/
@ -135,7 +135,7 @@ public:
/**
* Add a set of settings.
*/
void add_set(set& s) throw(std::bad_alloc);
void add_set(set& s);
/**
* Remove a set of settings.
*/
@ -189,8 +189,7 @@ public:
*
* Note: If setting has cached value and setting it succeeds, the cached value is cleared.
*/
void set(const std::string& name, const std::string& value, bool allow_invalid = false) throw(std::bad_alloc,
std::runtime_error);
void set(const std::string& name, const std::string& value, bool allow_invalid = false);
/**
* Get a value.
*
@ -198,12 +197,11 @@ public:
* Return: Actual value of the setting.
* Throws std::runtime_error: Setting doesn't exist.
*/
std::string get(const std::string& name) throw(std::bad_alloc, std::runtime_error);
std::string get(const std::string& name);
/**
* Get descriptor for.
*/
const description& get_description(const std::string& name) throw(std::bad_alloc,
std::runtime_error);
const description& get_description(const std::string& name);
/**
* Get human-readable name.
*
@ -211,7 +209,7 @@ public:
* Return: Human-readable name of the setting.
* Throws std::runtime_error: Setting doesn't exist.
*/
std::string get_hname(const std::string& name) throw(std::bad_alloc, std::runtime_error);
std::string get_hname(const std::string& name);
private:
group& grp;
std::map<std::string, std::string> badcache;
@ -269,7 +267,7 @@ public:
/**
* Constructor.
*/
void _superbase(set& _s, const std::string& iname) throw(std::bad_alloc);
void _superbase(set& _s, const std::string& iname);
/**
* Destructor.
*/
@ -296,7 +294,7 @@ public:
/**
* Constructor.
*/
base(group& _group, const std::string& iname, const std::string& hname, bool dynamic) throw(std::bad_alloc);
base(group& _group, const std::string& iname, const std::string& hname, bool dynamic);
/**
* Destructor.
*/
@ -304,11 +302,11 @@ public:
/**
* Set setting.
*/
virtual void str(const std::string& val) throw(std::runtime_error, std::bad_alloc) = 0;
virtual void str(const std::string& val) = 0;
/**
* Get setting.
*/
virtual std::string str() const throw(std::runtime_error, std::bad_alloc) = 0;
virtual std::string str() const = 0;
/**
* Get setting name.
*/
@ -358,7 +356,7 @@ public:
/**
* Set setting.
*/
void str(const std::string& val) throw(std::runtime_error, std::bad_alloc)
void str(const std::string& val)
{
{
threads::arlock h(get_setting_lock());
@ -369,7 +367,7 @@ public:
/**
* Get setting.
*/
std::string str() const throw(std::runtime_error, std::bad_alloc)
std::string str() const
{
threads::arlock h(get_setting_lock());
return model::write(value);
@ -377,7 +375,7 @@ public:
/**
* Set setting.
*/
void set(valtype_t _value) throw(std::runtime_error, std::bad_alloc)
void set(valtype_t _value)
{
{
threads::arlock h(get_setting_lock());
@ -390,7 +388,7 @@ public:
/**
* Get setting.
*/
valtype_t get() const throw(std::bad_alloc)
valtype_t get() const
{
threads::arlock h(get_setting_lock());
return model::transform(value);
@ -427,7 +425,6 @@ public:
* Constructor.
*/
supervariable(set& _s, const std::string& _iname, const std::string& _hname, valtype_t _defaultvalue)
throw(std::bad_alloc)
: s(_s)
{
iname = _iname;

View file

@ -16,7 +16,7 @@ public:
/**
* Creates new SHA-256 context, initially containing empty data.
*/
sha256() throw(std::bad_alloc)
sha256()
{
real_init();
finished = false;
@ -65,7 +65,7 @@ public:
* Returns: Hexadecimal hash
* Throws std::bad_alloc: Not enough memory.
*/
static std::string tostring(const uint8_t* hashout) throw(std::bad_alloc)
static std::string tostring(const uint8_t* hashout)
{
return hex::b_to(hashout, 32);
}
@ -87,7 +87,7 @@ public:
* Returns: The hash in hex form.
* Throws std::bad_alloc: Not enough memory.
*/
std::string read() throw(std::bad_alloc)
std::string read()
{
uint8_t x[32];
read(x);
@ -138,7 +138,7 @@ public:
* Returns: Hexadecimal hash of the data.
* Throws std::bad_alloc: Not enough memory.
*/
static std::string hash(const uint8_t* data, size_t datalen) throw(std::bad_alloc)
static std::string hash(const uint8_t* data, size_t datalen)
{
uint8_t hashout[32];
hash(hashout, data, datalen);
@ -152,7 +152,7 @@ public:
* Returns: Hexadecimal hash of the data.
* Throws std::bad_alloc: Not enough memory.
*/
static std::string hash(const std::vector<uint8_t>& data) throw(std::bad_alloc)
static std::string hash(const std::vector<uint8_t>& data)
{
uint8_t hashout[32];
hash(hashout, &data[0], data.size());
@ -166,7 +166,7 @@ public:
* Returns: Hexadecimal hash of the data.
* Throws std::bad_alloc: Not enough memory.
*/
static std::string hash(const std::vector<char>& data) throw(std::bad_alloc)
static std::string hash(const std::vector<char>& data)
{
uint8_t hashout[32];
hash(hashout, reinterpret_cast<const uint8_t*>(&data[0]), data.size());

View file

@ -35,7 +35,7 @@ struct hash
* Parameter outbits: Number of output bits.
* Throws std::runtime_error: Variant is invalid.
*/
hash(variant v, uint64_t outbits) throw(std::runtime_error);
hash(variant v, uint64_t outbits);
/**
* Dtor
*/
@ -50,7 +50,7 @@ struct hash
*
* Note: Data types 4 (CONFIG) and 63 (OUTPUT) are not allowed.
*/
void write(const uint8_t* data, size_t datalen, datatype type = T_MESSAGE) throw(std::runtime_error);
void write(const uint8_t* data, size_t datalen, datatype type = T_MESSAGE);
/**
* Read the output hash.
*
@ -106,7 +106,7 @@ public:
* Parameter size: Number of random bytes to write.
* Throws std::runtime_error: Generator is not seeded.
*/
void read(void* buffer, size_t size) throw(std::runtime_error);
void read(void* buffer, size_t size);
/**
* Is seeded?
*/

View file

@ -19,7 +19,7 @@ public:
* Parameter obj: The object to get the state for.
* Returns: The object state.
*/
static U& get(T* obj) throw(std::bad_alloc)
static U& get(T* obj)
{
return *reinterpret_cast<U*>(_get(obj, []() -> void* { return new U; }));
}

View file

@ -123,7 +123,7 @@ public:
* Parameter whole_sequence: If true, after seeing one separator, throw away separators until none more are found.
*/
token_iterator(const std::basic_string<T>& s, std::initializer_list<const T*> sep,
bool whole_sequence = false) throw(std::bad_alloc) : str(s) { ctor_itr(sep, whole_sequence); }
bool whole_sequence = false) : str(s) { ctor_itr(sep, whole_sequence); }
/**
* Compare.
*/
@ -139,11 +139,11 @@ public:
/**
* Increment.
*/
token_iterator<T>& operator++() throw(std::bad_alloc) { return preincrement(); }
token_iterator<T>& operator++() { return preincrement(); }
/**
* Increment.
*/
token_iterator<T> operator++(int) throw(std::bad_alloc) { return postincrement(); }
token_iterator<T> operator++(int) { return postincrement(); }
/**
* Do nothing, pull everything.
*/
@ -177,9 +177,9 @@ private:
};
void ctor_eos();
void ctor_itr(std::initializer_list<const T*> sep, bool whole_sequence = false) throw(std::bad_alloc);
token_iterator<T> postincrement() throw(std::bad_alloc);
token_iterator<T>& preincrement() throw(std::bad_alloc);
void ctor_itr(std::initializer_list<const T*> sep, bool whole_sequence = false);
token_iterator<T> postincrement();
token_iterator<T>& preincrement();
const std::basic_string<T>& dereference() const throw();
bool equals_op(const token_iterator<T>& itr) const throw();
size_t is_sep(size_t pos);
@ -228,8 +228,7 @@ private:
* Parameter ex: If non-null and string does not match, throw this as std::runtime_error.
* Returns: The captures.
*/
regex_results regex(const std::string& regex, const std::string& str, const char* ex = NULL)
throw(std::bad_alloc, std::runtime_error);
regex_results regex(const std::string& regex, const std::string& str, const char* ex = NULL);
enum regex_match_mode
{
@ -247,8 +246,7 @@ enum regex_match_mode
* Parameter mode: Match mode.
* Returns: True if matches, false if not.
*/
bool regex_match(const std::string& regex, const std::string& str, enum regex_match_mode mode = REGEX_MATCH_REGEX)
throw(std::bad_alloc, std::runtime_error);
bool regex_match(const std::string& regex, const std::string& str, enum regex_match_mode mode = REGEX_MATCH_REGEX);
/**
* Try match a case-insensitive string fragment and return the result.
@ -274,7 +272,7 @@ template<typename T> T raw_lexical_cast(const std::string& value)
/**
* \brief Typeconvert string.
*/
template<typename T> inline T parse_value(const std::string& value) throw(std::bad_alloc, std::runtime_error)
template<typename T> inline T parse_value(const std::string& value)
{
//Floating-point case.
try {
@ -327,7 +325,7 @@ template<typename T> inline T parse_value(const std::string& value) throw(std::b
}
}
template<> inline ss_int24_t parse_value(const std::string& value) throw(std::bad_alloc, std::runtime_error)
template<> inline ss_int24_t parse_value(const std::string& value)
{
int32_t v = parse_value<int32_t>(value);
if(v < -8388608 || v > 8388607)
@ -335,7 +333,7 @@ template<> inline ss_int24_t parse_value(const std::string& value) throw(std::ba
return v;
}
template<> inline ss_uint24_t parse_value(const std::string& value) throw(std::bad_alloc, std::runtime_error)
template<> inline ss_uint24_t parse_value(const std::string& value)
{
uint32_t v = parse_value<uint32_t>(value);
if(v > 0xFFFFFF)
@ -343,7 +341,7 @@ template<> inline ss_uint24_t parse_value(const std::string& value) throw(std::b
return v;
}
template<> inline std::string parse_value(const std::string& value) throw(std::bad_alloc, std::runtime_error)
template<> inline std::string parse_value(const std::string& value)
{
return value;
}

View file

@ -30,7 +30,7 @@ public:
*
* Throws std::logic_error: If read count is 0.
*/
void put_read() throw(std::logic_error);
void put_read();
/**
* Get write pointer and increment write count by 1.
*
@ -45,7 +45,7 @@ public:
*
* Throws std::logic_error: If write count is 0.
*/
void put_write() throw(std::logic_error);
void put_write();
/**
* Call specified function synchronously for last written buffer.
*
@ -94,7 +94,7 @@ public:
*
* Throws std::logic_error: If read count is 0.
*/
void put_read() throw(std::logic_error) { l.put_read(); }
void put_read() { l.put_read(); }
/**
* Get write pointer and increment write count by 1.
*
@ -109,7 +109,7 @@ public:
*
* Throws std::logic_error: If write count is 0.
*/
void put_write() throw(std::logic_error) { l.put_write(); }
void put_write() { l.put_write(); }
/**
* Call specified function synchronously for last written buffer.
*

View file

@ -42,7 +42,7 @@ public:
* parameter _itr: The underlying map iterator.
* throws std::bad_alloc: Not enough memory.
*/
iterator_class(T _itr) throw(std::bad_alloc)
iterator_class(T _itr)
: itr(_itr)
{
}
@ -53,7 +53,7 @@ public:
* returns: Name of member.
* throws std::bad_alloc: Not enough memory.
*/
reference operator*() throw(std::bad_alloc)
reference operator*()
{
return itr->first;
}
@ -64,7 +64,7 @@ public:
* returns: Name of member.
* throws std::bad_alloc: Not enough memory.
*/
pointer operator->() throw(std::bad_alloc)
pointer operator->()
{
return &(itr->first);
}
@ -97,7 +97,7 @@ public:
* returns: The old value of iterator.
* throws std::bad_alloc: Not enough memory.
*/
const iterator_class<T, V> operator++(int) throw(std::bad_alloc)
const iterator_class<T, V> operator++(int)
{
iterator_class<T, V> c(*this);
++itr;
@ -110,7 +110,7 @@ public:
* returns: The old value of iterator.
* throws std::bad_alloc: Not enough memory.
*/
const iterator_class<T, V> operator--(int) throw(std::bad_alloc)
const iterator_class<T, V> operator--(int)
{
iterator_class<T, V> c(*this);
--itr;
@ -160,7 +160,7 @@ public:
* throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Can't open the ZIP file.
*/
reader(const std::string& zipfile) throw(std::bad_alloc, std::runtime_error);
reader(const std::string& zipfile);
/**
* Destroy the ZIP reader. Opened input streams continue to be valid.
@ -173,7 +173,7 @@ public:
* returns: The member name
* throws std::bad_alloc: Not enough memory.
*/
std::string find_first() throw(std::bad_alloc);
std::string find_first();
/**
* Gives the name of the next member after specified, or "" if that member is the last.
@ -182,7 +182,7 @@ public:
* returns: The member name
* throws std::bad_alloc: Not enough memory.
*/
std::string find_next(const std::string& name) throw(std::bad_alloc);
std::string find_next(const std::string& name);
/**
* Starting iterator
@ -190,7 +190,7 @@ public:
* returns: The iterator pointing to first name.
* throws std::bad_alloc: Not enough memory.
*/
iterator begin() throw(std::bad_alloc);
iterator begin();
/**
* Ending iterator (one past the end).
@ -198,7 +198,7 @@ public:
* returns: The iterator pointing to one past the last name.
* throws std::bad_alloc: Not enough memory.
*/
iterator end() throw(std::bad_alloc);
iterator end();
/**
* Starting reverse iterator
@ -206,14 +206,14 @@ public:
* returns: The iterator pointing to last name and acting in reverse.
* throws std::bad_alloc: Not enough memory.
*/
riterator rbegin() throw(std::bad_alloc);
riterator rbegin();
/**
* Ending reverse iterator (one past the start).
* returrns: The iterator pointing to one before the first name and acting in reverse.
* throws std::bad_alloc: Not enough memory.
*/
riterator rend() throw(std::bad_alloc);
riterator rend();
/**
* Check if member with specified name exists.
@ -232,7 +232,7 @@ public:
* throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: The specified member does not exist
*/
std::istream& operator[](const std::string& name) throw(std::bad_alloc, std::runtime_error);
std::istream& operator[](const std::string& name);
/**
* Reads a file consisting of single line.
*
@ -243,8 +243,7 @@ public:
* Throws std::bad_alloc: Not enough memory.
* Throws std::runtime_error: Error reading file.
*/
bool read_linefile(const std::string& member, std::string& out, bool conditional = false)
throw(std::bad_alloc, std::runtime_error);
bool read_linefile(const std::string& member, std::string& out, bool conditional = false);
/**
* Read a raw file.
*
@ -253,8 +252,7 @@ public:
* Throws std::bad_alloc: Not enough memory.
* Throws std::runtime_error: Error reading file.
*/
void read_raw_file(const std::string& member, std::vector<char>& out) throw(std::bad_alloc,
std::runtime_error);
void read_raw_file(const std::string& member, std::vector<char>& out);
/**
* Reads a file consisting of single numeric constant.
*
@ -267,7 +265,6 @@ public:
*/
template<typename T>
bool read_numeric_file(const std::string& member, T& out, bool conditional = false)
throw(std::bad_alloc, std::runtime_error)
{
std::string _out;
if(!read_linefile(member, _out, conditional))
@ -296,8 +293,7 @@ private:
* throw std::bad_alloc: Not enough memory.
* throw std::runtime_error: The file does not exist or can't be opened.
*/
std::istream& openrel(const std::string& name, const std::string& referencing_path) throw(std::bad_alloc,
std::runtime_error);
std::istream& openrel(const std::string& name, const std::string& referencing_path);
/**
* As zip::openrel, but instead of returning handle to file, reads the entiere contents of the file and returns
@ -309,8 +305,7 @@ std::istream& openrel(const std::string& name, const std::string& referencing_pa
* throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: The file does not exist or can't be opened.
*/
std::vector<char> readrel(const std::string& name, const std::string& referencing_path)
throw(std::bad_alloc, std::runtime_error);
std::vector<char> readrel(const std::string& name, const std::string& referencing_path);
/**
* Resolves the final file path that zip::openrel/zip::readrel would open.
@ -321,8 +316,7 @@ std::vector<char> readrel(const std::string& name, const std::string& referencin
* throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Bad path.
*/
std::string resolverel(const std::string& name, const std::string& referencing_path) throw(std::bad_alloc,
std::runtime_error);
std::string resolverel(const std::string& name, const std::string& referencing_path);
/**
* Does the specified file (maybe inside .zip) exist?
@ -331,7 +325,7 @@ std::string resolverel(const std::string& name, const std::string& referencing_p
* returns: True if file exists, false if not.
* throws std::bad_alloc: Not enough memory.
*/
bool file_exists(const std::string& name) throw(std::bad_alloc);
bool file_exists(const std::string& name);
/**
* This class handles writing a ZIP archives.
@ -348,8 +342,8 @@ public:
* throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Can't open archive or invalid argument.
*/
writer(const std::string& zipfile, unsigned _compression) throw(std::bad_alloc, std::runtime_error);
writer(std::ostream& stream, unsigned _compression) throw(std::bad_alloc, std::runtime_error);
writer(const std::string& zipfile, unsigned _compression);
writer(std::ostream& stream, unsigned _compression);
/**
* Destroys ZIP writer, aborting the transaction (unless commit() has been called).
*/
@ -362,7 +356,7 @@ public:
* throws std::logic_error: Existing file open.
* throws std::runtime_error: Can't commit archive (OS error or member open).
*/
void commit() throw(std::bad_alloc, std::logic_error, std::runtime_error);
void commit();
/**
* Create a new member inside ZIP file. No existing member may be open.
@ -373,8 +367,7 @@ public:
* throws std::logic_error: Existing file open.
* throws std::runtime_error: Illegal name.
*/
std::ostream& create_file(const std::string& name) throw(std::bad_alloc, std::logic_error,
std::runtime_error);
std::ostream& create_file(const std::string& name);
/**
* Closes open member and destroys stream corresponding to it.
@ -383,7 +376,7 @@ public:
* throws std::logic_error: No file open.
* throws std::runtime_error: Error from operating system.
*/
void close_file() throw(std::bad_alloc, std::logic_error, std::runtime_error);
void close_file();
/**
* Write a file consisting of single line. No existing member may be open.
*
@ -393,8 +386,7 @@ public:
* throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Error from operating system.
*/
void write_linefile(const std::string& member, const std::string& value, bool conditional = false)
throw(std::bad_alloc, std::runtime_error);
void write_linefile(const std::string& member, const std::string& value, bool conditional = false);
/**
* Write a raw file. No existing member may be open.
*
@ -403,8 +395,7 @@ public:
* throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Error from operating system.
*/
void write_raw_file(const std::string& member, const std::vector<char>& content)
throw(std::bad_alloc, std::runtime_error);
void write_raw_file(const std::string& member, const std::vector<char>& content);
/**
* Write a file consisting of a single number. No existing member may be open.
*
@ -414,7 +405,7 @@ public:
* throws std::runtime_error: Error from operating system.
*/
template<typename T>
void write_numeric_file(const std::string& member, T value) throw(std::bad_alloc, std::runtime_error)
void write_numeric_file(const std::string& member, T value)
{
write_linefile(member, (stringfmt() << value).str());
}

View file

@ -87,8 +87,8 @@ struct lua_state
uint64_t timed_hook(int timer) throw();
const std::map<std::string, std::u32string>& get_watch_vars();
void do_eval_lua(const std::string& c) throw(std::bad_alloc);
void do_run_lua(const std::string& c) throw(std::bad_alloc);
void do_eval_lua(const std::string& c);
void do_run_lua(const std::string& c);
void run_sysrc_lua(bool rerun);
bool requests_repaint;
@ -113,7 +113,7 @@ struct lua_state
private:
void do_reset();
void do_evaluate(const std::string& a);
bool run_lua_fragment() throw(std::bad_alloc);
bool run_lua_fragment();
template<typename... T> bool run_callback(lua::state::callback_list& list, T... args);
void run_synchronous_paint(struct lua::render_context* ctx);
lua::state& L;

View file

@ -61,12 +61,12 @@ extern bool vflip_enabled;
extern bool rotate_enabled;
extern int wx_escape_count;
wxString towxstring(const std::string& str) throw(std::bad_alloc);
std::string tostdstring(const wxString& str) throw(std::bad_alloc);
wxString towxstring(const std::u32string& str) throw(std::bad_alloc);
std::u32string tou32string(const wxString& str) throw(std::bad_alloc);
wxString towxstring(const std::string& str);
std::string tostdstring(const wxString& str);
wxString towxstring(const std::u32string& str);
std::u32string tou32string(const wxString& str);
void bring_app_foreground();
std::string pick_archive_member(wxWindow* parent, const std::string& filename) throw(std::bad_alloc);
std::string pick_archive_member(wxWindow* parent, const std::string& filename);
void boot_emulator(emulator_instance& inst, loaded_rom& rom, moviefile& movie, bool fscreen);
void handle_wx_keyboard(emulator_instance& inst, wxKeyEvent& e, bool polarity);
void handle_wx_mouse(emulator_instance& inst, wxMouseEvent& e);

View file

@ -22,8 +22,7 @@ public:
* throws std::bad_alloc: Not enough memory
* throws std::runtime_error: Error opening .sox file
*/
sox_dumper(const std::string& filename, double samplerate, uint32_t channels) throw(std::bad_alloc,
std::runtime_error);
sox_dumper(const std::string& filename, double samplerate, uint32_t channels);
/**
* Destructor.
@ -36,7 +35,7 @@ public:
* throws std::bad_alloc: Not enough memory
* throws std::runtime_error: Error fixing and closing .sox file
*/
void close() throw(std::bad_alloc, std::runtime_error);
void close();
/**
* Dump a sample

View file

@ -8,7 +8,7 @@
namespace
{
command::fnptr<const std::string&> CMD_action(lsnes_cmds, CACTION::e,
[](const std::string& _args) throw(std::bad_alloc, std::runtime_error) {
[](const std::string& _args) {
auto& core = CORE();
if(_args == "") {
messages << "Action name required." << std::endl;

View file

@ -16,13 +16,13 @@ namespace
globalwrap<std::set<dumper_factory_base::notifier*>> S_notifiers;
}
master_dumper::gameinfo::gameinfo() throw(std::bad_alloc)
master_dumper::gameinfo::gameinfo()
{
length = 0;
rerecords = "0";
}
std::string master_dumper::gameinfo::get_readable_time(unsigned digits) const throw(std::bad_alloc)
std::string master_dumper::gameinfo::get_readable_time(unsigned digits) const
{
double bias = 0.5 * pow(10, -static_cast<int>(digits));
double len = length + bias;
@ -53,7 +53,7 @@ size_t master_dumper::gameinfo::get_author_count() const throw()
return authors.size();
}
std::string master_dumper::gameinfo::get_author_short(size_t idx) const throw(std::bad_alloc)
std::string master_dumper::gameinfo::get_author_short(size_t idx) const
{
if(idx >= authors.size())
return "";
@ -64,7 +64,7 @@ std::string master_dumper::gameinfo::get_author_short(size_t idx) const throw(st
return x.first;
}
std::string master_dumper::gameinfo::get_author_long(size_t idx) const throw(std::bad_alloc)
std::string master_dumper::gameinfo::get_author_long(size_t idx) const
{
if(idx >= authors.size())
return "";
@ -118,7 +118,7 @@ dumper_factory_base::~dumper_factory_base()
run_notify();
}
std::set<dumper_factory_base*> dumper_factory_base::get_dumper_set() throw(std::bad_alloc)
std::set<dumper_factory_base*> dumper_factory_base::get_dumper_set()
{
std::set<dumper_factory_base*> d;
for(auto i : S_dumpers())
@ -126,7 +126,7 @@ std::set<dumper_factory_base*> dumper_factory_base::get_dumper_set() throw(std::
return d;
}
dumper_factory_base::dumper_factory_base(const std::string& id) throw(std::bad_alloc)
dumper_factory_base::dumper_factory_base(const std::string& id)
{
d_id = id;
S_dumpers()[d_id] = this;
@ -200,7 +200,7 @@ dumper_base* master_dumper::get_instance(dumper_factory_base* f) throw()
}
dumper_base* master_dumper::start(dumper_factory_base& factory, const std::string& mode,
const std::string& targetname) throw(std::bad_alloc, std::runtime_error)
const std::string& targetname)
{
threads::arlock h(lock);
auto f = factory.start(*this, mode, targetname);

View file

@ -42,8 +42,7 @@ namespace
return true;
}
void dummy_set_device(const std::string& pdev, const std::string& rdev) throw(std::bad_alloc,
std::runtime_error)
void dummy_set_device(const std::string& pdev, const std::string& rdev)
{
if(pdev != "null")
throw std::runtime_error("Bad sound device '" + pdev + "'");
@ -51,12 +50,12 @@ namespace
throw std::runtime_error("Bad sound device '" + rdev + "'");
}
std::string dummy_get_device(bool rec) throw(std::bad_alloc)
std::string dummy_get_device(bool rec)
{
return "null";
}
std::map<std::string, std::string> dummy_get_devices(bool rec) throw(std::bad_alloc)
std::map<std::string, std::string> dummy_get_devices(bool rec)
{
std::map<std::string, std::string> ret;
ret["null"] = "NULL sound output";
@ -102,18 +101,17 @@ bool audioapi_driver_initialized()
return driver.initialized();
}
void audioapi_driver_set_device(const std::string& pdev, const std::string& rdev) throw(std::bad_alloc,
std::runtime_error)
void audioapi_driver_set_device(const std::string& pdev, const std::string& rdev)
{
driver.set_device(pdev, rdev);
}
std::string audioapi_driver_get_device(bool rec) throw(std::bad_alloc)
std::string audioapi_driver_get_device(bool rec)
{
return driver.get_device(rec);
}
std::map<std::string, std::string> audioapi_driver_get_devices(bool rec) throw(std::bad_alloc)
std::map<std::string, std::string> audioapi_driver_get_devices(bool rec)
{
return driver.get_devices(rec);
}

View file

@ -17,7 +17,7 @@ namespace
portctrl::type_set dummytypes;
command::fnptr<const std::string&> macro_test(lsnes_cmds, CMACRO::test,
[](const std::string& args) throw(std::bad_alloc, std::runtime_error) {
[](const std::string& args) {
auto& core = CORE();
regex_results r = regex("([0-9]+)[ \t](.*)", args);
if(!r) {
@ -211,7 +211,7 @@ void controller_state::reread_tasinput_mode(const portctrl::type_set& ptype)
}
}
void controller_state::set_ports(const portctrl::type_set& ptype) throw(std::runtime_error)
void controller_state::set_ports(const portctrl::type_set& ptype)
{
const portctrl::type_set* oldtype = types;
types = &ptype;

View file

@ -23,7 +23,7 @@ namespace
};
command::fnptr<const std::string&> CMD_disassemble(lsnes_cmds, CDISASM::d,
[](const std::string& t) throw(std::bad_alloc, std::runtime_error) {
[](const std::string& t) {
auto& core = CORE();
regex_results r = regex("([^ \t]+)[ \t]+([0-9]+|0x[0-9A-Fa-f]+)([ \t]+([0-9]+))?"
"([ \t]+to[ \t]+(.+))?", t);

View file

@ -105,7 +105,7 @@ void emu_framebuffer::do_screenshot(command::arg_filename file)
messages << "Saved PNG screenshot to '" << fn << "'" << std::endl;
}
void emu_framebuffer::take_screenshot(const std::string& file) throw(std::bad_alloc, std::runtime_error)
void emu_framebuffer::take_screenshot(const std::string& file)
{
render_info& ri = buffering.get_read();
ri.fbuf.save_png(file);
@ -113,7 +113,7 @@ void emu_framebuffer::take_screenshot(const std::string& file) throw(std::bad_al
}
void emu_framebuffer::init_special_screens() throw(std::bad_alloc)
void emu_framebuffer::init_special_screens()
{
std::vector<uint32_t> buf;
buf.resize(512*448);
@ -211,7 +211,7 @@ std::pair<uint32_t, uint32_t> emu_framebuffer::get_framebuffer_size()
return std::make_pair(h, v);
}
framebuffer::raw emu_framebuffer::get_framebuffer() throw(std::bad_alloc)
framebuffer::raw emu_framebuffer::get_framebuffer()
{
render_info& ri = buffering.get_read();
framebuffer::raw copy = ri.fbuf;

View file

@ -157,7 +157,7 @@ namespace
command::fnptr<> CMD_memory_use(lsnes_cmds, "show-memory", "Show memory usage",
"show-memory\nShow memory usage",
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
auto report = memtracker::singleton().report();
uint32_t maxwidth_left = 0;
uint32_t maxwidth_right = 0;

View file

@ -108,14 +108,14 @@ void cleanup_keymapper()
namespace
{
command::fnptr<> CMD_show_joysticks(lsnes_cmds, CKEYMAPPER::show,
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
messages << "--------------------------------------------" << std::endl;
messages << lsnes_gamepads.get_summary() << std::endl;
messages << "--------------------------------------------" << std::endl;
});
command::fnptr<> reset_joysticks(lsnes_cmds, CKEYMAPPER::reset,
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
joystick_driver_quit(true);
lsnes_gamepads.offline_all(); //Not supposed to have online gamepads when entering reset.
joystick_driver_init(true);

View file

@ -171,13 +171,13 @@ namespace
}
command::fnptr<command::arg_filename> CMD_load_library(lsnes_cmds, CLOADLIB::load,
[](command::arg_filename args) throw(std::bad_alloc, std::runtime_error) {
[](command::arg_filename args) {
with_loaded_library(*new loadlib::module(loadlib::library(args)));
handle_post_loadlibrary();
});
command::fnptr<const std::string&> CMD_unload_library(lsnes_cmds, CLOADLIB::unload,
[](const std::string& args) throw(std::bad_alloc, std::runtime_error) {
[](const std::string& args) {
unsigned libid = parse_value<unsigned>(args);
if(!modules.count(libid))
throw std::runtime_error("No such library loaded");
@ -186,7 +186,7 @@ namespace
});
command::fnptr<> CMD_list_library(lsnes_cmds, CLOADLIB::list,
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
for(auto i : modules)
messages << "#" << i.first << " [" << i.second->get_libname() << "]" << std::endl;
});

View file

@ -86,12 +86,12 @@ void mainloop_signal_need_rewind(void* ptr)
unsafe_rewind_obj = ptr;
}
bool movie_logic::notify_user_poll() throw(std::bad_alloc, std::runtime_error)
bool movie_logic::notify_user_poll()
{
return CORE().runmode->is_skiplag();
}
portctrl::frame movie_logic::update_controls(bool subframe, bool forced) throw(std::bad_alloc, std::runtime_error)
portctrl::frame movie_logic::update_controls(bool subframe, bool forced)
{
auto& core = CORE();
if(core.lua2->requests_subframe_paint)
@ -324,20 +324,20 @@ namespace
lsnes_callbacks lsnes_callbacks_obj;
command::fnptr<> CMD_segfault(lsnes_cmds, "segfault", "Trigger SIGSEGV",
"segfault\nTrigger segmentation fault",
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
char* ptr = (char*)0x1234;
*ptr = 0;
});
command::fnptr<> CMD_div0(lsnes_cmds, "divide-by-0", "Do div0", "divide-by-0\nDo divide by 0",
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
static int ptr = 1;
static int ptr2 = 0;
ptr = ptr / ptr2;
});
command::fnptr<const std::string&> CMD_test4(lsnes_cmds, "test4", "test", "test",
[](const std::string& args) throw(std::bad_alloc, std::runtime_error) {
[](const std::string& args) {
auto& core = CORE();
std::list<std::string> _args;
std::string args2 = args;
@ -347,7 +347,7 @@ namespace
});
command::fnptr<> CMD_count_rerecords(lsnes_cmds, "count-rerecords", "Count rerecords",
"Syntax: count-rerecords\nCounts rerecords.\n",
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
std::vector<char> tmp;
uint64_t x = CORE().mlogic->get_rrdata().write(tmp);
messages << x << " rerecord(s)" << std::endl;
@ -355,7 +355,7 @@ namespace
command::fnptr<const std::string&> CMD_quit_emulator(lsnes_cmds, "quit-emulator", "Quit the emulator",
"Syntax: quit-emulator [/y]\nQuits emulator (/y => don't ask for confirmation).\n",
[](const std::string& args) throw(std::bad_alloc, std::runtime_error) {
[](const std::string& args) {
CORE().runmode->set_quit();
platform::set_paused(false);
platform::cancel_wait();
@ -363,7 +363,7 @@ namespace
command::fnptr<> CMD_unpause_emulator(lsnes_cmds, "unpause-emulator", "Unpause the emulator",
"Syntax: unpause-emulator\nUnpauses the emulator.\n",
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
auto& core = CORE();
if(core.runmode->is_special())
return;
@ -374,7 +374,7 @@ namespace
command::fnptr<> CMD_pause_emulator(lsnes_cmds, "pause-emulator", "(Un)pause the emulator",
"Syntax: pause-emulator\n(Un)pauses the emulator.\n",
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
auto& core = CORE();
if(core.runmode->is_special())
;
@ -390,44 +390,44 @@ namespace
});
command::fnptr<> CMD_load_jukebox(lsnes_cmds, CLOADSAVE::ldj,
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
auto& core = CORE();
mark_pending_load(core.jukebox->get_slot_name(), LOAD_STATE_CURRENT);
});
command::fnptr<> CMD_load_jukebox_readwrite(lsnes_cmds, CLOADSAVE::ldjrw,
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
auto& core = CORE();
mark_pending_load(core.jukebox->get_slot_name(), LOAD_STATE_RW);
});
command::fnptr<> CMD_load_jukebox_readonly(lsnes_cmds, CLOADSAVE::ldjro,
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
auto& core = CORE();
mark_pending_load(core.jukebox->get_slot_name(), LOAD_STATE_RO);
});
command::fnptr<> CMD_load_jukebox_preserve(lsnes_cmds, CLOADSAVE::ldjp,
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
auto& core = CORE();
mark_pending_load(core.jukebox->get_slot_name(), LOAD_STATE_PRESERVE);
});
command::fnptr<> CMD_load_jukebox_movie(lsnes_cmds, CLOADSAVE::ldjm,
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
auto& core = CORE();
mark_pending_load(core.jukebox->get_slot_name(), LOAD_STATE_MOVIE);
});
command::fnptr<> CMD_save_jukebox_c(lsnes_cmds, CLOADSAVE::saj,
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
auto& core = CORE();
mark_pending_save(core.jukebox->get_slot_name(), SAVE_STATE, -1);
});
command::fnptr<> CMD_padvance_frame(lsnes_cmds, "+advance-frame", "Advance one frame",
"Syntax: +advance-frame\nAdvances the emulation by one frame.\n",
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
auto& core = CORE();
if(core.runmode->is_special())
return;
@ -438,7 +438,7 @@ namespace
command::fnptr<> CMD_nadvance_frame(lsnes_cmds, "-advance-frame", "Advance one frame",
"No help available\n",
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
CORE().runmode->set_cancel();
platform::cancel_wait();
platform::set_paused(false);
@ -446,7 +446,7 @@ namespace
command::fnptr<> CMD_padvance_poll(lsnes_cmds, "+advance-poll", "Advance one subframe",
"Syntax: +advance-poll\nAdvances the emulation by one subframe.\n",
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
auto& core = CORE();
if(core.runmode->is_special())
return;
@ -457,7 +457,7 @@ namespace
command::fnptr<> CMD_nadvance_poll(lsnes_cmds, "-advance-poll", "Advance one subframe",
"No help available\n",
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
auto& core = CORE();
core.runmode->decay_break();
core.runmode->set_cancel();
@ -467,7 +467,7 @@ namespace
command::fnptr<> CMD_advance_skiplag(lsnes_cmds, "advance-skiplag", "Skip to next poll",
"Syntax: advance-skiplag\nAdvances the emulation to the next poll.\n",
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
CORE().runmode->set_skiplag_pending();
platform::cancel_wait();
platform::set_paused(false);
@ -475,7 +475,7 @@ namespace
command::fnptr<> CMD_reset_c(lsnes_cmds, "reset", "Reset the system",
"Syntax: reset\nReset\nResets the system in beginning of the next frame.\n",
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
auto& core = CORE();
int sreset_action = core.rom->reset_action(false);
if(sreset_action < 0) {
@ -488,7 +488,7 @@ namespace
command::fnptr<> CMD_hreset_c(lsnes_cmds, "reset-hard", "Reset the system",
"Syntax: reset-hard\nReset-hard\nHard resets the system in beginning of the next frame.\n",
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
auto& core = CORE();
int hreset_action = core.rom->reset_action(true);
if(hreset_action < 0) {
@ -500,90 +500,90 @@ namespace
});
command::fnptr<command::arg_filename> CMD_load_c(lsnes_cmds, CLOADSAVE::ld,
[](command::arg_filename args) throw(std::bad_alloc, std::runtime_error) {
[](command::arg_filename args) {
mark_pending_load(args, LOAD_STATE_CURRENT);
});
command::fnptr<command::arg_filename> CMD_load_smart_c(lsnes_cmds, CLOADSAVE::ldsm,
[](command::arg_filename args) throw(std::bad_alloc, std::runtime_error) {
[](command::arg_filename args) {
mark_pending_load(args, LOAD_STATE_DEFAULT);
});
command::fnptr<command::arg_filename> CMD_load_state_c(lsnes_cmds, CLOADSAVE::ldrw,
[](command::arg_filename args) throw(std::bad_alloc, std::runtime_error) {
[](command::arg_filename args) {
mark_pending_load(args, LOAD_STATE_RW);
});
command::fnptr<command::arg_filename> CMD_load_readonly(lsnes_cmds, CLOADSAVE::ldro,
[](command::arg_filename args) throw(std::bad_alloc, std::runtime_error) {
[](command::arg_filename args) {
mark_pending_load(args, LOAD_STATE_RO);
});
command::fnptr<command::arg_filename> CMD_load_preserve(lsnes_cmds, CLOADSAVE::ldp,
[](command::arg_filename args) throw(std::bad_alloc, std::runtime_error) {
[](command::arg_filename args) {
mark_pending_load(args, LOAD_STATE_PRESERVE);
});
command::fnptr<command::arg_filename> CMD_load_movie_c(lsnes_cmds, CLOADSAVE::ldm,
[](command::arg_filename args) throw(std::bad_alloc, std::runtime_error) {
[](command::arg_filename args) {
mark_pending_load(args, LOAD_STATE_MOVIE);
});
command::fnptr<command::arg_filename> CMD_load_allbr_c(lsnes_cmds, CLOADSAVE::ldab,
[](command::arg_filename args) throw(std::bad_alloc, std::runtime_error) {
[](command::arg_filename args) {
mark_pending_load(args, LOAD_STATE_ALLBRANCH);
});
command::fnptr<command::arg_filename> CMD_save_state(lsnes_cmds, CLOADSAVE::sa,
[](command::arg_filename args) throw(std::bad_alloc, std::runtime_error) {
[](command::arg_filename args) {
mark_pending_save(args, SAVE_STATE, -1);
});
command::fnptr<command::arg_filename> CMD_save_state2(lsnes_cmds, CLOADSAVE::sasb,
[](command::arg_filename args) throw(std::bad_alloc, std::runtime_error) {
[](command::arg_filename args) {
mark_pending_save(args, SAVE_STATE, 1);
});
command::fnptr<command::arg_filename> CMD_save_state3(lsnes_cmds, CLOADSAVE::sasz,
[](command::arg_filename args) throw(std::bad_alloc, std::runtime_error) {
[](command::arg_filename args) {
mark_pending_save(args, SAVE_STATE, 0);
});
command::fnptr<command::arg_filename> CMD_save_movie(lsnes_cmds, CLOADSAVE::sam,
[](command::arg_filename args) throw(std::bad_alloc, std::runtime_error) {
[](command::arg_filename args) {
mark_pending_save(args, SAVE_MOVIE, -1);
});
command::fnptr<command::arg_filename> CMD_save_movie2(lsnes_cmds, CLOADSAVE::samb,
[](command::arg_filename args) throw(std::bad_alloc, std::runtime_error) {
[](command::arg_filename args) {
mark_pending_save(args, SAVE_MOVIE, 1);
});
command::fnptr<command::arg_filename> CMD_save_movie3(lsnes_cmds, CLOADSAVE::samz,
[](command::arg_filename args) throw(std::bad_alloc, std::runtime_error) {
[](command::arg_filename args) {
mark_pending_save(args, SAVE_MOVIE, 0);
});
command::fnptr<command::arg_filename> CMD_load_rom(lsnes_cmds, CLOADSAVE::lrom,
[](command::arg_filename args) throw(std::bad_alloc, std::runtime_error) {
[](command::arg_filename args) {
romload_request req;
req.packfile = args;
load_new_rom(req);
});
command::fnptr<> CMD_reload_rom(lsnes_cmds, CLOADSAVE::rlrom,
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
reload_current_rom();
});
command::fnptr<> CMD_close_rom(lsnes_cmds, CLOADSAVE::clrom,
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
close_rom();
});
command::fnptr<> CMD_set_rwmode(lsnes_cmds, "set-rwmode", "Switch to recording mode",
"Syntax: set-rwmode\nSwitches to recording mode\n",
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
auto& core = CORE();
core.lua2->callback_movie_lost("readwrite");
core.mlogic->get_movie().readonly_mode(false);
@ -594,7 +594,7 @@ namespace
command::fnptr<> CMD_set_romode(lsnes_cmds, "set-romode", "Switch to playback mode",
"Syntax: set-romode\nSwitches to playback mode\n",
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
auto& core = CORE();
core.mlogic->get_movie().readonly_mode(true);
core.dispatch->mode_change(true);
@ -603,7 +603,7 @@ namespace
command::fnptr<> CMD_toggle_rwmode(lsnes_cmds, "toggle-rwmode", "Toggle recording mode",
"Syntax: toggle-rwmode\nToggles recording mode\n",
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
auto& core = CORE();
bool c = core.mlogic->get_movie().readonly_mode();
if(c)
@ -617,12 +617,12 @@ namespace
command::fnptr<> CMD_repaint(lsnes_cmds, "repaint", "Redraw the screen",
"Syntax: repaint\nRedraws the screen\n",
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
CORE().fbuf->redraw_framebuffer();
});
command::fnptr<> CMD_tpon(lsnes_cmds, "toggle-pause-on-end", "Toggle pause on end", "Toggle pause on end\n",
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
auto& core = CORE();
bool tmp = SET_pause_on_end(*core.settings);
SET_pause_on_end(*core.settings, !tmp);
@ -630,37 +630,37 @@ namespace
});
command::fnptr<> CMD_spon(lsnes_cmds, "set-pause-on-end", "Set pause on end", "Set pause on end\n",
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
SET_pause_on_end(*CORE().settings, true);
messages << "Pause-on-end is now ON" << std::endl;
});
command::fnptr<> CMD_cpon(lsnes_cmds, "clear-pause-on-end", "Clear pause on end", "Clear pause on end\n",
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
SET_pause_on_end(*CORE().settings, false);
messages << "Pause-on-end is now OFF" << std::endl;
});
command::fnptr<> CMD_rewind_movie(lsnes_cmds, CLOADSAVE::rewind,
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
mark_pending_load("SOME NONBLANK NAME", LOAD_STATE_BEGINNING);
});
command::fnptr<> CMD_cancel_save(lsnes_cmds, CLOADSAVE::cancel,
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
queued_saves.clear();
messages << "Pending saves canceled." << std::endl;
});
command::fnptr<> CMD_mhold1(lsnes_cmds, CMHOLD::p, []() throw(std::bad_alloc, std::runtime_error) {
command::fnptr<> CMD_mhold1(lsnes_cmds, CMHOLD::p, []() {
macro_hold_1 = true;
});
command::fnptr<> CMD_mhold2(lsnes_cmds, CMHOLD::r, []() throw(std::bad_alloc, std::runtime_error) {
command::fnptr<> CMD_mhold2(lsnes_cmds, CMHOLD::r, []() {
macro_hold_1 = false;
});
command::fnptr<> CMD_mhold3(lsnes_cmds, CMHOLD::t, []() throw(std::bad_alloc, std::runtime_error) {
command::fnptr<> CMD_mhold3(lsnes_cmds, CMHOLD::t, []() {
macro_hold_2 = !macro_hold_2;
if(macro_hold_2)
messages << "Macros are held for next frame." << std::endl;
@ -837,8 +837,7 @@ void init_main_callbacks()
ecore_callbacks = &lsnes_callbacks_obj;
}
void main_loop(struct loaded_rom& rom, struct moviefile& initial, bool load_has_to_succeed) throw(std::bad_alloc,
std::runtime_error)
void main_loop(struct loaded_rom& rom, struct moviefile& initial, bool load_has_to_succeed)
{
lsnes_instance.emu_thread = threads::id();
auto& core = CORE();

View file

@ -93,7 +93,7 @@ cart_mappings_refresher::cart_mappings_refresher(memory_space& _mspace, movie_lo
{
}
void cart_mappings_refresher::operator()() throw(std::bad_alloc)
void cart_mappings_refresher::operator()()
{
std::list<memory_space::region*> cur_regions = mspace.get_regions();
std::list<memory_space::region*> regions;
@ -170,13 +170,13 @@ namespace
class memorymanip_command : public command::base
{
public:
memorymanip_command(command::group& grp, const std::string& cmd) throw(std::bad_alloc)
memorymanip_command(command::group& grp, const std::string& cmd)
: command::base(grp, cmd, true)
{
_command = cmd;
}
~memorymanip_command() throw() {}
void invoke(const std::string& args) throw(std::bad_alloc, std::runtime_error)
void invoke(const std::string& args)
{
regex_results t = regex("(([^ \t]+)([ \t]+([^ \t]+)([ \t]+([^ \t].*)?)?)?)?", args);
if(!t) {
@ -208,7 +208,7 @@ namespace
}
invoke2();
}
virtual void invoke2() throw(std::bad_alloc, std::runtime_error) = 0;
virtual void invoke2() = 0;
std::string firstword;
std::string secondword;
uint64_t address;
@ -226,12 +226,12 @@ namespace
class read_command : public memorymanip_command
{
public:
read_command(command::group& grp, const std::string& cmd) throw(std::bad_alloc)
read_command(command::group& grp, const std::string& cmd)
: memorymanip_command(grp, cmd)
{
}
~read_command() throw() {}
void invoke2() throw(std::bad_alloc, std::runtime_error)
void invoke2()
{
if(address_bad || has_value || has_tail)
throw std::runtime_error("Syntax: " + _command + " <address>");
@ -249,8 +249,8 @@ namespace
messages << x.str() << std::endl;
}
}
std::string get_short_help() throw(std::bad_alloc) { return "Read memory"; }
std::string get_long_help() throw(std::bad_alloc)
std::string get_short_help() { return "Read memory"; }
std::string get_long_help()
{
return "Syntax: " + _command + " <address>\n"
"Reads data from memory.\n";
@ -262,12 +262,11 @@ namespace
{
public:
write_command(command::group& grp, const std::string& cmd)
throw(std::bad_alloc)
: memorymanip_command(grp, cmd)
{
}
~write_command() throw() {}
void invoke2() throw(std::bad_alloc, std::runtime_error)
void invoke2()
{
if(address_bad || value_bad || has_tail)
throw std::runtime_error("Syntax: " + _command + " <address> <value>");
@ -276,8 +275,8 @@ namespace
throw std::runtime_error("Value to write out of range");
(CORE().memory->*_wfn)(address, value & high);
}
std::string get_short_help() throw(std::bad_alloc) { return "Write memory"; }
std::string get_long_help() throw(std::bad_alloc)
std::string get_short_help() { return "Write memory"; }
std::string get_long_help()
{
return "Syntax: " + _command + " <address> <value>\n"
"Writes data to memory.\n";
@ -289,19 +288,18 @@ namespace
{
public:
writef_command(command::group& grp, const std::string& cmd)
throw(std::bad_alloc)
: memorymanip_command(grp, cmd)
{
}
~writef_command() throw() {}
void invoke2() throw(std::bad_alloc, std::runtime_error)
void invoke2()
{
if(address_bad || !has_valuef || has_tail)
throw std::runtime_error("Syntax: " + _command + " <address> <value>");
(CORE().memory->*_wfn)(address, valuef);
}
std::string get_short_help() throw(std::bad_alloc) { return "Write memory"; }
std::string get_long_help() throw(std::bad_alloc)
std::string get_short_help() { return "Write memory"; }
std::string get_long_help()
{
return "Syntax: " + _command + " <address> <value>\n"
"Writes data to memory.\n";

View file

@ -96,7 +96,7 @@ void fatal_error() throw()
exit(1);
}
std::string get_config_path() throw(std::bad_alloc)
std::string get_config_path()
{
const char* tmp;
std::string basedir;

View file

@ -21,7 +21,7 @@ void movie_logic::set_movie(movie& _mov, bool free_old) throw()
if(free_old) delete tmp;
}
movie& movie_logic::get_movie() throw(std::runtime_error)
movie& movie_logic::get_movie()
{
if(!mov)
throw std::runtime_error("No movie");
@ -35,7 +35,7 @@ void movie_logic::set_mfile(moviefile& _mf, bool free_old) throw()
if(free_old) delete tmp;
}
moviefile& movie_logic::get_mfile() throw(std::runtime_error)
moviefile& movie_logic::get_mfile()
{
if(!mf)
throw std::runtime_error("No movie");
@ -49,14 +49,14 @@ void movie_logic::set_rrdata(rrdata_set& _rrd, bool free_old) throw()
if(free_old) delete tmp;
}
rrdata_set& movie_logic::get_rrdata() throw(std::runtime_error)
rrdata_set& movie_logic::get_rrdata()
{
if(!rrd)
throw std::runtime_error("No movie");
return *rrd;
}
void movie_logic::new_frame_starting(bool dont_poll) throw(std::bad_alloc, std::runtime_error)
void movie_logic::new_frame_starting(bool dont_poll)
{
mov->next_frame();
portctrl::frame c = update_controls(false);
@ -68,7 +68,7 @@ void movie_logic::new_frame_starting(bool dont_poll) throw(std::bad_alloc, std::
mov->set_all_DRDY();
}
short movie_logic::input_poll(unsigned port, unsigned dev, unsigned id) throw(std::bad_alloc, std::runtime_error)
short movie_logic::input_poll(unsigned port, unsigned dev, unsigned id)
{
if(!mov)
return 0;

View file

@ -48,13 +48,13 @@ namespace
}
command::fnptr<const std::string&> test4(lsnes_cmds, CMOVIEDATA::panic,
[](const std::string& args) throw(std::bad_alloc, std::runtime_error) {
[](const std::string& args) {
auto& core = CORE();
if(*core.mlogic) emerg_save_movie(core.mlogic->get_mfile(), core.mlogic->get_rrdata());
});
command::fnptr<const std::string&> CMD_dump_coresave(lsnes_cmds, CMOVIEDATA::dumpcore,
[](const std::string& name) throw(std::bad_alloc, std::runtime_error) {
[](const std::string& name) {
auto& core = CORE();
auto x = core.rom->save_core_state();
x.resize(x.size() - 32);
@ -186,8 +186,7 @@ std::string translate_name_mprefix(std::string original, int& binary, int save)
}
}
std::pair<std::string, std::string> split_author(const std::string& author) throw(std::bad_alloc,
std::runtime_error)
std::pair<std::string, std::string> split_author(const std::string& author)
{
std::string _author = author;
std::string fullname;
@ -215,8 +214,7 @@ std::string resolve_relative_path(const std::string& path)
}
//Save state.
void do_save_state(const std::string& filename, int binary) throw(std::bad_alloc,
std::runtime_error)
void do_save_state(const std::string& filename, int binary)
{
auto& core = CORE();
if(!*core.mlogic || !core.mlogic->get_mfile().gametype) {
@ -271,7 +269,7 @@ void do_save_state(const std::string& filename, int binary) throw(std::bad_alloc
}
//Save movie.
void do_save_movie(const std::string& filename, int binary) throw(std::bad_alloc, std::runtime_error)
void do_save_movie(const std::string& filename, int binary)
{
auto& core = CORE();
if(!*core.mlogic || !core.mlogic->get_mfile().gametype) {
@ -452,7 +450,7 @@ namespace
}
}
void do_load_rom() throw(std::bad_alloc, std::runtime_error)
void do_load_rom()
{
auto& core = CORE();
bool load_readwrite = !*core.mlogic || !core.mlogic->get_movie().readonly_mode();
@ -563,7 +561,7 @@ void do_load_rom() throw(std::bad_alloc, std::runtime_error)
messages << "ROM reloaded." << std::endl;
}
void do_load_rewind() throw(std::bad_alloc, std::runtime_error)
void do_load_rewind()
{
auto& core = CORE();
if(!*core.mlogic || !core.mlogic->get_mfile().gametype)

View file

@ -57,7 +57,7 @@ void moviefile::brief_info::binary_io(int _stream)
}, binarystream::null_default);
}
void moviefile::binary_io(int _stream, rrdata_set& rrd, bool as_state) throw(std::bad_alloc, std::runtime_error)
void moviefile::binary_io(int _stream, rrdata_set& rrd, bool as_state)
{
binarystream::output out(_stream);
out.string(gametype->get_name());
@ -192,7 +192,7 @@ void moviefile::binary_io(int _stream, rrdata_set& rrd, bool as_state) throw(std
}
}
void moviefile::binary_io(int _stream, core_type& romtype) throw(std::bad_alloc, std::runtime_error)
void moviefile::binary_io(int _stream, core_type& romtype)
{
binarystream::input in(_stream);
std::string tmp = in.string();

View file

@ -82,7 +82,6 @@ namespace
}
void read_authors_file(zip::reader& r, std::vector<std::pair<std::string, std::string>>& authors)
throw(std::bad_alloc, std::runtime_error)
{
std::istream& m = r["authors"];
try {
@ -99,7 +98,7 @@ namespace
}
}
std::string read_rrdata(zip::reader& r, std::vector<char>& out) throw(std::bad_alloc, std::runtime_error)
std::string read_rrdata(zip::reader& r, std::vector<char>& out)
{
r.read_raw_file("rrdata", out);
uint64_t count = rrdata_set::count(out);
@ -133,7 +132,6 @@ namespace
}
void read_input(zip::reader& r, const std::string& mname, portctrl::frame_vector& input)
throw(std::bad_alloc, std::runtime_error)
{
portctrl::frame tmp = input.blank_frame(false);
std::istream& m = r[mname];
@ -221,7 +219,7 @@ void moviefile::brief_info::load(zip::reader& r)
}
}
void moviefile::load(zip::reader& r, core_type& romtype) throw(std::bad_alloc, std::runtime_error)
void moviefile::load(zip::reader& r, core_type& romtype)
{
std::string tmp;
r.read_linefile("systemid", tmp);

View file

@ -47,7 +47,7 @@ namespace
}
}
void write_rrdata(zip::writer& w, rrdata_set& rrd) throw(std::bad_alloc, std::runtime_error)
void write_rrdata(zip::writer& w, rrdata_set& rrd)
{
uint64_t count;
std::vector<char> out;
@ -66,7 +66,6 @@ namespace
}
void write_authors_file(zip::writer& w, std::vector<std::pair<std::string, std::string>>& authors)
throw(std::bad_alloc, std::runtime_error)
{
std::ostream& m = w.create_file("authors");
try {
@ -85,7 +84,6 @@ namespace
}
void write_input(zip::writer& w, const std::string& mname, portctrl::frame_vector& input)
throw(std::bad_alloc, std::runtime_error)
{
std::ostream& m = w.create_file(mname);
try {
@ -139,7 +137,7 @@ namespace
}
}
void moviefile::save(zip::writer& w, rrdata_set& rrd, bool as_state) throw(std::bad_alloc, std::runtime_error)
void moviefile::save(zip::writer& w, rrdata_set& rrd, bool as_state)
{
w.write_linefile("gametype", gametype->get_name());
moviefile_write_settings<zip::writer>(w, settings, gametype->get_type().get_settings(), [](zip::writer& w,

View file

@ -102,7 +102,7 @@ moviefile::brief_info::brief_info(const std::string& filename)
load(r);
}
moviefile::moviefile() throw(std::bad_alloc)
moviefile::moviefile()
: tracker(memtracker::singleton(), movie_file_id, sizeof(*this))
{
force_corrupt = false;
@ -150,7 +150,7 @@ moviefile::moviefile(loaded_rom& rom, std::map<std::string, std::string>& c_sett
}
}
moviefile::moviefile(const std::string& movie, core_type& romtype) throw(std::bad_alloc, std::runtime_error)
moviefile::moviefile(const std::string& movie, core_type& romtype)
: tracker(memtracker::singleton(), movie_file_id, sizeof(*this))
{
regex_results rr;
@ -192,7 +192,6 @@ void moviefile::fixup_current_branch(const moviefile& mv)
}
void moviefile::save(const std::string& movie, unsigned compression, bool binary, rrdata_set& rrd, bool as_state)
throw(std::bad_alloc, std::runtime_error)
{
regex_results rr;
if(rr = regex("\\$MEMORY:(.*)", movie)) {
@ -235,7 +234,7 @@ void moviefile::save(const std::string& movie, unsigned compression, bool binary
save(w, rrd, as_state);
}
void moviefile::save(std::ostream& stream, rrdata_set& rrd, bool as_state) throw(std::bad_alloc, std::runtime_error)
void moviefile::save(std::ostream& stream, rrdata_set& rrd, bool as_state)
{
zip::writer w(stream, 0);
save(w, rrd, as_state);

View file

@ -39,21 +39,21 @@ keypress_info::keypress_info(keyboard::modifier_set mod, keyboard::key& _key, ke
}
void input_queue::queue(const keypress_info& k) throw(std::bad_alloc)
void input_queue::queue(const keypress_info& k)
{
threads::alock h(queue_lock);
keypresses.push_back(k);
queue_condition.notify_all();
}
void input_queue::queue(const std::string& c) throw(std::bad_alloc)
void input_queue::queue(const std::string& c)
{
threads::alock h(queue_lock);
commands.push_back(std::make_pair(nullptr, c));
queue_condition.notify_all();
}
void input_queue::queue(const char* c, const std::string& a) throw(std::bad_alloc)
void input_queue::queue(const char* c, const std::string& a)
{
threads::alock h(queue_lock);
commands.push_back(std::make_pair(c, a));
@ -61,7 +61,6 @@ void input_queue::queue(const char* c, const std::string& a) throw(std::bad_allo
}
void input_queue::queue(std::function<void()> f, std::function<void(std::exception& e)> onerror, bool sync)
throw(std::bad_alloc)
{
if(!system_thread_available) {
try {

View file

@ -80,7 +80,7 @@ void contribute_random_entropy(void* buf, size_t bytes)
prng.write(buf, sizeof(buf));
}
std::string get_random_hexstring(size_t length) throw(std::bad_alloc)
std::string get_random_hexstring(size_t length)
{
std::string out;
for(size_t i = 0; i < length; i += 64)
@ -88,7 +88,7 @@ std::string get_random_hexstring(size_t length) throw(std::bad_alloc)
return out.substr(0, length);
}
void set_random_seed(const std::string& seed) throw(std::bad_alloc)
void set_random_seed(const std::string& seed)
{
std::vector<char> x(seed.begin(), seed.end());
{
@ -97,7 +97,7 @@ void set_random_seed(const std::string& seed) throw(std::bad_alloc)
}
}
void set_random_seed() throw(std::bad_alloc)
void set_random_seed()
{
char buf[128];
crandom::generate(buf, 128);

View file

@ -56,14 +56,13 @@ loaded_rom::loaded_rom() throw()
region = &image->get_region();
}
loaded_rom::loaded_rom(rom_image_handle _image) throw(std::bad_alloc, std::runtime_error)
loaded_rom::loaded_rom(rom_image_handle _image)
{
image = _image;
region = &image->get_region();
}
void loaded_rom::load(std::map<std::string, std::string>& settings, uint64_t rtc_sec, uint64_t rtc_subsec)
throw(std::bad_alloc, std::runtime_error)
{
auto& core = CORE();
core_type* old_type = current_rom_type;
@ -109,7 +108,6 @@ void loaded_rom::load(std::map<std::string, std::string>& settings, uint64_t rtc
}
std::map<std::string, std::vector<char>> load_sram_commandline(const std::vector<std::string>& cmdline)
throw(std::bad_alloc, std::runtime_error)
{
std::map<std::string, std::vector<char>> ret;
regex_results opt;
@ -146,7 +144,7 @@ std::map<std::string, std::vector<char>> load_sram_commandline(const std::vector
return ret;
}
std::vector<char> loaded_rom::save_core_state(bool nochecksum) throw(std::bad_alloc, std::runtime_error)
std::vector<char> loaded_rom::save_core_state(bool nochecksum)
{
std::vector<char> ret;
rtype().serialize(ret);
@ -164,7 +162,7 @@ std::vector<char> loaded_rom::save_core_state(bool nochecksum) throw(std::bad_al
return ret;
}
void loaded_rom::load_core_state(const std::vector<char>& buf, bool nochecksum) throw(std::runtime_error)
void loaded_rom::load_core_state(const std::vector<char>& buf, bool nochecksum)
{
if(nochecksum) {
rtype().unserialize(&buf[0], buf.size());

View file

@ -185,7 +185,7 @@ rom_image::rom_image() throw()
account_images();
}
rom_image::rom_image(const std::string& file, core_type& ctype) throw(std::bad_alloc, std::runtime_error)
rom_image::rom_image(const std::string& file, core_type& ctype)
: tracker(memtracker::singleton(), romimage_id, sizeof(*this))
{
rtype = &ctype;
@ -216,8 +216,7 @@ rom_image::rom_image(const std::string& file, core_type& ctype) throw(std::bad_a
return;
}
rom_image::rom_image(const std::string& file, const std::string& tmpprefer) throw(std::bad_alloc,
std::runtime_error)
rom_image::rom_image(const std::string& file, const std::string& tmpprefer)
: tracker(memtracker::singleton(), romimage_id, sizeof(*this))
{
std::istream& spec = zip::openrel(file, "");
@ -267,7 +266,6 @@ rom_image::rom_image(const std::string& file, const std::string& tmpprefer) thro
}
void rom_image::load_bundle(const std::string& file, std::istream& spec, const std::string& tmpprefer)
throw(std::bad_alloc, std::runtime_error)
{
std::string s;
load_filename = file;
@ -461,7 +459,7 @@ rom_image::rom_image(const std::string file[ROM_SLOT_COUNT], const std::string&
account_images();
}
bool rom_image::is_gamepak(const std::string& filename) throw(std::bad_alloc, std::runtime_error)
bool rom_image::is_gamepak(const std::string& filename)
{
std::istream* spec = NULL;
try {

View file

@ -92,7 +92,7 @@ namespace
}
void operator()(struct framebuffer::fb<true>& scr) throw() { op(scr); }
void operator()(struct framebuffer::fb<false>& scr) throw() { op(scr); }
void clone(framebuffer::queue& q) const throw(std::bad_alloc) { q.clone_helper(this); }
void clone(framebuffer::queue& q) const { q.clone_helper(this); }
private:
int32_t x;
int32_t y;

View file

@ -41,14 +41,14 @@ volatile bool platform::do_exit_dummy_event_loop = false;
namespace
{
command::fnptr<> identify_key(lsnes_cmds, CSOUND::showdrv,
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
messages << "Graphics:\t" << graphics_driver_name() << std::endl;
messages << "Sound:\t" << audioapi_driver_name() << std::endl;
messages << "Joystick:\t" << joystick_driver_name() << std::endl;
});
command::fnptr<const std::string&> enable_sound(lsnes_cmds, CSOUND::enable,
[](const std::string& args) throw(std::bad_alloc, std::runtime_error) {
[](const std::string& args) {
if(args == "toggle") {
if(!audioapi_driver_initialized())
throw std::runtime_error("Sound failed to initialize and is disabled");
@ -90,7 +90,7 @@ namespace
}
command::fnptr<const std::string&> change_playback_dev(lsnes_cmds, CSOUND::chpdev,
[](const std::string& args) throw(std::bad_alloc, std::runtime_error) {
[](const std::string& args) {
auto old_rec = audioapi_driver_get_device(true);
auto args2 = args;
if(!fuzzy_search_list(audioapi_driver_get_devices(false), args2)) {
@ -101,7 +101,7 @@ namespace
});
command::fnptr<const std::string&> change_record_dev(lsnes_cmds, CSOUND::chrdev,
[](const std::string& args) throw(std::bad_alloc, std::runtime_error) {
[](const std::string& args) {
auto old_play = audioapi_driver_get_device(false);
auto args2 = args;
if(!fuzzy_search_list(audioapi_driver_get_devices(true), args2)) {
@ -112,7 +112,7 @@ namespace
});
command::fnptr<> show_devices(lsnes_cmds, CSOUND::showdev,
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
messages << "Known playback devices:" << std::endl;
auto pdevs = audioapi_driver_get_devices(false);
auto cpdev = audioapi_driver_get_device(false);
@ -130,7 +130,7 @@ namespace
});
command::fnptr<> reset_audio(lsnes_cmds, CSOUND::reset,
[]() throw(std::bad_alloc, std::runtime_error) {
[]() {
//Save the old devices. We save descriptions if possible, since handles change.
auto cpdev = platform::get_sound_device_description(false);
auto crdev = platform::get_sound_device_description(true);
@ -187,7 +187,7 @@ namespace
{
public:
~msgcallback() throw() {};
void messagebuffer_update() throw(std::bad_alloc, std::runtime_error)
void messagebuffer_update()
{
platform::notify_message();
}
@ -242,7 +242,7 @@ void platform::set_sound_device_by_description(const std::string& pdev, const st
set_sound_device(old_play, old_rec);
}
std::string platform::get_sound_device_description(bool rec) throw(std::bad_alloc)
std::string platform::get_sound_device_description(bool rec)
{
auto dev = audioapi_driver_get_device(rec);
auto devs = audioapi_driver_get_devices(rec);
@ -297,7 +297,7 @@ void platform::quit()
system_log.close();
}
std::ostream& platform::out() throw(std::bad_alloc)
std::ostream& platform::out()
{
static std::ostream* cached = NULL;
int dummy;
@ -309,7 +309,7 @@ std::ostream& platform::out() throw(std::bad_alloc)
messagebuffer platform::msgbuf(MAXMESSAGES, INIT_WIN_SIZE);
void platform::message(const std::string& msg) throw(std::bad_alloc)
void platform::message(const std::string& msg)
{
threads::alock h(msgbuf_lock());
for(auto& forlog : token_iterator<char>::foreach(msg, {"\n"})) {

View file

@ -954,7 +954,6 @@ namespace
void create_region(std::list<core_vma_info>& inf, const std::string& name, uint64_t base, uint64_t size,
uint8_t (*readfn)(uint64_t offset), void (*writefn)(uint64_t offset, uint8_t data))
throw(std::bad_alloc)
{
if(size == 0)
return;
@ -971,7 +970,7 @@ namespace
}
void create_region(std::list<core_vma_info>& inf, const std::string& name, uint64_t base, uint8_t* memory,
uint64_t size, bool readonly, bool native_endian = false) throw(std::bad_alloc)
uint64_t size, bool readonly, bool native_endian = false)
{
if(size == 0)
return;
@ -993,7 +992,7 @@ namespace
}
void create_region(std::list<core_vma_info>& inf, const std::string& name, uint64_t base,
SNES::MappedRAM& memory, bool readonly, bool native_endian = false) throw(std::bad_alloc)
SNES::MappedRAM& memory, bool readonly, bool native_endian = false)
{
create_region(inf, name, base, memory.data(), memory.size(), readonly, native_endian);
}
@ -1177,7 +1176,7 @@ namespace
return std::make_pair(64081, 2);
return std::make_pair(SNES::system.apu_frequency(), static_cast<uint32_t>(768));
}
std::map<std::string, std::vector<char>> c_save_sram() throw(std::bad_alloc) {
std::map<std::string, std::vector<char>> c_save_sram() {
std::map<std::string, std::vector<char>> out;
if(!internal_rom)
return out;
@ -1191,7 +1190,7 @@ namespace
}
return out;
}
void c_load_sram(std::map<std::string, std::vector<char>>& sram) throw(std::bad_alloc) {
void c_load_sram(std::map<std::string, std::vector<char>>& sram) {
std::set<std::string> used;
if(!internal_rom) {
for(auto i : sram)
@ -1902,7 +1901,7 @@ again2:
command::fnptr<command::arg_filename> dump_core(lsnes_cmds, "dump-core", "No description available",
"No description available\n",
[](command::arg_filename args) throw(std::bad_alloc, std::runtime_error) {
[](command::arg_filename args) {
std::vector<char> out;
bsnes_core.serialize(out);
std::ofstream x(args, std::ios_base::out | std::ios_base::binary);
@ -2087,7 +2086,7 @@ again2:
command::fnptr<const std::string&> start_trace(lsnes_cmds, "set-trace", "No description available",
"No description available\n",
[](const std::string& r) throw(std::bad_alloc, std::runtime_error) {
[](const std::string& r) {
CORE().command->invoke("tracelog cpu " + r);
});

View file

@ -569,7 +569,7 @@ namespace
else
return std::make_pair(32768, 1);
}
std::map<std::string, std::vector<char>> c_save_sram() throw(std::bad_alloc) {
std::map<std::string, std::vector<char>> c_save_sram() {
std::map<std::string, std::vector<char>> s;
if(!internal_rom)
return s;
@ -582,7 +582,7 @@ namespace
s["rtc"][i] = ((unsigned long long)timebase >> (8 * i));
return s;
}
void c_load_sram(std::map<std::string, std::vector<char>>& sram) throw(std::bad_alloc) {
void c_load_sram(std::map<std::string, std::vector<char>>& sram) {
if(!internal_rom)
return;
std::vector<char> x = sram.count("main") ? sram["main"] : std::vector<char>();
@ -967,15 +967,13 @@ namespace
std::vector<char> cmp_save;
command::fnptr<> cmp_save1(lsnes_cmds, "set-cmp-save", "", "\n", []() throw(std::bad_alloc,
std::runtime_error) {
command::fnptr<> cmp_save1(lsnes_cmds, "set-cmp-save", "", "\n", []() {
if(!internal_rom)
return;
instance->saveState(cmp_save);
});
command::fnptr<> cmp_save2(lsnes_cmds, "do-cmp-save", "", "\n", []() throw(std::bad_alloc,
std::runtime_error) {
command::fnptr<> cmp_save2(lsnes_cmds, "do-cmp-save", "", "\n", []() {
std::vector<char> x;
if(!internal_rom)
return;

View file

@ -266,7 +266,7 @@ namespace sky
std::pair<uint32_t, uint32_t> c_video_rate() { return std::make_pair(656250, 18227); }
double c_get_PAR() { return 5.0/6; }
std::pair<uint32_t, uint32_t> c_audio_rate() { return std::make_pair(48000, 1); }
std::map<std::string, std::vector<char>> c_save_sram() throw(std::bad_alloc) {
std::map<std::string, std::vector<char>> c_save_sram() {
std::map<std::string, std::vector<char>> r;
std::vector<char> sram;
sram.resize(32);
@ -274,7 +274,7 @@ namespace sky
r["sram"] = sram;
return r;
}
void c_load_sram(std::map<std::string, std::vector<char>>& sram) throw(std::bad_alloc) {
void c_load_sram(std::map<std::string, std::vector<char>>& sram) {
if(sram.count("sram") && sram["sram"].size() == 32)
memcpy(corei.state.sram, &sram["sram"][0], 32);
else

View file

@ -132,11 +132,11 @@ namespace
std::pair<uint32_t, uint32_t> c_video_rate() { return std::make_pair(60, 1); }
double c_get_PAR() { return 1.0; }
std::pair<uint32_t, uint32_t> c_audio_rate() { return std::make_pair(48000, 1); }
std::map<std::string, std::vector<char>> c_save_sram() throw(std::bad_alloc) {
std::map<std::string, std::vector<char>> c_save_sram() {
std::map<std::string, std::vector<char>> s;
return s;
}
void c_load_sram(std::map<std::string, std::vector<char>>& sram) throw(std::bad_alloc) {}
void c_load_sram(std::map<std::string, std::vector<char>>& sram) {}
void c_serialize(std::vector<char>& out) { out.clear(); }
void c_unserialize(const char* in, size_t insize) {}
core_region& c_get_region() { return *this; }

View file

@ -358,7 +358,7 @@ namespace
}
return ret;
}
void c_load_sram(std::map<std::string, std::vector<char>>& sram) throw(std::bad_alloc)
void c_load_sram(std::map<std::string, std::vector<char>>& sram)
{
lsnes_core_load_sram s;
if(caps1 & LSNES_CORE_CAP1_SRAM) {
@ -387,7 +387,7 @@ namespace
entrypoint(id, s);
}
}
std::map<std::string, std::vector<char>> c_save_sram() throw(std::bad_alloc)
std::map<std::string, std::vector<char>> c_save_sram()
{
lsnes_core_save_sram s;
std::map<std::string, std::vector<char>> ret;

View file

@ -458,12 +458,12 @@ void core_core::uninstall_all_handlers()
i->uninstall_handler();
}
std::map<std::string, std::vector<char>> core_core::save_sram() throw(std::bad_alloc)
std::map<std::string, std::vector<char>> core_core::save_sram()
{
return c_save_sram();
}
void core_core::load_sram(std::map<std::string, std::vector<char>>& sram) throw(std::bad_alloc)
void core_core::load_sram(std::map<std::string, std::vector<char>>& sram)
{
c_load_sram(sram);
}

View file

@ -1,7 +1,7 @@
#include "interface/setting.hpp"
#include "library/string.hpp"
core_setting_value::core_setting_value(const core_setting_value_param& p) throw(std::bad_alloc)
core_setting_value::core_setting_value(const core_setting_value_param& p)
: iname(p.iname), hname(p.hname), index(p.index)
{
}
@ -56,7 +56,7 @@ core_setting_group::core_setting_group(std::vector<core_setting_param> _settings
settings.insert(std::make_pair(i.iname, core_setting(i)));
}
void core_setting_group::fill_defaults(std::map<std::string, std::string>& values) throw(std::bad_alloc)
void core_setting_group::fill_defaults(std::map<std::string, std::string>& values)
{
for(auto i : settings)
if(!values.count(i.first))
@ -71,7 +71,7 @@ std::set<std::string> core_setting_group::get_setting_set()
return r;
}
std::vector<std::string> core_setting::hvalues() const throw(std::runtime_error)
std::vector<std::string> core_setting::hvalues() const
{
std::vector<std::string> x;
if(values.size() == 0)
@ -81,7 +81,7 @@ std::vector<std::string> core_setting::hvalues() const throw(std::runtime_error)
return x;
}
std::string core_setting::hvalue_to_ivalue(const std::string& hvalue) const throw(std::runtime_error)
std::string core_setting::hvalue_to_ivalue(const std::string& hvalue) const
{
for(auto i : values)
if(i.hname == hvalue)
@ -89,7 +89,7 @@ std::string core_setting::hvalue_to_ivalue(const std::string& hvalue) const thro
throw std::runtime_error("Invalid hvalue for setting");
}
signed core_setting::ivalue_to_index(const std::string& ivalue) const throw(std::runtime_error)
signed core_setting::ivalue_to_index(const std::string& ivalue) const
{
for(auto i : values)
if(i.iname == ivalue)

View file

@ -25,7 +25,7 @@ namespace
{
}
void invoke(const std::string& filename) throw(std::bad_alloc, std::runtime_error)
void invoke(const std::string& filename)
{
if(filename == "") {
(*output) << "Syntax: run-script <scriptfile>" << std::endl;
@ -45,12 +45,12 @@ namespace
}
}
std::string get_short_help() throw(std::bad_alloc)
std::string get_short_help()
{
return "Run file as a script";
}
std::string get_long_help() throw(std::bad_alloc)
std::string get_long_help()
{
return "Syntax: run-script <file>\nRuns file <file> just as it would have been entered in "
"the command line\n";
@ -93,7 +93,7 @@ set::listener::~listener()
{
}
void factory_base::_factory_base(set& _set, const std::string& cmd) throw(std::bad_alloc)
void factory_base::_factory_base(set& _set, const std::string& cmd)
{
threads::arlock h(get_cmd_lock());
in_set = &_set;
@ -113,7 +113,7 @@ void factory_base::set_died() throw()
in_set = NULL;
}
base::base(group& group, const std::string& cmd, bool dynamic) throw(std::bad_alloc)
base::base(group& group, const std::string& cmd, bool dynamic)
{
in_group = &group;
is_dynamic = dynamic;
@ -136,17 +136,17 @@ void base::group_died() throw()
if(is_dynamic) delete this;
}
std::string base::get_short_help() throw(std::bad_alloc)
std::string base::get_short_help()
{
return "No description available";
}
std::string base::get_long_help() throw(std::bad_alloc)
std::string base::get_long_help()
{
return "No help available on command " + commandname;
}
set::set() throw(std::bad_alloc)
set::set()
{
}
@ -169,7 +169,7 @@ set::~set() throw()
set_internal_t::clear(this);
}
void set::do_register(const std::string& name, factory_base& cmd) throw(std::bad_alloc)
void set::do_register(const std::string& name, factory_base& cmd)
{
threads::arlock h(get_cmd_lock());
auto& state = set_internal_t::get(this);
@ -183,7 +183,7 @@ void set::do_register(const std::string& name, factory_base& cmd) throw(std::bad
i->create(*this, name, cmd);
}
void set::do_unregister(const std::string& name, factory_base& cmd) throw(std::bad_alloc)
void set::do_unregister(const std::string& name, factory_base& cmd)
{
threads::arlock h(get_cmd_lock());
auto state = set_internal_t::get_soft(this);
@ -196,7 +196,6 @@ void set::do_unregister(const std::string& name, factory_base& cmd) throw(std::b
}
void set::add_callback(set::listener& listener)
throw(std::bad_alloc)
{
threads::arlock h(get_cmd_lock());
auto& state = set_internal_t::get(this);
@ -219,7 +218,7 @@ void set::drop_callback(set::listener& listener) throw()
}
}
group::group() throw(std::bad_alloc)
group::group()
: _listener(*this)
{
oom_panic_routine = default_oom_panic;
@ -352,7 +351,7 @@ void group::invoke(const std::string& cmd, const std::string& args) throw()
}
}
std::set<std::string> group::get_aliases() throw(std::bad_alloc)
std::set<std::string> group::get_aliases()
{
threads::arlock lock(get_cmd_lock());
std::set<std::string> r;
@ -361,7 +360,7 @@ std::set<std::string> group::get_aliases() throw(std::bad_alloc)
return r;
}
std::string group::get_alias_for(const std::string& aname) throw(std::bad_alloc)
std::string group::get_alias_for(const std::string& aname)
{
threads::arlock lock(get_cmd_lock());
if(!valid_alias_name(aname))
@ -375,7 +374,7 @@ std::string group::get_alias_for(const std::string& aname) throw(std::bad_alloc)
return "";
}
void group::set_alias_for(const std::string& aname, const std::string& avalue) throw(std::bad_alloc)
void group::set_alias_for(const std::string& aname, const std::string& avalue)
{
threads::arlock lock(get_cmd_lock());
if(!valid_alias_name(aname))
@ -395,7 +394,7 @@ void group::set_alias_for(const std::string& aname, const std::string& avalue) t
aliases[aname] = newlist;
}
bool group::valid_alias_name(const std::string& aliasname) throw(std::bad_alloc)
bool group::valid_alias_name(const std::string& aliasname)
{
if(aliasname.length() == 0 || aliasname[0] == '?' || aliasname[0] == '*')
return false;
@ -404,7 +403,7 @@ bool group::valid_alias_name(const std::string& aliasname) throw(std::bad_alloc)
return true;
}
void group::do_register(const std::string& name, base& cmd) throw(std::bad_alloc)
void group::do_register(const std::string& name, base& cmd)
{
threads::arlock h(get_cmd_lock());
auto& state = group_internal_t::get(this);
@ -413,7 +412,7 @@ void group::do_register(const std::string& name, base& cmd) throw(std::bad_alloc
state.commands[name] = &cmd;
}
void group::do_unregister(const std::string& name, base& cmd) throw(std::bad_alloc)
void group::do_unregister(const std::string& name, base& cmd)
{
threads::arlock h(get_cmd_lock());
auto state = group_internal_t::get_soft(this);
@ -435,7 +434,7 @@ void group::set_oom_panic(void (*fn)())
oom_panic_routine = default_oom_panic;
}
void group::add_set(set& s) throw(std::bad_alloc)
void group::add_set(set& s)
{
threads::arlock h(get_cmd_lock());
auto& state = group_internal_t::get(this);

View file

@ -58,7 +58,7 @@ namespace
~bps_patcher() throw();
bool identify(const std::vector<char>& patch) throw();
void dopatch(std::vector<char>& out, const std::vector<char>& original,
const std::vector<char>& patch, int32_t offset) throw(std::bad_alloc, std::runtime_error);
const std::vector<char>& patch, int32_t offset);
} bpspatch;
bps_patcher::~bps_patcher() throw()
@ -71,7 +71,7 @@ namespace
}
void bps_patcher::dopatch(std::vector<char>& out, const std::vector<char>& original,
const std::vector<char>& patch, int32_t offset) throw(std::bad_alloc, std::runtime_error)
const std::vector<char>& patch, int32_t offset)
{
if(offset)
(stringfmt() << "Nonzero offsets (" << offset << ") not allowed in BPS mode.").throwex();

View file

@ -24,7 +24,7 @@ namespace
~ips_patcher() throw();
bool identify(const std::vector<char>& patch) throw();
void dopatch(std::vector<char>& out, const std::vector<char>& original,
const std::vector<char>& patch, int32_t offset) throw(std::bad_alloc, std::runtime_error);
const std::vector<char>& patch, int32_t offset);
} ipspatch;
ips_patcher::~ips_patcher() throw()
@ -38,7 +38,7 @@ namespace
}
void ips_patcher::dopatch(std::vector<char>& out, const std::vector<char>& original,
const std::vector<char>& patch, int32_t offset) throw(std::bad_alloc, std::runtime_error)
const std::vector<char>& patch, int32_t offset)
{
//Initial guess.
out = original;

View file

@ -18,7 +18,7 @@ namespace
}
std::vector<char> patch(const std::vector<char>& original, const std::vector<char>& patch,
int32_t offset) throw(std::bad_alloc, std::runtime_error)
int32_t offset)
{
std::vector<char> out;
for(auto i : patchers())
@ -29,7 +29,7 @@ std::vector<char> patch(const std::vector<char>& original, const std::vector<cha
throw std::runtime_error("Unknown patch file format");
}
patcher::patcher() throw(std::bad_alloc)
patcher::patcher()
{
patchers().insert(this);
}

View file

@ -422,7 +422,7 @@ void hash::send_idle()
progresscb(0xFFFFFFFFFFFFFFFFULL, 0);
}
image::image() throw(std::bad_alloc)
image::image()
{
type = info::IT_NONE;
sha_256 = hashval("");
@ -430,7 +430,7 @@ image::image() throw(std::bad_alloc)
}
image::image(hash& h, const std::string& _filename, const std::string& base,
const struct image::info& info) throw(std::bad_alloc, std::runtime_error)
const struct image::info& info)
{
if(info.type == info::IT_NONE && _filename != "")
throw std::runtime_error("Tried to load NULL image");
@ -492,7 +492,7 @@ image::image(hash& h, const std::string& _filename, const std::string& base,
throw std::runtime_error("Unknown image type");
}
void image::patch(const std::vector<char>& patch, int32_t offset) throw(std::bad_alloc, std::runtime_error)
void image::patch(const std::vector<char>& patch, int32_t offset)
{
if(type == info::IT_NONE)
throw std::runtime_error("Not an image");

View file

@ -300,7 +300,7 @@ std::ostream& operator<<(std::ostream& os, const std::u32string& lkey)
return os;
}
void font2::add(const std::u32string& key, const glyph& fglyph) throw(std::bad_alloc)
void font2::add(const std::u32string& key, const glyph& fglyph)
{
glyphs[key] = fglyph;
if(fglyph.height > rowadvance)
@ -308,7 +308,6 @@ void font2::add(const std::u32string& key, const glyph& fglyph) throw(std::bad_a
}
std::u32string font2::best_ligature_match(const std::u32string& codepoints, size_t start) const
throw(std::bad_alloc)
{
std::u32string tmp;
if(start >= codepoints.length())

View file

@ -41,7 +41,7 @@ void _pixfmt_lrgb::decode(uint64_t* target, const uint8_t* src, size_t width,
}
void _pixfmt_lrgb::set_palette(auxpalette<false>& auxp, uint8_t rshift, uint8_t gshift,
uint8_t bshift) throw(std::bad_alloc)
uint8_t bshift)
{
auxp.pcache.resize(0x80000);
for(size_t i = 0; i < 0x80000; i++) {
@ -59,7 +59,7 @@ void _pixfmt_lrgb::set_palette(auxpalette<false>& auxp, uint8_t rshift, uint8_t
}
void _pixfmt_lrgb::set_palette(auxpalette<true>& auxp, uint8_t rshift, uint8_t gshift,
uint8_t bshift) throw(std::bad_alloc)
uint8_t bshift)
{
auxp.pcache.resize(0x80000);
for(size_t i = 0; i < 0x80000; i++) {

View file

@ -44,7 +44,7 @@ void _pixfmt_rgb15<uvswap>::decode(uint64_t* target, const uint8_t* src, size_t
template<bool uvswap>
void _pixfmt_rgb15<uvswap>::set_palette(auxpalette<false>& auxp, uint8_t rshift, uint8_t gshift,
uint8_t bshift) throw(std::bad_alloc)
uint8_t bshift)
{
auxp.pcache.resize(0x8000);
for(size_t i = 0; i < 0x8000; i++) {
@ -62,7 +62,7 @@ void _pixfmt_rgb15<uvswap>::set_palette(auxpalette<false>& auxp, uint8_t rshift,
template<bool uvswap>
void _pixfmt_rgb15<uvswap>::set_palette(auxpalette<true>& auxp, uint8_t rshift, uint8_t gshift,
uint8_t bshift) throw(std::bad_alloc)
uint8_t bshift)
{
auxp.pcache.resize(0x8000);
for(size_t i = 0; i < 0x8000; i++) {

View file

@ -43,7 +43,7 @@ void _pixfmt_rgb16<uvswap>::decode(uint64_t* target, const uint8_t* src, size_t
template<bool uvswap>
void _pixfmt_rgb16<uvswap>::set_palette(auxpalette<false>& auxp, uint8_t rshift, uint8_t gshift,
uint8_t bshift) throw(std::bad_alloc)
uint8_t bshift)
{
auxp.pcache.resize(0x10000);
for(size_t i = 0; i < 0x10000; i++) {
@ -61,7 +61,7 @@ void _pixfmt_rgb16<uvswap>::set_palette(auxpalette<false>& auxp, uint8_t rshift,
template<bool uvswap>
void _pixfmt_rgb16<uvswap>::set_palette(auxpalette<true>& auxp, uint8_t rshift, uint8_t gshift,
uint8_t bshift) throw(std::bad_alloc)
uint8_t bshift)
{
auxp.pcache.resize(0x10000);
for(size_t i = 0; i < 0x10000; i++) {

View file

@ -50,7 +50,7 @@ void _pixfmt_rgb24<uvswap>::decode(uint64_t* target, const uint8_t* src, size_t
template<bool uvswap>
void _pixfmt_rgb24<uvswap>::set_palette(auxpalette<false>& auxp, uint8_t rshift, uint8_t gshift,
uint8_t bshift) throw(std::bad_alloc)
uint8_t bshift)
{
auxp.rshift = rshift;
auxp.gshift = gshift;
@ -60,7 +60,7 @@ void _pixfmt_rgb24<uvswap>::set_palette(auxpalette<false>& auxp, uint8_t rshift,
template<bool uvswap>
void _pixfmt_rgb24<uvswap>::set_palette(auxpalette<true>& auxp, uint8_t rshift, uint8_t gshift,
uint8_t bshift) throw(std::bad_alloc)
uint8_t bshift)
{
auxp.rshift = rshift;
auxp.gshift = gshift;

View file

@ -36,7 +36,7 @@ void _pixfmt_rgb32::decode(uint64_t* target, const uint8_t* src, size_t width,
}
void _pixfmt_rgb32::set_palette(auxpalette<false>& auxp, uint8_t rshift, uint8_t gshift,
uint8_t bshift) throw(std::bad_alloc)
uint8_t bshift)
{
auxp.rshift = rshift;
auxp.gshift = gshift;
@ -45,7 +45,7 @@ void _pixfmt_rgb32::set_palette(auxpalette<false>& auxp, uint8_t rshift, uint8_t
}
void _pixfmt_rgb32::set_palette(auxpalette<true>& auxp, uint8_t rshift, uint8_t gshift,
uint8_t bshift) throw(std::bad_alloc)
uint8_t bshift)
{
auxp.rshift = rshift;
auxp.gshift = gshift;

View file

@ -134,7 +134,7 @@ color_mod::color_mod(const std::string& name, std::function<void(int64_t&)> fn)
colornames()[name] = std::make_pair(fn, true);
}
pixfmt::pixfmt() throw(std::bad_alloc)
pixfmt::pixfmt()
{
pixfmts().push_back(this);
}
@ -148,7 +148,7 @@ pixfmt::~pixfmt() throw()
}
}
raw::raw(const info& info) throw(std::bad_alloc)
raw::raw(const info& info)
{
size_t unit = info.type->get_bpp();
size_t pixel_offset = info.offset_y * info.physstride + unit * info.offset_x;
@ -161,7 +161,7 @@ raw::raw(const info& info) throw(std::bad_alloc)
allocated = 0;
}
raw::raw() throw(std::bad_alloc)
raw::raw()
{
user_memory = true;
fmt = NULL;
@ -172,7 +172,7 @@ raw::raw() throw(std::bad_alloc)
allocated = 0;
}
raw::raw(const raw& f) throw(std::bad_alloc)
raw::raw(const raw& f)
{
user_memory = true;
fmt = f.fmt;
@ -186,7 +186,7 @@ raw::raw(const raw& f) throw(std::bad_alloc)
memcpy(addr + stride * i, f.addr + f.stride * i, unit * width);
}
raw& raw::operator=(const raw& f) throw(std::bad_alloc, std::runtime_error)
raw& raw::operator=(const raw& f)
{
if(!user_memory)
throw std::runtime_error("Target framebuffer is not writable");
@ -215,7 +215,7 @@ raw::~raw()
delete[] addr;
}
void raw::load(const std::vector<char>& data) throw(std::bad_alloc, std::runtime_error)
void raw::load(const std::vector<char>& data)
{
if(data.size() < 2)
throw std::runtime_error("Bad screenshot data");
@ -281,7 +281,7 @@ void raw::load(const std::vector<char>& data) throw(std::bad_alloc, std::runtime
decode_words<4>(reinterpret_cast<uint8_t*>(addr), data2 + dataoffset, data.size() - dataoffset);
}
void raw::save(std::vector<char>& data) throw(std::bad_alloc)
void raw::save(std::vector<char>& data)
{
uint8_t* memory = reinterpret_cast<uint8_t*>(addr);
unsigned m;
@ -325,7 +325,7 @@ void raw::save(std::vector<char>& data) throw(std::bad_alloc)
}
}
void raw::save_png(const std::string& file) throw(std::bad_alloc, std::runtime_error)
void raw::save_png(const std::string& file)
{
uint8_t* memory = reinterpret_cast<uint8_t*>(addr);
png::encoder img;
@ -436,7 +436,7 @@ void fb<X>::copy_from(raw& scr, size_t hscale, size_t vscale) throw()
}
template<bool X>
void fb<X>::set_palette(uint32_t r, uint32_t g, uint32_t b) throw(std::bad_alloc)
void fb<X>::set_palette(uint32_t r, uint32_t g, uint32_t b)
{
typename fb<X>::element_t R, G, B;
if(r == active_rshift && g == active_gshift && b == active_bshift)
@ -467,7 +467,7 @@ void fb<X>::set(element_t* _memory, size_t _width, size_t _height, size_t _pitch
}
template<bool X>
void fb<X>::reallocate(size_t _width, size_t _height, bool _upside_down) throw(std::bad_alloc)
void fb<X>::reallocate(size_t _width, size_t _height, bool _upside_down)
{
size_t ustride = (_width + 11) / 12 * 12;
if(width != _width || height != _height) {
@ -519,7 +519,7 @@ size_t raw::get_height() const throw() { return height; }
template<bool X> size_t fb<X>::get_origin_x() const throw() { return offset_x; }
template<bool X> size_t fb<X>::get_origin_y() const throw() { return offset_y; }
void queue::add(struct object& obj) throw(std::bad_alloc)
void queue::add(struct object& obj)
{
struct node* n = reinterpret_cast<struct node*>(alloc(sizeof(node)));
n->obj = &obj;
@ -531,7 +531,7 @@ void queue::add(struct object& obj) throw(std::bad_alloc)
queue_head = queue_tail = n;
}
void queue::copy_from(queue& q) throw(std::bad_alloc)
void queue::copy_from(queue& q)
{
struct node* tmp = q.queue_head;
while(tmp) {
@ -571,7 +571,7 @@ void queue::clear() throw()
queue_tail = NULL;
}
void* queue::alloc(size_t block) throw(std::bad_alloc)
void* queue::alloc(size_t block)
{
block = (block + 15) / 16 * 16;
if(block > RENDER_PAGE_SIZE)
@ -639,7 +639,7 @@ bool object::kill_request(void* obj) throw()
return false;
}
font::font() throw(std::bad_alloc)
font::font()
{
bad_glyph_data[0] = 0x018001AAU;
bad_glyph_data[1] = 0x01800180U;
@ -649,7 +649,7 @@ font::font() throw(std::bad_alloc)
bad_glyph.data = bad_glyph_data;
}
void font::load_hex_glyph(const char* data, size_t size) throw(std::bad_alloc, std::runtime_error)
void font::load_hex_glyph(const char* data, size_t size)
{
char buf2[8];
std::string line(data, data + size);
@ -686,7 +686,7 @@ void font::load_hex_glyph(const char* data, size_t size) throw(std::bad_alloc, s
glyphs[cp].offset = p;
}
void font::load_hex(const char* data, size_t size) throw(std::bad_alloc, std::runtime_error)
void font::load_hex(const char* data, size_t size)
{
const char* enddata = data + size;
while(data != enddata) {
@ -744,7 +744,7 @@ std::pair<size_t, size_t> font::get_metrics(const std::string& string, uint32_t
return std::make_pair(commit_width, commit_height);
}
std::vector<font::layout> font::dolayout(const std::string& string) throw(std::bad_alloc)
std::vector<font::layout> font::dolayout(const std::string& string)
{
//First, calculate the number of glyphs to draw.
size_t chars = 0;
@ -909,7 +909,7 @@ void font::for_each_glyph(const std::string& str, uint32_t alignx, bool xdbl, bo
}
color::color(const std::string& clr) throw(std::bad_alloc, std::runtime_error)
color::color(const std::string& clr)
{
int64_t col = -1;
bool first = true;

Some files were not shown because too many files have changed in this diff Show more