From 4f3f8ac79fbf15234f8cfe8bfe570dd406953a1c Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Thu, 15 Sep 2011 22:56:33 +0300 Subject: [PATCH] Make git diff --check happy --- avidump/avidump-control.cpp | 4 ++-- avidump/avidump.cpp | 12 +++++------ avidump/avidump.hpp | 14 ++++++------- avsnoop.hpp | 24 +++++++++++----------- command.cpp | 4 ++-- command.hpp | 16 +++++++-------- fonts/ACKNOWLEDGEMENTS | 2 -- fonts/parsehexfont.cpp | 5 ++--- fonts/verifyhexfont.cpp | 2 +- framerate.cpp | 6 +++--- framerate.hpp | 14 ++++++------- keymapper.hpp | 22 ++++++++++---------- lsnes.cpp | 12 +++++------ lua.cpp | 2 +- lua/movie.cpp | 2 +- mainloop.cpp | 20 +++++++++--------- misc.hpp | 14 ++++++------- movie.cpp | 6 +++--- movie.hpp | 12 +++++------ moviefile.cpp | 3 +-- render.cpp | 2 +- render.hpp | 50 ++++++++++++++++++++++----------------------- rom.cpp | 2 +- rom.hpp | 10 ++++----- rrdata.cpp | 4 ++-- rrdata.hpp | 2 +- settings.cpp | 4 ++-- settings.hpp | 40 ++++++++++++++++++------------------ window-sdl.cpp | 21 +++++++++---------- window.hpp | 36 ++++++++++++++++---------------- zip.hpp | 28 ++++++++++++------------- 31 files changed, 195 insertions(+), 200 deletions(-) diff --git a/avidump/avidump-control.cpp b/avidump/avidump-control.cpp index 992dea5f..1f133cab 100644 --- a/avidump/avidump-control.cpp +++ b/avidump/avidump-control.cpp @@ -44,7 +44,7 @@ namespace uint32_t _magic = 403703808; uint8_t* magic = reinterpret_cast(&_magic); dscr.set_palette(magic[2], magic[1], magic[0]); - + struct lua_render_context lrc; render_queue rq; lrc.left_gap = dlb; @@ -77,7 +77,7 @@ namespace } void gameinfo(const std::string& gamename, const std::list>& - authors, double gametime, const std::string& rerecords) throw(std::bad_alloc, + authors, double gametime, const std::string& rerecords) throw(std::bad_alloc, std::runtime_error) { //We don't have place for this info and thus ignore it. diff --git a/avidump/avidump.cpp b/avidump/avidump.cpp index da6bd3c9..86d1270f 100644 --- a/avidump/avidump.cpp +++ b/avidump/avidump.cpp @@ -256,9 +256,9 @@ void avidumper::print_summary(std::ostream& str) uint64_t global_a2frames = raw_samples / 2; double global_a2length = raw_samples / (2.0 * audio_native_sampling_rate); - + std::ostringstream s2; - + s2 << "Quantity |This segment |All segments |" << std::endl; s2 << "----------------+---------------------+---------------------+" << std::endl; s2 << "Segment number | " << fmtint(local_segno, 10) << "| N/A|" << std::endl; @@ -275,7 +275,7 @@ void avidumper::print_summary(std::ostream& str) s2 << "A2/V desync | N/A| " << fmtdbl(global_a2length - global_vlength, 10) << "|" << std::endl; s2 << "----------------+---------------------+---------------------+" << std::endl; - + str << s2.str(); } @@ -314,7 +314,7 @@ void avidumper::on_frame_threaded(const uint32_t* data, uint16_t width, uint16_t } this_is_keyframe = (segment_frames == 0 || segment_frames - segment_last_keyframe >= keyframe_interval); - + if(this_is_keyframe) { memcpy(&tframe[0], data, 4 * static_cast(width) * height); segment_last_keyframe = segment_frames; @@ -365,7 +365,7 @@ void avidumper::on_end() throw(std::bad_alloc, std::runtime_error) frame_cond.notify_all(); frame_mutex.unlock(); frame_thread->join(); - + flush_audio_to(audio_put_ptr); fixup_avi_header_and_close(); if(sox_open) { @@ -549,7 +549,7 @@ void avidumper::open_and_write_avi_header(uint16_t width, uint16_t height, uint3 throw std::runtime_error("Can't open output AVI file"); std::vector aviheader; uint32_t usecs_per_frame = static_cast(1000000ULL * fps_d / fps_n); - + /* AVI main chunk header. */ /* The tentative AVI header size of 336 doesn't include the video data, so we need to fix it up later. */ append(aviheader, str("RIFF"), ptr(fixup_avi_size), u32(336), str("AVI ")); diff --git a/avidump/avidump.hpp b/avidump/avidump.hpp index 206428f8..1934eda4 100644 --- a/avidump/avidump.hpp +++ b/avidump/avidump.hpp @@ -96,7 +96,7 @@ struct avi_frame { /** * Constructor. - * + * * parameter _flags: Flags for frame. * parameter _type: AVI type for frame (big-endian!). * parameter _offset: Offset of frame from start of MOVI. @@ -106,7 +106,7 @@ struct avi_frame /** * Write the index entry for frame. - * + * * parameter buf: Buffer to write to. */ void write(uint8_t* buf); @@ -184,7 +184,7 @@ public: /** * Dump a frame (new segment starts if needed). Pixel byte order is BGRx. - * + * * parameter data: The frame data. * parameter width: Width of frame. * parameter height: Height of frame. @@ -198,7 +198,7 @@ public: /** * Dump an audio sample - * + * * parameter left: Signed sample for left channel (-32768 - 327678). * parameter right: Signed sample for right channel (-32768 - 327678). * throws std::bad_alloc: Not enough memory. @@ -216,14 +216,14 @@ void on_end() throw(std::bad_alloc, std::runtime_error); /** * Causes current thread to become encode thread. Do not call this, the code internally uses it. - * + * * returns: Return status for the thread. */ int encode_thread(); - + /** * Set capture errored flag. - * + * * parameter err: The error message. */ void set_capture_error(const char* err) throw(); diff --git a/avsnoop.hpp b/avsnoop.hpp index e0ec77c1..cad2c374 100644 --- a/avsnoop.hpp +++ b/avsnoop.hpp @@ -15,7 +15,7 @@ class av_snooper public: /** * Create new A/V snooper. - * + * * throws std::bad_alloc: Not enough memory. */ av_snooper() throw(std::bad_alloc); @@ -27,7 +27,7 @@ public: /** * Dump a frame. - * + * * parameter _frame: The frame to dump. * parameter fps_n: Current fps numerator. * parameter fps_d: Current fps denomerator. @@ -39,7 +39,7 @@ public: /** * Dump a frame. - * + * * parameter _frame: The frame to dump. * parameter fps_n: Current fps numerator. * parameter fps_d: Current fps denomerator. @@ -49,7 +49,7 @@ public: /** * Dump a sample. - * + * * parameter l: Left channel sample. * parameter r: Right channel sample. * throws std::bad_alloc: Not enough memory. @@ -59,7 +59,7 @@ public: /** * Dump a sample. - * + * * parameter l: Left channel sample. * parameter r: Right channel sample. * parameter win: Graphics system handle. @@ -68,7 +68,7 @@ public: /** * End dump. - * + * * throws std::bad_alloc: Not enough memory. * throws std::runtime_error: Error dumping sample. */ @@ -76,14 +76,14 @@ public: /** * End dump. - * + * * parameter win: Graphics system handle. */ static void end(window* win) throw(); /** * Notify game information. - * + * * parameter gamename: Name of the game. * parameter authors: Authors of the run. * parameter gametime: Game time. @@ -96,7 +96,7 @@ public: /** * Notify game information. - * + * * parameter gamename: Name of the game. * parameter authors: Authors of the run. * parameter gametime: Game time. @@ -114,7 +114,7 @@ public: /** * Is there dump in progress? - * + * * returns: True if dump is in progress, false if not. */ static bool dump_in_progress() throw(); @@ -141,14 +141,14 @@ public: /** * Add a notifier. - * + * * parameter notifier: New notifier to add. */ static void add_dump_notifier(dump_notification& notifier) throw(std::bad_alloc); /** * Remove a notifier. - * + * * parameter notifier: Existing notifier to remove. */ static void remove_dump_notifier(dump_notification& notifier) throw(); diff --git a/command.cpp b/command.cpp index 7e6fceca..22a2203c 100644 --- a/command.cpp +++ b/command.cpp @@ -154,7 +154,7 @@ void command::invokeC(const std::string& cmd, window* win) throw() rcmd = cmd2.substr(1, split - 1); if(rcmd.length() > 0 && rcmd[0] != '*') { //This may be an alias. - std::string aname = cmd2.substr(1); + std::string aname = cmd2.substr(1); if(aliases.count(aname)) { //Yup. out(win) << aname << " is an alias for: " << std::endl; @@ -226,7 +226,7 @@ std::string command::get_short_help() throw(std::bad_alloc) { return "No description available"; } - + std::string command::get_long_help() throw(std::bad_alloc) { return "No help available on command " + commandname; diff --git a/command.hpp b/command.hpp index ace4d7d3..d505cd6e 100644 --- a/command.hpp +++ b/command.hpp @@ -15,7 +15,7 @@ class command public: /** * Register a new command. - * + * * parameter cmd: The command to register. * throws std::bad_alloc: Not enough memory. */ @@ -28,7 +28,7 @@ public: /** * Invoke a command. - * + * * parameter arguments: Arguments to command. * parameter window: Handle to graphics system. * throws std::bad_alloc: Not enough memory. @@ -38,7 +38,7 @@ public: /** * Look up and invoke a command. The command will undergo alias expansion and recursion checking. - * + * * parameter cmd: Command to exeucte. * parameter window: Handle to graphics system. */ @@ -48,7 +48,7 @@ public: * Get short help for command. */ virtual std::string get_short_help() throw(std::bad_alloc); - + /** * Get long help for command. */ @@ -67,28 +67,28 @@ class tokensplitter public: /** * Create a new splitter. - * + * * parameter _line: The line to start splitting. * throws std::bad_alloc: Not enough memory. */ tokensplitter(const std::string& _line) throw(std::bad_alloc); /** * Is there more coming? - * + * * returns: True if there is more, false otherwise. * throws std::bad_alloc: Not enough memory. */ operator bool() throw(); /** * Get the next token. - * + * * returns: The next token from line. If there is no more tokens, returns "". * throws std::bad_alloc: Not enough memory. */ operator std::string() throw(std::bad_alloc); /** * Get all that is remaining. - * + * * returns: All remaining parts of line as-is. * throws std::bad_alloc: Not enough memory. */ diff --git a/fonts/ACKNOWLEDGEMENTS b/fonts/ACKNOWLEDGEMENTS index bf9aef13..e88501e9 100644 --- a/fonts/ACKNOWLEDGEMENTS +++ b/fonts/ACKNOWLEDGEMENTS @@ -8,5 +8,3 @@ Roman released his font and software as freeware: "All of my works you find her cp437.hex is conversion from CP437.F16 from font comes from ftp://ftp.simtel.net/pub/simtelnet/msdos/screen/fntcol16.zip * The package is (c) by Joseph Gil * The individual fonts are public domain. - - diff --git a/fonts/parsehexfont.cpp b/fonts/parsehexfont.cpp index 402ea80f..db04c113 100644 --- a/fonts/parsehexfont.cpp +++ b/fonts/parsehexfont.cpp @@ -21,8 +21,7 @@ void add_glyph(uint32_t codepoint, const std::string& appearence) } if(!glyph_offsets.count(appearence)) { if(appearence.find_first_not_of("0123456789ABCDEFabcdef") < appearence.length()) { - std::cerr << "Invalid font representation (invalid hex char)." - << std::endl; + std::cerr << "Invalid font representation (invalid hex char)." << std::endl; std::cerr << "Faulty representation: '" << appearence << "'." << std::endl; exit(1); } @@ -56,7 +55,7 @@ uint32_t keyhash(uint32_t key, uint32_t item, uint32_t mod) uint32_t b = 0; uint32_t c = item; a=a-b; a=a-c; a=a^(c >> 13); - b=b-c; b=b-a; b=b^(a << 8); + b=b-c; b=b-a; b=b^(a << 8); c=c-a; c=c-b; c=c^(b >> 13); a=a-b; a=a-c; a=a^(c >> 12); b=b-c; b=b-a; b=b^(a << 16); diff --git a/fonts/verifyhexfont.cpp b/fonts/verifyhexfont.cpp index c449a68d..05107332 100644 --- a/fonts/verifyhexfont.cpp +++ b/fonts/verifyhexfont.cpp @@ -21,7 +21,7 @@ uint32_t keyhash(uint32_t key, uint32_t item, uint32_t mod) uint32_t b = 0; uint32_t c = item; a=a-b; a=a-c; a=a^(c >> 13); - b=b-c; b=b-a; b=b^(a << 8); + b=b-c; b=b-a; b=b^(a << 8); c=c-a; c=c-b; c=c^(b >> 13); a=a-b; a=a-c; a=a^(c >> 12); b=b-c; b=b-a; b=b^(a << 16); diff --git a/framerate.cpp b/framerate.cpp index 0065d5bf..3d44638a 100644 --- a/framerate.cpp +++ b/framerate.cpp @@ -30,7 +30,7 @@ namespace target_infinite = false; target_fps = nominal_rate; } - + bool is_set() throw() { return !target_nominal; @@ -56,7 +56,7 @@ namespace target_infinite = false; target_nominal = false; } - + virtual std::string get() throw(std::bad_alloc) { if(target_nominal) @@ -67,7 +67,7 @@ namespace return o.str(); } } - + } targetfps; } diff --git a/framerate.hpp b/framerate.hpp index 60351ffb..e2836887 100644 --- a/framerate.hpp +++ b/framerate.hpp @@ -14,7 +14,7 @@ /** * \brief Set the nominal framerate - * + * * Sets the nominal frame rate. Framerate limiting tries to maintain the nominal framerate when there is no other * explict framerate to maintain. */ @@ -22,27 +22,27 @@ void set_nominal_framerate(double fps) throw(); /** * \brief Get the current realized framerate. - * + * * Returns the current realized framerate. - * + * * \return The framerate the system is currently archiving. */ double get_framerate() throw(); /** * \brief ACK frame start. - * + * * Acknowledge frame start for timing purposes. - * + * * \param msec Current time. */ void ack_frame_tick(uint64_t msec) throw(); /** * \brief Obtain how long to wait for next frame. - * + * * Computes the number of milliseconds to wait for next frame. - * + * * \param msec Current time. * \return Number of more milliseconds to wait. */ diff --git a/keymapper.hpp b/keymapper.hpp index b5b179a2..6b79aa6d 100644 --- a/keymapper.hpp +++ b/keymapper.hpp @@ -12,9 +12,9 @@ /** * \brief Fixup command according to key polarity. - * + * * Takes in a raw command and returns the command that should be actually executed given the key polarity. - * + * * \param cmd Raw command. * \param polarity Polarity (True => Being pressed, False => Being released). * \return The fixed command, "" if no command should be executed. @@ -25,10 +25,10 @@ std::string fixup_command_polarity(std::string cmd, bool polarity) throw(std::ba /** * \brief Keyboard mapper. - * + * * This class handles internals of mapping events from keyboard buttons and pseudo-buttons. The helper class T has * to have the following: - * + * * unsigned T::mod_str(const std::string& mod): Translate modifiers set mod into modifier mask. * typedef T::internal_keysymbol: Key symbol to match against. Needs to have == operator available. * T::internal_keysymbol key_str(const std::string& keyname): Translate key name to key to match against. @@ -43,9 +43,9 @@ class keymapper public: /** * \brief Bind a key. - * + * * Binds a key, erroring out if binding would conflict with existing one. - * + * * \param mod Modifier set to require to be pressed. * \param modmask Modifier set to take into account. * \param keyname Key to bind the action to. @@ -79,9 +79,9 @@ public: /** * \brief Unbind a key. - * + * * Unbinds a key, erroring out if binding does not exist.. - * + * * \param mod Modifier set to require to be pressed. * \param modmask Modifier set to take into account. * \param keyname Key to bind the action to. @@ -105,9 +105,9 @@ public: /** * \brief Map key symbol from keyboard + polarity into a command. - * + * * Takes in symbol from keyboard and polarity. Outputs command to run. - * + * * \param sym Symbol from keyboard (with its mods). * \param polarity True if key is being pressed, false if being released. * \return The command to run. "" if none. @@ -130,7 +130,7 @@ public: /** * \brief Dump list of bindigns as messages to specified graphics handle. - * + * * \param win The graphics system handle. * \throws std::bad_alloc Not enough memory. */ diff --git a/lsnes.cpp b/lsnes.cpp index a3ca9d9e..e0059ee8 100644 --- a/lsnes.cpp +++ b/lsnes.cpp @@ -52,10 +52,10 @@ struct moviefile generate_movie_template(std::vector cmdline, loade throw std::runtime_error("Bad author name, one of full or nickname must be present"); movie.authors.push_back(std::make_pair(full, nick)); } - + } - - + + return movie; } @@ -80,7 +80,7 @@ int main(int argc, char** argv) } window win; init_lua(&win); - + win.out() << "BSNES version: " << bsnes_core_version << std::endl; win.out() << "lsnes version: lsnes rr" << lsnes_version << std::endl; win.out() << "Command line is: "; @@ -112,14 +112,14 @@ int main(int argc, char** argv) set_nominal_framerate(322445.0/6448.0); else if(r.region == REGION_NTSC) set_nominal_framerate(10738636.0/178683.0); - + out(&win) << "--- Internal memory mappings ---" << std::endl; dump_region_map(&win); out(&win) << "--- End of Startup --- " << std::endl; try { moviefile movie; bool loaded = false; - for(auto i = cmdline.begin(); i != cmdline.end(); i++) + for(auto i = cmdline.begin(); i != cmdline.end(); i++) if(i->length() > 0 && (*i)[0] != '-') { movie = moviefile(*i); loaded = true; diff --git a/lua.cpp b/lua.cpp index 2cec9692..74d7ce38 100644 --- a/lua.cpp +++ b/lua.cpp @@ -125,7 +125,7 @@ bool get_boolean_argument(lua_State* LS, unsigned argindex, const char* fname) lua_render_context* lua_render_ctx = NULL; controls_t* lua_input_controllerdata = NULL; -namespace +namespace { lua_State* L; bool recursive_flag = false; diff --git a/lua/movie.cpp b/lua/movie.cpp index e09126e8..536ce8c6 100644 --- a/lua/movie.cpp +++ b/lua/movie.cpp @@ -39,7 +39,7 @@ namespace return 1; } } movie_readonly; - + class lua_movie_set_readwrite : public lua_function { public: diff --git a/mainloop.cpp b/mainloop.cpp index 90bed82e..617e8b72 100644 --- a/mainloop.cpp +++ b/mainloop.cpp @@ -363,7 +363,7 @@ namespace } done = 1; } - + //Do button action. void do_button_action(unsigned ui_id, unsigned button, short newstate, bool do_xor = false) { @@ -535,7 +535,7 @@ namespace x << "ERROR: Emulator core version mismatch!" << std::endl << "\tThis version: " << bsnes_core_version << std::endl << "\tFile is from: " << _movie.coreversion << std::endl; - throw std::runtime_error(x.str()); + throw std::runtime_error(x.str()); } else out(win) << "WARNING: Emulator core version mismatch!" << std::endl << "\tThis version: " << bsnes_core_version << std::endl @@ -556,14 +556,14 @@ namespace newmovie = movb.get_movie(); else newmovie.load(_movie.rerecords, _movie.projectid, _movie.input); - + if(will_load_state) { std::vector tmp; tmp.resize(_movie.movie_state.size()); memcpy(&tmp[0], &_movie.movie_state[0], tmp.size()); newmovie.restore_state(tmp, true); } - + //Negative return. rrdata::read_base(_movie.projectid); rrdata::add_internal(); @@ -589,7 +589,7 @@ namespace system_corrupt = true; throw; } - + //Okay, copy the movie data. our_movie = _movie; if(!our_movie.is_savestate || lmode == LOAD_STATE_MOVIE) { @@ -652,7 +652,7 @@ namespace out(win) << "Rerecords " << _movie.rerecords << " length " << x.str() << " (" << _movie.get_frame_count() << " frames)" << std::endl; } - + if(_movie.gamename != "") out(win) << "Game Name: " << _movie.gamename << std::endl; for(size_t i = 0; i < _movie.authors.size(); i++) @@ -855,7 +855,7 @@ class my_interface : public SNES::Interface } av_snooper::frame(ls, fps_n, fps_d, win); } - + void audio_sample(int16_t l_sample, int16_t r_sample) { uint16_t _l = l_sample; @@ -1125,7 +1125,7 @@ namespace throw std::runtime_error("Filename required"); mark_pending_save(args, SAVE_STATE); } - + std::string get_short_help() throw(std::bad_alloc) { return "Save state"; } std::string get_long_help() throw(std::bad_alloc) { @@ -1229,7 +1229,7 @@ namespace "Shows the run authors\n"; } } getauthorc; - + class repainter : public command { public: @@ -1442,7 +1442,7 @@ namespace prev_mouse_mask = _b; } } mousebuttonh; - + class button_action : public command { public: diff --git a/misc.hpp b/misc.hpp index f2aa5f7c..11f7bda8 100644 --- a/misc.hpp +++ b/misc.hpp @@ -8,7 +8,7 @@ /** * \brief Recognize "foo", "foo (anything)" and "foo\t(anything)". - * + * * \param haystack The string to search. * \param needle The string to find. * \return True if found, false if not. @@ -48,9 +48,9 @@ void set_random_seed() throw(std::bad_alloc); /** * \brief Load a ROM. - * + * * Given commandline arguments, load a ROM. - * + * * \param cmdline The command line. * \param win Handle to send the messages to. * \return The loaded ROM set. @@ -62,7 +62,7 @@ struct loaded_rom load_rom_from_commandline(std::vector cmdline, wi /** * \brief Dump listing of regions to graphics system messages. - * + * * \param win Handle to send the messages to. * \throws std::bad_alloc Not enough memory. */ @@ -70,7 +70,7 @@ void dump_region_map(window* win) throw(std::bad_alloc); /** * \brief Return printing stream. - * + * * \param win Handle to graphics system. * \return Stream. If win is NULL, this is std::cout. Otherwise it is win->out(). * \throws std::bad_alloc Not enough memory. @@ -79,14 +79,14 @@ std::ostream& out(window* win) throw(std::bad_alloc); /** * \brief Fatal error. - * + * * Fatal error. If win is non-NULL, it calls win->fatal_error(). Otherwise just immediately quits with error. */ void fatal_error(window* win) throw(); /** * \brief Get path to config directory. - * + * * \param win Graphics system handle. * \return The config directory path. * \throw std::bad_alloc Not enough memory. diff --git a/movie.cpp b/movie.cpp index 779de2cf..82221793 100644 --- a/movie.cpp +++ b/movie.cpp @@ -218,7 +218,7 @@ controls_t movie::get_controls() throw() return c; //End of movie. for(size_t i = 0; i < TOTAL_CONTROLS; i++) { uint32_t polls = pollcounters[i] & 0x7FFFFFFF; - uint32_t index = (changes > polls) ? polls : changes - 1; + uint32_t index = (changes > polls) ? polls : changes - 1; c(i) = movie_data[current_frame_first_subframe + index](i); } return c; @@ -270,7 +270,7 @@ void movie::next_frame() throw(std::bad_alloc) //Increment the current frame counter and subframe counter. Note that first subframe is undefined for //frame 0 and 0 for frame 1. if(current_frame) - current_frame_first_subframe = current_frame_first_subframe + + current_frame_first_subframe = current_frame_first_subframe + count_changes(current_frame_first_subframe); else current_frame_first_subframe = 0; @@ -313,7 +313,7 @@ short movie::next_input(unsigned controlindex) throw(std::bad_alloc, std::logic_ //Otherwise find the last valid frame of input. uint32_t changes = count_changes(current_frame_first_subframe); uint32_t polls = (pollcounters[controlindex]++) & 0x7FFFFFFF; - uint32_t index = (changes > polls) ? polls : changes - 1; + uint32_t index = (changes > polls) ? polls : changes - 1; //debuglog << "Frame=" << current_frame << " Subframe=" << polls << " control=" << controlindex << " value=" << movie_data[current_frame_first_subframe + index](controlindex) << " fetchrow=" << current_frame_first_subframe + index << std::endl << std::flush; return movie_data[current_frame_first_subframe + index](controlindex); } else { diff --git a/movie.hpp b/movie.hpp index 61844b27..62c87534 100644 --- a/movie.hpp +++ b/movie.hpp @@ -226,7 +226,7 @@ public: /** * \brief Get reset status for current frame. - * + * * \return -1 if current frame doesn't have a reset. Otherwise number of cycles to wait for delayed reset (0 is * immediate reset). */ @@ -239,7 +239,7 @@ public: /** * \brief Get how manyth poll in the frame next poll would be. - * + * * \return Poll number. */ unsigned next_poll_number(); @@ -283,7 +283,7 @@ class movie_logic public: /** * \brief Create new bridge. - * + * * \param m The movie to manipulate. */ movie_logic(movie& m) throw(); @@ -300,21 +300,21 @@ public: /** * \brief Notify about new frame starting. - * + * * \return Reset status for the new frame. */ long new_frame_starting(bool dont_poll) throw(std::bad_alloc, std::runtime_error); /** * \brief Poll for input. - * + * * \return Value for polled input. */ short input_poll(bool port, unsigned dev, unsigned id) throw(std::bad_alloc, std::runtime_error); /** * \brief Called when movie code needs new controls snapshot. - * + * * \param subframe True if this is for subframe update, false if for frame update. */ virtual controls_t update_controls(bool subframe) throw(std::bad_alloc, std::runtime_error) = 0; diff --git a/moviefile.cpp b/moviefile.cpp index e23de614..6895402d 100644 --- a/moviefile.cpp +++ b/moviefile.cpp @@ -313,7 +313,7 @@ void moviefile::save(const std::string& movie, unsigned compression) throw(std:: } write_authors_file(w, authors); write_input(w, input, port1, port2); - + w.commit(); } @@ -398,4 +398,3 @@ rom_type gametype_romtype(gametype_t type) return ROMTYPE_NONE; }; } - diff --git a/render.cpp b/render.cpp index 31d15eb3..03c241dc 100644 --- a/render.cpp +++ b/render.cpp @@ -310,7 +310,7 @@ void lcscreen::load(const std::vector& data) throw(std::bad_alloc, std::ru if(!user_memory) throw std::runtime_error("Can't load to non-user memory"); const uint8_t* data2 = reinterpret_cast(&data[0]); - if(data.size() < 2) + if(data.size() < 2) throw std::runtime_error("Corrupt saved screenshot data"); uint32_t _width = static_cast(data2[0]) * 256 + static_cast(data2[1]); if(_width > 1 && data.size() % (2 * _width) != 2) diff --git a/render.hpp b/render.hpp index 68e7a59c..e66119bd 100644 --- a/render.hpp +++ b/render.hpp @@ -14,7 +14,7 @@ struct lcscreen { /** * \brief Create new screen from bsnes output data. - * + * * \param mem The output buffer from bsnes. * \param hires True if in hires mode (512-wide lines instead of 256-wide). * \param interlace True if in interlace mode. @@ -30,7 +30,7 @@ struct lcscreen void load(const std::vector& data) throw(std::bad_alloc, std::runtime_error); void save(std::vector& data) throw(std::bad_alloc); void save_png(const std::string& file) throw(std::bad_alloc, std::runtime_error); - + /** * \brief Destructor. */ @@ -74,7 +74,7 @@ struct screen { /** * \brief Create new screen - * + * * Creates screen. The screen dimensions are initially 0x0. */ screen() throw(); @@ -83,12 +83,12 @@ struct screen * \brief Destructor. */ ~screen() throw(); - + /** * \brief Set the screen to use specified backing memory. - * + * * Sets the backing memory for screen. The specified memory is not freed if screen is reallocated or destroyed. - * + * * \param _memory The memory buffer. * \param _width Width of screen. * \param _height Height of screen. @@ -98,12 +98,12 @@ struct screen */ void set(uint32_t* _memory, uint32_t _width, uint32_t _height, uint32_t _originx, uint32_t _originy, uint32_t _pitch) throw(); - + /** * \brief Set new size for screen, reallocating backing memory. - * + * * Sets the size of the screen. The memory is freed if screen is reallocated or destroyed. - * + * * \param _width Width of screen. * \param _height Height of screen. * \param _originx X coordinate for origin. @@ -116,10 +116,10 @@ struct screen /** * \brief Paint low-color screen into screen. - * + * * Paints low-color screen into screen. The upper-left of image will be at origin. Scales the image by given factors. * If the image does not fit with specified scale factors, it is clipped. - * + * * \param scr The screen to paint. * \param hscale Horizontal scale factor. * \param vscale Vertical scale factor. @@ -128,7 +128,7 @@ struct screen /** * \brief Get pointer into specified row. - * + * * \param row Number of row (must be less than height). */ uint32_t* rowptr(uint32_t row) throw(); @@ -180,9 +180,9 @@ struct screen /** * \brief Set the palette shifts. - * + * * Sets the palette shifts, converting the existing image. - * + * * \param rshift Shift for red component. * \param gshift Shift for green component. * \param bshift Shift for blue component. @@ -191,9 +191,9 @@ struct screen /** * \brief Return a color value. - * + * * Returns color value with specified (r,g,b) values (scale 0-255). - * + * * \param r Red component. * \param g Green component. * \param b Blue component. @@ -232,7 +232,7 @@ struct render_object /** * \brief Draw the object. - * + * * \param scr The screen to draw it on. */ virtual void operator()(struct screen& scr) throw() = 0; @@ -245,9 +245,9 @@ struct render_queue { /** * \brief Add object to render queue. - * + * * Adds new object to render queue. The object must be allocated by new. - * + * * \param obj The object to add * \throws std::bad_alloc Not enough memory. */ @@ -255,18 +255,18 @@ struct render_queue /** * \brief Apply all objects in order. - * + * * Applies all objects in the queue in order, freeing them in progress. - * + * * \param scr The screen to apply queue to. */ void run(struct screen& scr) throw(); /** * \brief Clear the queue. - * + * * Frees all objects in the queue. - * + * */ void clear() throw(); @@ -280,7 +280,7 @@ private: /** * \brief Read font data for glyph. - * + * * \param codepoint Code point of glyph. * \param x X position to render into. * \param y Y position to render into. @@ -295,7 +295,7 @@ std::pair find_glyph(uint32_t codepoint, int32_t x, int32_t y, /** * \brief Render text into screen. - * + * * \param _x The x position to render to (relative to origin). * \param _y The y position to render to (relative to origin). * \param _text The text to render. diff --git a/rom.cpp b/rom.cpp index e4ad7fe9..ee0c1add 100644 --- a/rom.cpp +++ b/rom.cpp @@ -720,7 +720,7 @@ namespace void load_index_file(const std::string& filename) throw(std::bad_alloc, std::runtime_error) { std::istream& s = open_file_relative(filename, ""); - + try { std::list partial_index; std::string line; diff --git a/rom.hpp b/rom.hpp index ac008ff1..d85a5eb8 100644 --- a/rom.hpp +++ b/rom.hpp @@ -412,7 +412,7 @@ std::vector save_core_state() throw(std::bad_alloc); * \brief Restore core state from buffer. * * Loads core state from buffer. - * + * * \param buf The buffer containing the state. * \throws std::runtime_error Loading state failed. */ @@ -420,9 +420,9 @@ void load_core_state(const std::vector& buf) throw(std::runtime_error); /** * \brief Read index file. - * + * * Read index of ROMs and add ROMs found to content-searchable storage. - * + * * \param filename The filename of index file. * \throws std::bad_alloc Not enough memory. * \throws std::runtime_error Loading index failed. @@ -431,9 +431,9 @@ void load_index_file(const std::string& filename) throw(std::bad_alloc, std::run /** * \brief Lookup absolute filename by hash. - * + * * Search all indices, looking for file with specified SHA-256 (specifying hash of "" results ""). - * + * * \param hash The hash of file. * \return Absolute filename. * \throws std::bad_alloc Not enough memory. diff --git a/rrdata.cpp b/rrdata.cpp index 91f9b46c..36de6921 100644 --- a/rrdata.cpp +++ b/rrdata.cpp @@ -35,7 +35,7 @@ bool rrdata::instance::operator<(const struct instance& i) const throw() for(unsigned j = 0; j < RRDATA_BYTES; j++) if(bytes[j] < i.bytes[j]) return true; - else if(bytes[j] > i.bytes[j]) + else if(bytes[j] > i.bytes[j]) return false; return false; } @@ -135,7 +135,7 @@ namespace char buf2[3]; unsigned bias; if(count == 1) { - opcode = 0x00; + opcode = 0x00; bias = 1; } else if(count < 258) { opcode = 0x20; diff --git a/rrdata.hpp b/rrdata.hpp index 87fc4078..c141d02e 100644 --- a/rrdata.hpp +++ b/rrdata.hpp @@ -17,7 +17,7 @@ public: bool operator==(const struct instance& i) const throw(); const struct instance operator++(int) throw(); const struct instance& operator++() throw(); - + }; static void read_base(const std::string& project) throw(std::bad_alloc); diff --git a/settings.cpp b/settings.cpp index b4509097..7eefa5b3 100644 --- a/settings.cpp +++ b/settings.cpp @@ -32,7 +32,7 @@ namespace "Set setting to a new value. Omit to set to ''\n"; } } set_setting; - + class unset_command : public command { public: @@ -78,7 +78,7 @@ namespace "Show value of setting\n"; } } get_setting; - + class shsettings_command : public command { public: diff --git a/settings.hpp b/settings.hpp index c8611c99..246f57dc 100644 --- a/settings.hpp +++ b/settings.hpp @@ -13,7 +13,7 @@ class setting public: /** * Create new setting. - * + * * parameter name: Name of the setting. * throws std::bad_alloc: Not enough memory. */ @@ -26,7 +26,7 @@ public: /** * Set the setting to special blank state. Not all settings can be blanked. - * + * * throws std::bad_alloc: Not enough memory. * throws std::runtime_error: Blanking this setting is not allowed (currently). */ @@ -34,7 +34,7 @@ public: /** * Look up setting and try to blank it. - * + * * parameter name: Name of setting to blank. * throws std::bad_alloc: Not enough memory. * throws std::runtime_error: Blanking this setting is not allowed (currently). Or setting does not exist. @@ -43,24 +43,24 @@ public: /** * Is this setting set (not blanked)? - * + * * returns: True if setting is not blanked, false if it is blanked. */ virtual bool is_set() throw() = 0; /** * Look up a setting and see if it is set (not blanked)? - * + * * parameter name: Name of setting to check. * returns: True if setting is not blanked, false if it is blanked. * throws std::bad_alloc: Not enough memory. * throws std::runtime_error: Setting does not exist. */ static bool is_set(const std::string& name) throw(std::bad_alloc, std::runtime_error); - + /** * Set value of setting. - * + * * parameter value: New value for setting. * throws std::bad_alloc: Not enough memory. * throws std::runtime_error: Setting the setting to this value is not allowed (currently). @@ -69,7 +69,7 @@ public: /** * Look up setting and set it. - * + * * parameter name: Name of the setting. * parameter value: New value for setting. * throws std::bad_alloc: Not enough memory. @@ -79,7 +79,7 @@ public: /** * Get the value of setting. - * + * * returns: The setting value. * throws std::bad_alloc: Not enough memory. */ @@ -87,7 +87,7 @@ public: /** * Look up setting an get value of it. - * + * * returns: The setting value. * throws std::bad_alloc: Not enough memory. * throws std::runtime_error: Setting does not exist. @@ -96,7 +96,7 @@ public: /** * Print all settings and values. - * + * * parameter win: The graphics system handle. * throws std::bad_alloc: Not enough memory. */ @@ -113,7 +113,7 @@ class numeric_setting : public setting public: /** * Create a new numeric setting. - * + * * parameter sname: Name of the setting. * parameter minv: Minimum value for the setting. * parameter maxv: Maximum value for the setting. @@ -131,7 +131,7 @@ public: bool is_set() throw(); /** * Set the value of setting. Accepts only numeric values. - * + * * parameter value: New value. * throws std::bad_alloc: Not enough memory. * throws std::runtime_error: Invalid value. @@ -139,14 +139,14 @@ public: void set(const std::string& value) throw(std::bad_alloc, std::runtime_error); /** * Gets the value of the setting. - * + * * returns: Value of setting as string. * throws std::bad_alloc: Not enough memory. */ std::string get() throw(std::bad_alloc); /** * Get the value of setting as numeric. - * + * * returns: Value of the setting as numeric. */ operator int32_t() throw(); @@ -164,7 +164,7 @@ class boolean_setting : public setting public: /** * Create a new boolean setting. - * + * * parameter sname: Name of the setting. * parameter dflt: Default (initial) value for the setting. * throws std::bad_alloc: Not enough memory. @@ -180,10 +180,10 @@ public: bool is_set() throw(); /** * Set the value of setting. - * + * * The following values are accepted as true: true, yes, on, 1, enable and enabled. * The following values are accepted as false: false, no, off, 0, disable and disabled. - * + * * parameter value: New value. * throws std::bad_alloc: Not enough memory. * throws std::runtime_error: Invalid value. @@ -191,14 +191,14 @@ public: void set(const std::string& value) throw(std::bad_alloc, std::runtime_error); /** * Gets the value of the setting. - * + * * returns: Value of setting as string. * throws std::bad_alloc: Not enough memory. */ std::string get() throw(std::bad_alloc); /** * Get the value of setting as boolean. - * + * * returns: Value of the setting as boolean. */ operator bool() throw(); diff --git a/window-sdl.cpp b/window-sdl.cpp index aab8294d..f0045fe3 100644 --- a/window-sdl.cpp +++ b/window-sdl.cpp @@ -494,7 +494,7 @@ namespace 0x082777777ULL, //From left. 0x844777777ULL //From up&left. }; - + void hat_transition(uint32_t& ov, uint32_t& v, bool& polarity, bool& more) { uint32_t t1 = transpack[ov]; @@ -568,7 +568,7 @@ keymapper_helper_sdl::translated_event keymapper_helper_sdl::translate_event(SDL k.device = SDL_DEV_JOYBUTTON; k.joybutton = static_cast(e.jbutton.which) * 256 + static_cast(e.jbutton.button); return translated_event(k, (e.type == SDL_JOYBUTTONDOWN)); - + } else if(e.type == SDL_KEYDOWN || e.type == SDL_KEYUP) { keysymbol k; k.device = SDL_DEV_KEYBOARD; @@ -929,7 +929,7 @@ namespace sampledup_inc = 64081; sampledup_mod = 2 * real_rate + 64081; } - + void audiocb(void* dummy, Uint8* stream, int len) { static uint16_t lprev = 32768; @@ -1198,7 +1198,7 @@ namespace ptr[i] = b ? bordercolor : 0; } } - + } } } @@ -1518,19 +1518,19 @@ window::window() SDL_AudioSpec* desired = new SDL_AudioSpec(); SDL_AudioSpec* obtained = new SDL_AudioSpec(); - + desired->freq = 44100; desired->format = AUDIO_S16SYS; desired->channels = 2; desired->samples = 8192; desired->callback = audiocb; desired->userdata = NULL; - + if(SDL_OpenAudio(desired, obtained) < 0) { message("Audio can't be initialized, audio playback disabled"); return; } - + //Fill the parameters. calculate_sampledup(obtained->freq); format = obtained->format; @@ -1587,7 +1587,7 @@ void window::message(const std::string& msg) throw(std::bad_alloc) system_log << forlog << std::endl; msg2 = msg2.substr(s + 1); } - + } if(locked_mode && messagebuffer_first_show + maxmessages < messagebuffer_next_seq) messagebuffer_first_show = messagebuffer_next_seq - maxmessages; @@ -1654,7 +1654,7 @@ void window::notify_screen_update(bool full) throw() if(console_mode) { draw_rectangle(reinterpret_cast(hwsurf->pixels), hwsurf->pitch, 2, 2, win_w - 2, win_h - 28, bordercolor, 2); - draw_rectangle(reinterpret_cast(hwsurf->pixels), hwsurf->pitch, 2, win_h - 26, + draw_rectangle(reinterpret_cast(hwsurf->pixels), hwsurf->pitch, 2, win_h - 26, win_w - 2, win_h - 2, bordercolor, 2); } else { draw_rectangle(reinterpret_cast(hwsurf->pixels), hwsurf->pitch, 2, 2, screen_w + 10, @@ -1680,7 +1680,7 @@ void window::notify_screen_update(bool full) throw() memset(reinterpret_cast(hwsurf->pixels) + i * hwsurf->pitch + 24, 0, 4 * screen_w); for(uint32_t i = 0; i < current_screen->height; i++) - memcpy(reinterpret_cast(hwsurf->pixels) + (i + 6) * hwsurf->pitch + 24, + memcpy(reinterpret_cast(hwsurf->pixels) + (i + 6) * hwsurf->pitch + 24, reinterpret_cast(current_screen->memory) + current_screen->pitch * i, 4 * current_screen->width); } else { @@ -2049,4 +2049,3 @@ void window::set_window_compensation(uint32_t xoffset, uint32_t yoffset, uint32_ vc_hscl = hscl; vc_vscl = vscl; } - diff --git a/window.hpp b/window.hpp index 8f78a456..587e8069 100644 --- a/window.hpp +++ b/window.hpp @@ -34,7 +34,7 @@ public: /** * Adds a messages to mesage queue to be shown. - * + * * parameter msg: The messages to add (split by '\n'). * throws std::bad_alloc: Not enough memory. */ @@ -42,9 +42,9 @@ public: /** * Get output stream printing into message queue. - * + * * Note that lines printed there should be terminated by '\n'. - * + * * returns: The output stream. * throws std::bad_alloc: Not enough memory. */ @@ -53,7 +53,7 @@ public: /** * Displays a modal message, not returning until the message is acknowledged. Keybindings are not available, but * should quit be generated somehow, modal message will be closed and command callback triggered. - * + * * parameter msg: The message to show. * parameter confirm: If true, ask for Ok/cancel type input. * returns: If confirm is true, true if ok was chosen, false if cancel was chosen. Otherwise always false. @@ -68,7 +68,7 @@ public: /** * Bind a key. - * + * * parameter mod: Set of modifiers. * parameter modmask: Modifier mask (set of modifiers). * parameter keyname: Name of key or pseudo-key. @@ -81,7 +81,7 @@ public: /** * Unbind a key. - * + * * parameter mod: Set of modifiers. * parameter modmask: Modifier mask (set of modifiers). * parameter keyname: Name of key or pseudo-key. @@ -93,7 +93,7 @@ public: /** * Dump bindings into this window. - * + * * throws std::bad_alloc: Not enough memory. */ void dumpbindings() throw(std::bad_alloc); @@ -101,42 +101,42 @@ public: /** * Processes inputs. If in non-modal mode (normal mode without pause), this returns quickly. Otherwise it waits * for modal mode to exit. - * + * * throws std::bad_alloc: Not enough memory. */ void poll_inputs() throw(std::bad_alloc); /** * Get emulator status area - * + * * returns: Emulator status area. */ std::map& get_emustatus() throw(); /** * Notify that the screen has been updated. - * + * * parameter full: Do full refresh if true. */ void notify_screen_update(bool full = false) throw(); /** * Set the screen to use as main surface. - * + * * parameter scr: The screen to use. */ void set_main_surface(screen& scr) throw(); /** * Enable/Disable pause mode. - * + * * parameter enable: Enable pause if true, disable otherwise. */ void paused(bool enable) throw(); /** * Wait specified number of milliseconds (polling for input). - * + * * parameter msec: Number of ms to wait. * throws std::bad_alloc: Not enough memory. */ @@ -149,14 +149,14 @@ public: /** * Enable or disable sound. - * + * * parameter enable: Enable sounds if true, otherwise disable sounds. */ void sound_enable(bool enable) throw(); /** * Input audio sample (at 32040.5Hz). - * + * * parameter left: Left sample. * parameter right: Right sample. */ @@ -165,11 +165,11 @@ public: /** * Set window main screen compensation parameters. This is used for mouse click reporting. - * + * * parameter xoffset: X coordinate of origin. * parameter yoffset: Y coordinate of origin. * parameter hscl: Horizontal scaling factor. - * parameter vscl: Vertical scaling factor. + * parameter vscl: Vertical scaling factor. */ void set_window_compensation(uint32_t xoffset, uint32_t yoffset, uint32_t hscl, uint32_t vscl); private: @@ -180,7 +180,7 @@ private: /** * Get number of msec since some undetermined epoch. - * + * * returns: The number of milliseconds. */ uint64_t get_ticks_msec() throw(); diff --git a/zip.hpp b/zip.hpp index 2419d673..3ec5ad9f 100644 --- a/zip.hpp +++ b/zip.hpp @@ -45,7 +45,7 @@ public: /** * Get name of current member. - * + * * returns: Name of member. * throws std::bad_alloc: Not enough memory. */ @@ -56,7 +56,7 @@ public: /** * Get name of current member. - * + * * returns: Name of member. * throws std::bad_alloc: Not enough memory. */ @@ -67,7 +67,7 @@ public: /** * Are these two iterators the same? - * + * * parameter i: The another iterator * returns: True if iterators are the same, false otherwise. */ @@ -78,7 +78,7 @@ public: /** * Are these two iterators diffrent? - * + * * paramer i: The another iterator * returns: True if iterators are diffrent, false otherwise. */ @@ -89,7 +89,7 @@ public: /** * Advance iterator one step. - * + * * returns: The old value of iterator. * throws std::bad_alloc: Not enough memory. */ @@ -102,7 +102,7 @@ public: /** * Regress iterator one step. - * + * * returns: The old value of iterator. * throws std::bad_alloc: Not enough memory. */ @@ -115,7 +115,7 @@ public: /** * Advance iterator one step. - * + * * returns: Reference to this iterator. */ iterator_class& operator++() throw() @@ -126,7 +126,7 @@ public: /** * Regress iterator one step. - * + * * returns: Reference to this iterator. */ iterator_class& operator--() throw() @@ -151,7 +151,7 @@ public: /** * Opens specified ZIP archive for reading. - * + * * parameter zipfile: The name of ZIP file to open. * throws std::bad_alloc: Not enough memory. * throws std::runtime_error: Can't open the ZIP file. @@ -182,7 +182,7 @@ public: /** * Starting iterator - * + * * returns: The iterator pointing to first name. * throws std::bad_alloc: Not enough memory. */ @@ -190,7 +190,7 @@ public: /** * Ending iterator (one past the end). - * + * * returns: The iterator pointing to one past the last name. * throws std::bad_alloc: Not enough memory. */ @@ -198,7 +198,7 @@ public: /** * Starting reverse iterator - * + * * returns: The iterator pointing to last name and acting in reverse. * throws std::bad_alloc: Not enough memory. */ @@ -213,7 +213,7 @@ public: /** * Check if member with specified name exists. - * + * * parameter name: The name of the member to check * returns: True if specified member exists, false otherwise. */ @@ -268,7 +268,7 @@ std::vector read_file_relative(const std::string& name, const std::string& /** * Resolves the final file path that open_file_relative/read_file_relative would open. - * + * * parameter name: As in open_file_relative * parameter referencing_path: As in open_file_relative * returns: The file absolute path. -- 2.11.4.GIT