Commit Graph

126 Commits

Author SHA1 Message Date
Oliver Stöneberg
1d43f59955 fixed some Coverity "Identical code for different branches" warnings (#3094)
* tools/imgtool/filtbas.cpp: fixed Coverity "Identical code for different branches" warning (nw)

* mame/video/decbac.cpp: fixed Coverity "Identical code for different branches" warnings (nw)

* Revert "mame/video/decbac.cpp: fixed Coverity "Identical code for different branches" warnings (nw)"

This reverts commit bdc1761996b8ead3ee7b0233a41ad0eff6f58311.
2018-01-26 22:33:08 +11:00
Oliver Stöneberg
4e64f95721 Fixes for Coverity "Resource leak" warnings (#3089)
* lib/util/chdcd.cpp: fixed Coverity "Resource Leak" warning (nw)

* src/lib/util/chdcd.cpp: fixed more Coverity "Resource Leak" warnings (nw)

* tools/imgtool/modules/mac.cpp: fixed Coverity "Resource Leak" warnings (nw)

* devices/bus/ti99/gromport/cartridges.cpp: fixed Coverity "Resource Leak" warning (nw)
2018-01-21 15:24:51 +11:00
firewave
25e985e6f7 tools/imgtool/modules/fat.cpp: fixed Coverity "Double Free" warning (nw) 2018-01-20 03:36:07 +01:00
Vas Crabb
4c29419cab srcclean (nw) 2017-10-22 12:34:30 +11:00
npwoods
86f50b0d65 Created a more flexible imgtool::datetime structure for use within Imgtool (#2263)
* Created a more flexible imgtool::datetime structure for use within Imgtool

This is intended to replace most usage of time_t

* Changing the granularity of imgtool_clock from 1ms to 100ns, as per Vas' suggestion

* Created arbitrary_datetime in timeconv.h to facilitate interpretation of datetime info

I concluded that invoking std::mktime on manually assembled std::tm is bad, because it is indeterminate how the std::tm members may be "dominant".  This required that I go further in imgtool, and update a number of drivers and eliminate the parameter of imgtool::datetime that takes std::tm.
2017-10-17 21:18:57 +02:00
fulivi
70d6a5addd Support for HP85 tapes added to imgtool (#2688) 2017-10-03 23:14:15 +11:00
smf-
bcb4be3a5d fix for clang 5 unused lambda capture errors (nw) 2017-09-24 17:49:35 +01:00
npwoods
3d553eda60 Attempted to sanitize/rationalize how we access UTF-8 command line arguments (#2532)
Specifically, this creates a call osd_get_command_line() that returns UTF-8 command line arguments as std::vector<std::string>.  On non-Windows platforms, this does nothing more than build the vector.  On Windows, this invokes GetCommandLineW() and CommandLineToArgvW().  This also attempts to unwind usage of wmain()/_tmain() on Windows, which is not standard.

Related to this, this fixes a bug in Imgtool; specifically, non-7 bit ASCII was not being handled correctly in Windows.

This is really an admission that the way that Windows handles Unicode and command line arguments sucks, and it is my belief that having a wmain() or _tmain() declaration specific for Windows is a worse solution.  C'est la vie.

I'm very open to the idea that src/osd/osdcore.[cpp|h] is not the best place to do this.  Let me know if I should move it.
2017-09-18 20:28:53 -04:00
Vas Crabb
ec3caa98bd srcclean (nw) 2017-08-27 11:07:21 +10:00
fulivi
5f7e815d33 imgtool: hopefully fixed the "GET" command 2017-08-24 14:36:19 +02:00
fulivi
2c317e49e2 hp9845: re-factored hp9845_tape module of imgtool to use HTI format 2017-08-16 10:38:22 +02:00
R. Belmont
dc00f6a8b3 Merge pull request #2540 from npwoods/imgtool_feature_supports_geticoninfo
Imgtool:  Fixed features.supports_geticoninfo
2017-08-05 21:01:40 -04:00
Nathan Woods
cd31078ddd Imgtool: Classic Mac: Made the logic for B&W icon able to handled non-masked set pixels 2017-08-02 13:16:15 -04:00
Nathan Woods
6c381dbd23 Imgtool: Fixed features.supports_geticoninfo 2017-08-02 13:02:49 -04:00
Nathan Woods
7e8707f496 [Imgtool] C++-ification of imgtool_forkent structure 2017-08-02 01:07:47 +10:00
Nathan Woods
cc544e98c4 Imgtool: Removed silly intermediate 'const char *' (nw) 2017-07-31 08:32:09 +10:00
Nathan Woods
6b76e4ad57 Imgtool: Vas Feedback: Changed another charconverter access (nw) 2017-07-30 21:59:33 +10:00
Nathan Woods
c04cc60702 Imgtool: Eliminated Imgtool-specific rand() function 2017-07-30 21:58:58 +10:00
npwoods
aca90520de Imgtool: Merged normalize_filename() into cannonicalize_path(), C++-ification (#2527) 2017-07-30 15:16:45 +10:00
Nathan Woods
a2a3d6b90b Imgtool: Proper cleanup of floppy object after create/open failure 2017-07-24 08:18:38 -04:00
Nathan Woods
474f7ffd04 Imgtool: Changed a pointer to a reference, and fixed a std::string(nullptr) bug 2017-07-24 17:03:07 +10:00
Vas Crabb
e892661905 srcclean (nw) 2017-05-28 13:40:48 +10:00
npwoods
19821fa25a [Imgtool] Fix to MT#6576 (#2275)
* [Imgtool] Fixed issue with 'listfilters' command

* [Imgtool] Extremely basic fix to the Imgtool <==> CHD HD bridge

This really needs _much_ more work
2017-05-04 11:22:14 +10:00
Nathan Woods
f4fbe39329 [Imgtool] Cleanups to validity code, and transitioned to std::wcerr
Windows doesn't like mixing std::wc[out|err] and printf()
2017-04-30 20:05:34 +10:00
npwoods
f809f0e08d Introduced an 'util::arbitrary_clock' template class, to represent a clock that "knows" when the epoch starts (#2010)
* Introduced an 'util::arbitrary_clock' template class, to represent a clock that "knows" when the epoch starts

Also:
  - Converted the NTFS filetime code to use util::arbitrary_clock
  - Converted the Mac datetime code to use util::atribrary_clock

This is in preparation for a bigger change to Imgtool where I eliminate usage of time_t
2017-04-06 11:39:00 +10:00
Peter Bortas
8b71603f23 Fix CID 157540: "Missing comma" resulting in unintentional string concatenation 2017-03-27 23:53:04 +02:00
Nathan Woods
7744309f64 [Imgtool] Fixed recently introduced bug in the code that emits usage text 2017-01-23 07:41:21 +11:00
Vas Crabb
edf64df1db srcclean (nw) 2017-01-22 15:37:37 +11:00
R. Belmont
063ea0512c Merge pull request #1979 from npwoods/imgtool_fix_attr_listing
[Imgtool] Fixed recently introduce bug on attribute listings
2017-01-15 15:02:47 -05:00
Nathan Woods
6a85ec0985 [Imgtool] Fixed recently introduce bug on attribute listings 2017-01-15 11:46:25 -05:00
Nathan Woods
1540cd5e7a [CoCo] Fixed a recently introduced bug in DMK image creation
Also some minor cleanups
2017-01-15 11:29:17 -05:00
Nathan Woods
acdefe2ecc [Imgtool Mac] Adding support for MacRoman encoding 2017-01-14 11:45:10 -05:00
Vas Crabb
19529fe768 Merge pull request #1868 from npwoods/imgtool_charconv_rewrite
[Imgtool] Rewrote charconv; now an interface rather than an enumeration
2017-01-15 03:10:59 +11:00
Nathan Woods
b2c87ba47d Restyled some imgtoolerr_t typecasts 2017-01-14 10:57:05 -05:00
Nathan Woods
36033a2f98 Spacing fix 2017-01-14 10:56:57 -05:00
Nathan Woods
e38b9b63ba [Imgtool] Changing imgtool::simple_charconverter::from_utf8() to not perform an O(n) lookup whenever locating a character 2017-01-05 21:02:45 -05:00
Nathan Woods
a1cf492ff4 Missed these, which needed wstring_from_utf8() 2017-01-04 18:59:06 -05:00
Nathan Woods
89b2f05c0d Fixed incorrect util::string_format() ==> util::stream_format() 2017-01-04 18:48:38 -05:00
Nathan Woods
b1eed07ad9 Vas Crabb feedback:
1.  Changed the Win32 code to use _O_U8TEXT()
2.  Reordered system #includes
3.  Changed a number of 'std::wcout << ...' to use util::stream_format()

I'm getting massive code compilation issues, and it isn't clear to me what the problem is.  I'm committing my WIP right now, with the intention of reviewing the specifics soon.
2017-01-04 08:06:20 -05:00
Nathan Woods
46ddd46f25 Vas Crabb feedback: Fixed Latin-1 C1 space, changed charconverter prototype to not dictate std::string and fixed invalid encoding issue 2017-01-04 06:48:57 -05:00
Nathan Woods
3231c3f648 [Imgtool] Changed to use wcout/wcerr in order to support Unicode console output
I really don't like the prevalence of '#ifdef WIN32' in this change, both the _setmode() and bypassing codecvt.  I strongly suspect that the latter is the consequence of some mistake that in practice doesn't cause problems in MSVC.  I welcome all eyes.
2017-01-02 11:59:25 -05:00
Nathan Woods
34048b54f6 Updated to support Unicode normalization and simple charconverters that alter the low page 2017-01-01 12:09:38 -05:00
Nathan Woods
2679c0f553 Merge branch 'master' into imgtool_charconv_rewrite 2017-01-01 10:09:31 -05:00
Nathan Woods
1cd5935dde [Imgtool CoCo/RS-DOS] Miscellaneous cleanups and C++ modernization 2016-12-24 13:45:03 -05:00
Nathan Woods
594d959f09 [Imgtool] Rewrote charconv; now an interface rather than an enumeration 2016-12-23 09:44:09 -05:00
R. Belmont
2461b39eb7 Merge pull request #1830 from npwoods/imgtool_dir_formatting_fix
[Imgtool] Cleaned up the output of the 'dir' command
2016-12-13 10:38:12 -05:00
Nathan Woods
1b462f7434 [Imgtool] Cleaned up the output of the 'dir' command 2016-12-12 20:29:22 -05:00
Nathan Woods
a68a72a7f7 [Imgtool] Fixed a recently introduced error in the 'dir' command line command 2016-12-12 20:16:36 -05:00
Vas Crabb
1ab17ad21e Merge pull request #1827 from npwoods/remove_strncatz
[Imgtool] Removed dead strncatz() function
2016-12-12 16:36:36 +11:00
Nathan Woods
02056c04b1 [Imgtool] Removed dead strncatz() function 2016-12-11 15:39:25 -05:00