diff options
Diffstat (limited to 'src/tools/chdman.c')
-rw-r--r-- | src/tools/chdman.c | 136 |
1 files changed, 68 insertions, 68 deletions
diff --git a/src/tools/chdman.c b/src/tools/chdman.c index c253c73b483..6978f191978 100644 --- a/src/tools/chdman.c +++ b/src/tools/chdman.c @@ -325,7 +325,7 @@ public: if (m_file != NULL) core_fclose(m_file); m_lastfile = m_info.track[tracknum].fname; - file_error filerr = core_fopen(m_lastfile, OPEN_FLAG_READ, &m_file); + file_error filerr = core_fopen(m_lastfile.c_str(), OPEN_FLAG_READ, &m_file); if (filerr != FILERR_NONE) report_error(1, "Error opening input file (%s)'", m_lastfile.c_str()); } @@ -826,7 +826,7 @@ const char *big_int_string(astring &string, UINT64 intvalue) { // 0 is a special case if (intvalue == 0) - return string.cpy("0"); + return string.cpy("0").c_str(); // loop until all chunks are done string.reset(); @@ -840,11 +840,11 @@ const char *big_int_string(astring &string, UINT64 intvalue) insert.format((intvalue != 0) ? "%03d" : "%d", chunk); if (!first) - string.ins(0, ","); + string.ins(0, ",").c_str(); first = false; string.ins(0, insert); } - return string; + return string.c_str(); } @@ -855,7 +855,7 @@ const char *big_int_string(astring &string, UINT64 intvalue) const char *msf_string_from_frames(astring &string, UINT32 frames) { - return string.format("%02d:%02d:%02d", frames / (75 * 60), (frames / 75) % 60, frames % 75); + return string.format("%02d:%02d:%02d", frames / (75 * 60), (frames / 75) % 60, frames % 75).c_str(); } @@ -899,7 +899,7 @@ UINT64 parse_number(const char *string) static void guess_chs(astring *filename, UINT64 filesize, int sectorsize, UINT32 &cylinders, UINT32 &heads, UINT32 §ors, UINT32 &bps) { // if this is a direct physical drive read, handle it specially - if (filename != NULL && osd_get_physical_drive_geometry(*filename, &cylinders, &heads, §ors, &bps)) + if (filename != NULL && osd_get_physical_drive_geometry(filename->c_str(), &cylinders, &heads, §ors, &bps)) return; // if we have no length to work with, we can't guess @@ -938,7 +938,7 @@ static void parse_input_chd_parameters(const parameters_t ¶ms, chd_file &inp astring *input_chd_parent_str = params.find(OPTION_INPUT_PARENT); if (input_chd_parent_str != NULL) { - chd_error err = input_parent_chd.open(*input_chd_parent_str); + chd_error err = input_parent_chd.open(input_chd_parent_str->c_str()); if (err != CHDERR_NONE) report_error(1, "Error opening parent CHD file (%s): %s", input_chd_parent_str->c_str(), chd_file::error_string(err)); } @@ -947,7 +947,7 @@ static void parse_input_chd_parameters(const parameters_t ¶ms, chd_file &inp astring *input_chd_str = params.find(OPTION_INPUT); if (input_chd_str != NULL) { - chd_error err = input_chd.open(*input_chd_str, writeable, input_parent_chd.opened() ? &input_parent_chd : NULL); + chd_error err = input_chd.open(input_chd_str->c_str(), writeable, input_parent_chd.opened() ? &input_parent_chd : NULL); if (err != CHDERR_NONE) report_error(1, "Error opening CHD file (%s): %s", input_chd_str->c_str(), chd_file::error_string(err)); } @@ -970,11 +970,11 @@ static void parse_input_start_end(const parameters_t ¶ms, UINT64 logical_siz astring *input_start_hunk_str = params.find(OPTION_INPUT_START_HUNK); astring *input_start_frame_str = params.find(OPTION_INPUT_START_FRAME); if (input_start_byte_str != NULL) - input_start = parse_number(*input_start_byte_str); + input_start = parse_number(input_start_byte_str->c_str()); if (input_start_hunk_str != NULL) - input_start = parse_number(*input_start_hunk_str) * hunkbytes; + input_start = parse_number(input_start_hunk_str->c_str()) * hunkbytes; if (input_start_frame_str != NULL) - input_start = parse_number(*input_start_frame_str) * framebytes; + input_start = parse_number(input_start_frame_str->c_str()) * framebytes; if (input_start >= input_end) report_error(1, "Input start offset greater than input file size"); @@ -984,11 +984,11 @@ static void parse_input_start_end(const parameters_t ¶ms, UINT64 logical_siz astring *input_length_frames_str = params.find(OPTION_INPUT_LENGTH_FRAMES); UINT64 input_length = input_end; if (input_length_bytes_str != NULL) - input_length = parse_number(*input_length_bytes_str); + input_length = parse_number(input_length_bytes_str->c_str()); if (input_length_hunks_str != NULL) - input_length = parse_number(*input_length_hunks_str) * hunkbytes; + input_length = parse_number(input_length_hunks_str->c_str()) * hunkbytes; if (input_length_frames_str != NULL) - input_length = parse_number(*input_length_frames_str) * framebytes; + input_length = parse_number(input_length_frames_str->c_str()) * framebytes; if (input_start + input_length < input_end) input_end = input_start + input_length; } @@ -1026,7 +1026,7 @@ static astring *parse_output_chd_parameters(const parameters_t ¶ms, chd_file astring *output_chd_parent_str = params.find(OPTION_OUTPUT_PARENT); if (output_chd_parent_str != NULL) { - chd_error err = output_parent_chd.open(*output_chd_parent_str); + chd_error err = output_parent_chd.open(output_chd_parent_str->c_str()); if (err != CHDERR_NONE) report_error(1, "Error opening parent CHD file (%s): %s", output_chd_parent_str->c_str(), chd_file::error_string(err)); } @@ -1034,7 +1034,7 @@ static astring *parse_output_chd_parameters(const parameters_t ¶ms, chd_file // process output file astring *output_chd_str = params.find(OPTION_OUTPUT); if (output_chd_str != NULL) - check_existing_output_file(params, *output_chd_str); + check_existing_output_file(params, output_chd_str->c_str()); return output_chd_str; } @@ -1049,7 +1049,7 @@ static void parse_hunk_size(const parameters_t ¶ms, UINT32 required_granular astring *hunk_size_str = params.find(OPTION_HUNK_SIZE); if (hunk_size_str != NULL) { - hunk_size = parse_number(*hunk_size_str); + hunk_size = parse_number(hunk_size_str->c_str()); if (hunk_size < 16 || hunk_size > 1024 * 1024) report_error(1, "Invalid hunk size"); if (hunk_size % required_granularity != 0) @@ -1110,7 +1110,7 @@ static void parse_numprocessors(const parameters_t ¶ms) if (numprocessors_str == NULL) return; - int count = atoi(*numprocessors_str); + int count = atoi(numprocessors_str->c_str()); if (count > 0) { extern int osd_num_processors; @@ -1129,7 +1129,7 @@ static const char *compressio |