summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/hash.cpp
Commit message (Collapse)AuthorAgeFilesLines
* util/ioprocs.cpp: Added wrappers for common patterns. (#11608) Vas Crabb2024-02-251-3/+2
| | | | | emu/diimage.h: Removed fread overloads that allocate memory for output. util/core_file.cpp: Changed output size of load to size_t.
* Allow loading PNG/JPEG/MS DIB bitmaps from Lua, and cleanup. Vas Crabb2023-04-131-12/+13
| | | | | | | | | | | Use VirtualAlloc rather than VirtualProtect on Windows to change page protection, as the latter can cause severe performance issues with some antivirus software. Added noexcept to lots of hash- and bitmap-related things, and added a little more error checking. Yes, I realise it will abort if an allocation fails while printing a log message, but if you get to that point, you're probably screwed already.
* File handling cleanup AJR2022-04-191-68/+92
| | | | | | | | | | - Remove fgetc, fgets and ptr methods from device_image_interface. - Remove the core_file::buffer method to read an entire file into memory and rewrite emu_file::hashes to not depend on it. - Make core_in_memory_file a final class; now that buffering is gone, core_osd_file no longer subclasses it but a new superclass that retains some common methods. - Rename the offset and length methods used internally in core_file implementations to index and size due to frequent clashes with parameter names. - Convert comments in util/corefile.cpp to C++ style. - Add a new overload of the hash_collection::compute method which hashes data from a random_read stream, reading it into memory one chunk at a time. As a result, the hash_collection::begin and hash_collection::end methods have been removed as obsolete (similar methods are now used internally only). - Enhance error messages for the frontend media identifier when it encounters file errors.
* Much more core std::string_view modernization AJR2021-01-201-4/+12
| | | | | | | | | | | | | | | - Remove corestr.h from emu.h; update a few source files to not use it at all - Change strtrimspace, strtrimrightspace and core_filename_extract_* to be pure functions taking a std::string_view by value and returning the same type - Change strmakeupper and strmakelower to be pure functions taking a std::string_view and constructing a std::string - Remove the string-modifying version of zippath_parent - Change tag-based lookup functions in device_t to take std::string_view instead of const std::string & or const char * - Remove the subdevice tag cache from device_t (since device finders are now recommended) and replace it with a map covering directly owned subdevices only - Move the working directory setup method out of device_image_interface (only the UI seems to actually use the full version of this) - Change output_manager to use std::string_view for output name arguments - Change core_options to accept std::string_view for most name and value arguments (return values are still C strings for now) - Change miscellaneous other functions to accept std::string_view arguments - Remove a few string accessor macros from romload.h - Remove many unnecessary c_str() calls from logging/error messages
* Low-level #include overhaul AJR2021-01-021-1/+2
| | | | | | | - vecstream.h: Revert changes made in aa29519528cb3dbdbfac56819bea670ed8c56c5d. The std::string_view conversion has been made a non-member function (util::buf_to_string_view) and moved to coretmpl.h. - strformat.h: Remove the using declaration importing util::string_format into the global namespace. It has been moved to emucore.h and a few tool sources; other references have been qualified. - osdcore.h: Split out file, directory and path classes and methods to a new header (osdfile.h), Doxygenizing the documentation comments. - Disaggregate many #includes that were including other standard or custom headers. emu.h now includes basically the same things that it did, but other headers have been streamlined; for instance, emucore.h no longer stealth-includes osdcore.h several ways.
* hash.cpp, hashing.cpp: Change string processing to use std::string_view ↵ AJR2021-01-011-15/+10
| | | | parameters; add sum16 type
* Remove some deprecated instantiations of static constexpr members (MSVC ↵ Vas Crabb2020-11-151-6/+2
| | | | complains about them now)
* use C++ library includes (nw) firewave2020-01-221-1/+1
|
* (nw) Fix inadvertently non-const pointers - emu.h edition Vas Crabb2018-09-201-7/+7
| | | | | | | | | | | | | | | | This fixes all the non-const pointers with static lifetime I could find with a cheap grep (in combination with the last commit). There are likely more lurking that I didn't find, and things that aren't pointers that should be made const. There are still a few mutable static pointers that break the ability to host multiple drivers but these require refactoring to fix: src/devices/sound/sidvoice.cpp:static const uint8_t* waveform30; src/devices/sound/sidvoice.cpp:static const uint8_t* waveform50; src/devices/sound/sidvoice.cpp:static const uint8_t* waveform60; src/devices/sound/sidvoice.cpp:static const uint8_t* waveform70; src/mame/drivers/pockstat.cpp: static const char *gme_id = "123-456-STD"; src/mame/machine/namco51.cpp: static const game_driver *namcoio_51XX_driver = nullptr;
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-1/+1
| | | | | Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8 also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
* Adding an assert() Nathan Woods2016-07-271-0/+2
|
* Moved src/emu/hash.[cpp|h] into src/lib/util, and namespaced that code (and ↵ Nathan Woods2016-07-231-0/+423
hashing.[cpp|h]) into util::