-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[refactoring] General maintenance #978
Conversation
b9773d0
to
4cca588
Compare
4cca588
to
c7041cc
Compare
I think we should merge getopt mmap mingw folders to win32 |
Good idea. Give me some time, I want to see the CI pass first. I'll let you know as soon as a review makes sense. I just had to fix a mistake. |
Note: mmap is not only used with win32. It should go to |
unistd.h is used to build with msvc. So I propose to move it to win32/unistd/unistd.h |
if (WIN32 OR MINGW OR MSYS OR MSVC)
include_directories(src/win32)
set(STLINK_SOURCE "${STLINK_SOURCE};src/mmap.c;src/win32/mingw.c")
set(STLINK_HEADERS "${STLINK_HEADERS};src/mmap.h;src/win32/mingw.h")
if (MSVC)
include_directories(src/win32/getopt)
# Use string.h rather than strings.h and disable annoying warnings
add_definitions(-DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS /wd4710)
endif ()
endif () This code doesn't lie! Only on windows :) |
This code does not lie either: |
We can leave it in BTW: Why don't we have it integrated here then: |
our unistd.h should lay in differ folder than mingw.h cause MinGW contain the custom realisation of unistd.h |
how to move mmap - slyshykO@cacb493 |
Yes, somehow like this. Let me have a closer look first. 😉 |
507133d
to
e74c6ec
Compare
- Grouped source files for win32 - Whitespace & code style cleanup
e74c6ec
to
e895a7c
Compare
4d4cb83
to
a37625c
Compare
a37625c
to
9797464
Compare
I'd prefer that all conditions were in brackets even if it contains only one line. prefer if( x ) {
printf("%s", "Hello \n");
} over if ( x ) printf("%s", "Hello \n"); And it is strange for me that all return values covered in parentheses. |
Yeah, we can set up brackets for if-statements in general. The return statement can either be with or without brackets as far as i can see, but not only if the value is negative - I'd need to look that up. |
15e57a7
to
f4e9187
Compare
- Added config for uncrustify style settings - Applied changes to source files - Moved some header files
e538398
to
c1918c0
Compare
@chenguokai & @slyshykO you may review now. |
634b46b
to
06aec5b
Compare
(Closes #864, #976) (Fixes #1089)