natinusala / borealis

Hardware accelerated, controller and TV oriented UI library for PC and Nintendo Switch (libnx)
Apache License 2.0
254 stars 81 forks source link

Core and Views - Fixed warnings #156

Closed EmreTech closed 3 years ago

EmreTech commented 3 years ago

Originally a fix for #155

This Pull Request aims to fix some small minor warnings that can cause a lot of scrolling if the build failed.

natinusala commented 3 years ago

Can you run clang-format on this please? Using the script in the repo

natinusala commented 3 years ago

(also thanks for the PR!)

EmreTech commented 3 years ago

Sure!

EmreTech commented 3 years ago

Okay, why is there a file named - after running that clang-format script?

natinusala commented 3 years ago

I don't know what did you run exactly?

Le 24 mars 2021 22:19:31 EmreTech @.***> a écrit :

Okay, why is there a file named - after running that clang-format script? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

EmreTech commented 3 years ago

I ran ./scripts/format.sh --fix and it said this after the patching file *insert file here*:

Hunk #1 FAILED at 19.
1 out of 1 hunk FAILED -- saving rejects to file -
natinusala commented 3 years ago

You succeeded to keep everything but the important part of the error message, can I see it entirely?

Le 24 mars 2021 22:22:20 EmreTech @.***> a écrit :

I ran ./scripts/format.sh --fix and it said this after the patching file insert file here: Hunk #1 FAILED at 19. 1 out of 1 hunk FAILED -- saving rejects to file -

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

p-sam commented 3 years ago

I'm not sure how you would run into conflicts with yourself (essentially the script is generating a patch file of the format changes, and failing to apply it) but you may just have edited the file while the script was running (you or your IDE). Also the script should output the rejects to stdout (not to a file named "-")

EmreTech commented 3 years ago

Here's the full output from the command:

patching file library/include/borealis/core/font.hpp
patching file library/include/borealis/core/util.hpp
patching file library/include/borealis/core/input.hpp
patching file library/include/borealis/views/rectangle.hpp
patching file library/include/borealis/views/button.hpp
patching file library/lib/platforms/switch/switch_audio.cpp
patching file library/lib/core/util.cpp
Hunk #1 FAILED at 19.
1 out of 1 hunk FAILED -- saving rejects to file -
patching file library/lib/views/button.cpp
patching file library/lib/views/image.cpp
patching file library/lib/views/label.cpp
EmreTech commented 3 years ago

I'm not sure how you would run into conflicts with yourself (essentially the script is generating a patch file of the format changes, and failing to apply it) but you may just have edited the file while the script was running (you or your IDE)

That could be the case, I think I might've forgotten to close the file in VS Code

natinusala commented 3 years ago

Yeah I encountered the same issue today while working on the library. util.cpp has different line endings (CRLF) and the patch fails. Open it in vscode and convert the line endings to LF then run clang format again

Le 24 mars 2021 22:27:49 EmreTech @.***> a écrit :

Here's the full output from the command: patching file library/include/borealis/core/font.hpp patching file library/include/borealis/core/util.hpp patching file library/include/borealis/core/input.hpp patching file library/include/borealis/views/rectangle.hpp patching file library/include/borealis/views/button.hpp patching file library/lib/platforms/switch/switch_audio.cpp patching file library/lib/core/util.cpp Hunk #1 FAILED at 19. 1 out of 1 hunk FAILED -- saving rejects to file - patching file library/lib/views/button.cpp patching file library/lib/views/image.cpp patching file library/lib/views/label.cpp

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

EmreTech commented 3 years ago

Alright, that actually worked. Thanks!

EmreTech commented 3 years ago

Also the script should output the rejects to stdout (not to a file named "-")

Yeah, that doesn't seem normal... I downloaded clang-format-8 from brew, maybe it's slightly broken?