-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PlatformDefs.h: remove DWORD define #17369
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To have them in C++11 style is fine, only was by your sed
some another places where contains DWORD
(e.g. DWORD64, DWORD_SIZE or own defines) changed.
Also I'm not complete sure, if on calls to Windows it is always OK, if they have DWORD as function value?
Further are there also places with e.g. BYTE
in same line, then it look a bit mixed.
#ifndef LODWORD | ||
#define LODWORD(longval) ((DWORD)((DWORDLONG)(longval))) | ||
#ifndef LOuint32_t | ||
#define LOuint32_t(longval) ((uint32_t)((uint32_tLONG)(longval))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this DWORDLONG
not a uint64_t
and the the LODWORD not only uint32_t
(the counterpart HIDWORD
is not used)? Maybe better to leave the define or to change the using code places?
Was confused 😄 and also not found something on web about LOuint32_t
or uint32_tLONG
@@ -265,7 +273,7 @@ void DXT4toARGB(const void *src, void *dest, unsigned int destWidth) | |||
// and assign them to our texture | |||
for (int y = 0; y < 4; y++) | |||
{ | |||
DWORD *d = (DWORD *)dest + destWidth * y; | |||
uint32_t* d = (uint32_t*)dest + destWidth * y; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense here (in separate commit) set it to uint32_t* d = reinterpret_cast<uint32_t*>(dest + destWidth * y);
, here and on other places?
Not directly in the sense of the request, only heard frequently that on change it should then change to C++ style also.
ping @Rechi
@@ -213,7 +214,7 @@ ssize_t CWin32File::Read(void* lpBuf, size_t uiBufSize) | |||
// number of bytes than requested, just return number of read bytes (work as | |||
// transparent wrapper for ReadFile() ). | |||
// If ReadFile() can't read any more bytes than don't try to fill buffer. | |||
if (uiBufSize <= DWORD_MAX || lastRead == 0) | |||
if (uiBufSize <= uint32_t_MAX || lastRead == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The uint32_t_MAX
also not present variable (on several places), better the to use UINTMAX_MAX
(http://www.cplusplus.com/reference/cstdint/)
@@ -226,8 +237,8 @@ bool win32_exception::write_stacktrace(EXCEPTION_POINTERS* pEp) | |||
{ | |||
if(frame.AddrPC.Offset != 0) | |||
{ | |||
DWORD64 symoffset=0; | |||
DWORD lineoffset=0; | |||
uint32_t64 symoffset = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also here wrongly changed from sed
#define IMAGE_SYM_uint32_t_NULL 0 | ||
#define IMAGE_SYM_uint32_t_POINTER 1 | ||
#define IMAGE_SYM_uint32_t_FUNCTION 2 | ||
#define IMAGE_SYM_uint32_t_ARRAY 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This defines also not direct correct 😄
@lrusak this needs a rebase |
more cleanup of PlatformDefs.h
This is just a global replace of DWORD to uin32_t. I'll probably have to fix up some windows things as it compiles fine on linux.