Skip to content

Commit

Permalink
Visual Studio 2019 supports printf %z for size_t
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Nov 17, 2019
1 parent 5f2ce86 commit 14775f2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
4 changes: 0 additions & 4 deletions src/main-window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -835,11 +835,7 @@ void Main_Window::update_status(Block *b) {
}
char buffer[64] = {};
if (!b) {
#ifdef __GNUC__
sprintf(buffer, "Blocks: %zu", _metatileset.size());
#else
sprintf(buffer, "Blocks: %u", (uint32_t)_metatileset.size());
#endif
_metatile_count->copy_label(buffer);
sprintf(buffer, "Map: %u x %u", _map.width(), _map.height());
_map_dimensions->copy_label(buffer);
Expand Down
8 changes: 0 additions & 8 deletions src/option-dialogs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,7 @@ bool Map_Options_Dialog::guess_map_size(const char *filename, const char *direct
_map_header->copy_label(buffer);

size_t fs = file_size(filename);
#ifdef __GNUC__
sprintf(buffer, "(%zu B)", fs);
#else
sprintf(buffer, "(%u B)", (uint32_t)fs);
#endif
_map_size->copy_label(buffer);
add_valid_sizes(fs);

Expand Down Expand Up @@ -861,11 +857,7 @@ void Event_Options_Dialog::use_event(const Event *e) {
#endif
_macro_heading->copy_label(buffer);

#ifdef __GNUC__
sprintf(buffer, "Line: %zu", e->_line);
#else
sprintf(buffer, "Line: %u", (uint32_t)e->_line);
#endif
_line_heading->copy_label(buffer);

_prefix->value(e->_prefix.c_str());
Expand Down

0 comments on commit 14775f2

Please sign in to comment.