diff options
author | 2021-02-14 11:05:57 -0500 | |
---|---|---|
committer | 2021-02-14 11:05:57 -0500 | |
commit | bc0146c2038c46f789a246d5616afd7c425157f3 (patch) | |
tree | b4d39194034b4c6e56ccd4035d25636034be43ca /src/tools/imgtool/modules/fat.cpp | |
parent | 91310bcdeb7ab0ff661738b212017bf836f4e8ad (diff) |
Eliminate ARRAY_LENGTH template in favor of C++17's std::size
* osdcomm.h: Move definition of EQUIVALENT_ARRAY to coretmpl.h
* sharc.cpp, gt64xxx.cpp, ym2413.cpp, gb_lcd.cpp, snes_ppu.cpp: Use STRUCT_MEMBER for save state registration
* gio/newport.cpp, megadrive/svp.cpp, nes_ctrl/bcbattle.cpp, arm7.cpp, tms9995.cpp, pckeybrd.cpp, sa1110.cpp, sa1111.cpp, jangou_blitter.cpp, vic4567.cpp: Use std::fill(_n) instead of memset
* emucore.h: Remove obsolete typedef
Diffstat (limited to 'src/tools/imgtool/modules/fat.cpp')
-rw-r--r-- | src/tools/imgtool/modules/fat.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tools/imgtool/modules/fat.cpp b/src/tools/imgtool/modules/fat.cpp index 68110275e07..dba4b7cc03e 100644 --- a/src/tools/imgtool/modules/fat.cpp +++ b/src/tools/imgtool/modules/fat.cpp @@ -1326,11 +1326,11 @@ static imgtoolerr_t fat_read_dirent(imgtool::partition &partition, fat_file *fil lfn_checksum = entry[13]; } lfn_lastentry = entry[0] & 0x3F; - prepend_lfn_bytes(lfn_buf, ARRAY_LENGTH(lfn_buf), + prepend_lfn_bytes(lfn_buf, std::size(lfn_buf), &lfn_len, entry, 28, 2); - prepend_lfn_bytes(lfn_buf, ARRAY_LENGTH(lfn_buf), + prepend_lfn_bytes(lfn_buf, std::size(lfn_buf), &lfn_len, entry, 14, 6); - prepend_lfn_bytes(lfn_buf, ARRAY_LENGTH(lfn_buf), + prepend_lfn_bytes(lfn_buf, std::size(lfn_buf), &lfn_len, entry, 1, 5); } else if (freeent && (freeent->position == ~0)) @@ -1372,8 +1372,8 @@ static imgtoolerr_t fat_read_dirent(imgtool::partition &partition, fat_file *fil j = 0; do { - i += uchar_from_utf16(&ch, &lfn_buf[i], ARRAY_LENGTH(lfn_buf) - i); - j += utf8_from_uchar(&ent.long_filename[j], ARRAY_LENGTH(ent.long_filename) - j, ch); + i += uchar_from_utf16(&ch, &lfn_buf[i], std::size(lfn_buf) - i); + j += utf8_from_uchar(&ent.long_filename[j], std::size(ent.long_filename) - j, ch); } while(ch != 0); } @@ -1834,7 +1834,7 @@ static imgtoolerr_t fat_partition_nextenum(imgtool::directory &enumeration, imgt return err; /* copy stuff from the FAT dirent to the Imgtool dirent */ - snprintf(ent.filename, ARRAY_LENGTH(ent.filename), "%s", fatent.long_filename[0] + snprintf(ent.filename, std::size(ent.filename), "%s", fatent.long_filename[0] ? fatent.long_filename : fatent.short_filename); ent.filesize = fatent.filesize; ent.directory = fatent.directory; |