Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upBuild under MSVC 14 #10714
Conversation
bkentel
added some commits
Jan 2, 2015
BevapDin
reviewed
Jan 2, 2015
| current->tm_hour | ||
| , current->tm_min | ||
| , current->tm_sec | ||
| , static_cast<int>(tv.tv_usec / 1000 + 0.5) |
This comment has been minimized.
This comment has been minimized.
BevapDin
Jan 2, 2015
Contributor
Are you sure, this works as you intended it?
tv_usec is probably some kind an integer (not a floating point value), tv.tv_usec / 1000 is an integer as well (the division discards the remainder). tv.tv_usec / 1000 + 0.5 is now a proper floating point value, but is immediately converted back to an integer, losing the 0.5. In other words: the static_cast is always applied to something with .5 as fractional part.
This comment has been minimized.
This comment has been minimized.
bkentel
Jan 3, 2015
Author
Contributor
I took the code as written -- looking at it again, it's a bit odd isn't it;
static_cast<int>(tv.tv_usec / 1000.0 + 0.5);
would be more sane I'll change it.
bkentel
added some commits
Jan 3, 2015
This comment has been minimized.
This comment has been minimized.
|
Updating the project files should be finished now with 696dc99. |
This comment has been minimized.
This comment has been minimized.
|
MSVC 14 still has problems with initializer lists in some places -- this should be a portable fix. |
bkentel
added some commits
Jan 3, 2015
This comment has been minimized.
This comment has been minimized.
|
Stuck in airports all day today and tomorrow, with luck I can look at this |
This comment has been minimized.
This comment has been minimized.
|
Ugh. Hoping the airports are comfy at least. |
kevingranade
reviewed
Jan 4, 2015
| @@ -663,6 +663,10 @@ void load_colors(JsonObject &jsobj) | |||
| #define ccolor(s) consolecolors[s][0],consolecolors[s][1],consolecolors[s][2] | |||
| int curses_start_color(void) | |||
| { | |||
| //TODO: this function strikes terror into my very soul... | |||
This comment has been minimized.
This comment has been minimized.
kevingranade
Jan 4, 2015
Member
Snarky comments about the function are not a valid comment, please remove.
kevingranade
reviewed
Jan 4, 2015
| }; | ||
|
|
||
| #ifdef _MSC_VER | ||
| inline time_info get_time() noexcept { |
This comment has been minimized.
This comment has been minimized.
kevingranade
Jan 4, 2015
Member
Avoid inline, the compiler has more information than you do to make that decision. Also if it's not used elsewhere, please declare it static.
This comment has been minimized.
This comment has been minimized.
bkentel
Jan 4, 2015
Author
Contributor
fair enough -- is that general policy when it isn't critical to force inline i.e. with __attribute__((always_inline))?
kevingranade
reviewed
Jan 4, 2015
| @@ -0,0 +1,103 @@ | |||
| #pragma once | |||
This comment has been minimized.
This comment has been minimized.
kevingranade
Jan 4, 2015
Member
Normally I don't care what you're doing in the visual studio project file directory, but what the hell is this? Why does visual studio need to shotgun include what looks like half or more of the standard library?
This comment has been minimized.
This comment has been minimized.
bkentel
Jan 4, 2015
Author
Contributor
precompiled headers; only (simple) way to improve build speed with MSVC.
regardless, this header is only pulled in by the MSVC build and lives outside src/ (inside msvc140/).
bkentel commentedJan 2, 2015
Various (incomplete) changes that allow MSVC to build the non-localized SDL tiles version.