repo
stringlengths
5
53
pr_number
int32
1
321k
task_type
stringclasses
2 values
issue_text
stringlengths
0
81.2k
pr_title
stringlengths
1
319
pr_body
stringlengths
0
105k
base_sha
stringlengths
40
40
head_sha
stringlengths
40
40
gold_diff
stringlengths
0
202M
changed_files
listlengths
0
100
review_threads
listlengths
0
100
test_patch
stringlengths
0
23.4M
merged
bool
1 class
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
TODO: remove this include
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/System/Android/Activity.hpp b/src/SFML/System/Android/Activity.hpp index 965888e5ca..b8d02c097d 100644 --- a/src/SFML/System/Android/Activity.hpp +++ b/src/SFML/System/Android/Activity.hpp @@ -29,6 +29,7 @@ //////////////////////////////////////////////////////////// #include <SFML/Window/EglCon...
[ "src/SFML/System/Android/Activity.hpp" ]
[ { "comment": "TODO: remove this include", "path": "src/SFML/System/Android/Activity.hpp", "hunk": "@@ -40,6 +41,7 @@\n #include <string>\n #include <unordered_map>\n #include <vector>\n+#include <map>", "resolving_sha": "9d185f2160182c63dec9339365ce446775a2c730", "resolving_diff": "diff --git a/...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
TODO: move JNI helpers to a dedicated file
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/JoystickImpl.cpp b/src/SFML/Window/Android/JoystickImpl.cpp index aad1aaf10d..f61c13bbc4 100644 --- a/src/SFML/Window/Android/JoystickImpl.cpp +++ b/src/SFML/Window/Android/JoystickImpl.cpp @@ -25,37 +25,154 @@ //////////////////////////////////////////////////////////// // Header...
[ "src/SFML/Window/Android/JoystickImpl.cpp" ]
[ { "comment": "TODO: move JNI helpers to a dedicated file", "path": "src/SFML/Window/Android/JoystickImpl.cpp", "hunk": "@@ -26,52 +26,264 @@\n // Headers\n ////////////////////////////////////////////////////////////\n #include <SFML/Window/JoystickImpl.hpp>\n+#include <SFML/System/Err.hpp>\n+#include <...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
```suggestion Jni(Jni&& other) noexcept { std::swap(m_vm, other.m_vm); } Jni(const Jni&&) = delete; ~Jni() { if (m_vm) m_vm->DetachCurrentThread(); } ```
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/JniHelper.hpp b/src/SFML/Window/Android/JniHelper.hpp new file mode 100644 index 0000000000..3b543fe320 --- /dev/null +++ b/src/SFML/Window/Android/JniHelper.hpp @@ -0,0 +1,224 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia...
[ "src/SFML/Window/Android/JniHelper.hpp" ]
[ { "comment": "```suggestion\r\n Jni(Jni&& other) noexcept\r\n {\r\n std::swap(m_vm, other.m_vm);\r\n }\r\n\r\n Jni(const Jni&&) = delete;\r\n\r\n ~Jni()\r\n {\r\n if (m_vm)\r\n m_vm->DetachCurrentThread();\r\n }\r\n```", "path": "src/SFML/Window/Android/JniHelpe...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
Won't this cause issues with the indexing? Meaning, shouldn't this be `return true` instead? What if I call `open(3)` twice in a row? Wouldn't it first register it and then on the second call register a different device for the same index, because we don't return here?
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/JoystickImpl.cpp b/src/SFML/Window/Android/JoystickImpl.cpp index aad1aaf10d..f61c13bbc4 100644 --- a/src/SFML/Window/Android/JoystickImpl.cpp +++ b/src/SFML/Window/Android/JoystickImpl.cpp @@ -25,37 +25,154 @@ //////////////////////////////////////////////////////////// // Header...
[ "src/SFML/Window/Android/JoystickImpl.cpp" ]
[ { "comment": "Won't this cause issues with the indexing? Meaning, shouldn't this be `return true` instead?\r\n\r\nWhat if I call `open(3)` twice in a row? Wouldn't it first register it and then on the second call register a different device for the same index, because we don't return here?", "path": "src/SF...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
In what scenarios can `getCapabilitiesFromJni` fail and is the right option to ignore this device? Or would it be better to call `return false` here?
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/JoystickImpl.cpp b/src/SFML/Window/Android/JoystickImpl.cpp index aad1aaf10d..f61c13bbc4 100644 --- a/src/SFML/Window/Android/JoystickImpl.cpp +++ b/src/SFML/Window/Android/JoystickImpl.cpp @@ -25,37 +25,154 @@ //////////////////////////////////////////////////////////// // Header...
[ "src/SFML/Window/Android/JoystickImpl.cpp" ]
[ { "comment": "In what scenarios can `getCapabilitiesFromJni` fail and is the right option to ignore this device? Or would it be better to call `return false` here?", "path": "src/SFML/Window/Android/JoystickImpl.cpp", "hunk": "@@ -25,53 +25,147 @@\n //////////////////////////////////////////////////////...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
It's a bit more work, but it would align better with SFML's way to separating code, by having only declarations in the header, move the template implementations into an *.inl file and have the non-template implementation in the *.cpp file. At least it should be consistent and not mixed as it currently is.
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/JniHelper.hpp b/src/SFML/Window/Android/JniHelper.hpp new file mode 100644 index 0000000000..3b543fe320 --- /dev/null +++ b/src/SFML/Window/Android/JniHelper.hpp @@ -0,0 +1,224 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia...
[ "src/SFML/Window/Android/JniHelper.hpp" ]
[ { "comment": "It's a bit more work, but it would align better with SFML's way to separating code, by having only declarations in the header, move the template implementations into an *.inl file and have the non-template implementation in the *.cpp file.\r\n\r\nAt least it should be consistent and not mixed as i...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
```suggestion err() << "Failed to initialize JNI" << std::endl; ``` Copy-paste from `WindowImplAndroid::getUnicode`
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/WindowImplAndroid.cpp b/src/SFML/Window/Android/WindowImplAndroid.cpp index 66fd3a0d0d..01cf6404e1 100644 --- a/src/SFML/Window/Android/WindowImplAndroid.cpp +++ b/src/SFML/Window/Android/WindowImplAndroid.cpp @@ -26,6 +26,7 @@ //////////////////////////////////////////////////////...
[ "src/SFML/Window/Android/WindowImplAndroid.cpp" ]
[ { "comment": "```suggestion\r\n err() << \"Failed to initialize JNI\" << std::endl;\r\n```\r\n\r\nCopy-paste from `WindowImplAndroid::getUnicode`", "path": "src/SFML/Window/Android/WindowImplAndroid.cpp", "hunk": "@@ -330,19 +331,9 @@ int WindowImplAndroid::processEvent(int /* fd */, int /* event...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
No need for judgmental comments 😉 This is how the SFML API defines it and isn't Windows specific. ```suggestion const float factor = 100.f; // SFML normalizes axis to the range <-100, 100> instead of <-1, 1> ```
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/WindowImplAndroid.cpp b/src/SFML/Window/Android/WindowImplAndroid.cpp index 66fd3a0d0d..01cf6404e1 100644 --- a/src/SFML/Window/Android/WindowImplAndroid.cpp +++ b/src/SFML/Window/Android/WindowImplAndroid.cpp @@ -26,6 +26,7 @@ //////////////////////////////////////////////////////...
[ "src/SFML/Window/Android/WindowImplAndroid.cpp" ]
[ { "comment": "No need for judgmental comments 😉 \r\n\r\nThis is how the SFML API defines it and isn't Windows specific.\r\n\r\n```suggestion\r\n const float factor = 100.f; // SFML normalizes axis to the range <-100, 100> instead of <-1, 1>\r\n```", "path": "src/SFML/Window/Android/WindowImplAnd...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
```suggestion /// \brief Convert a Android key to SFML key code / joystick button code ```
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/WindowImplAndroid.hpp b/src/SFML/Window/Android/WindowImplAndroid.hpp index e77acd95d9..98db3a79f1 100644 --- a/src/SFML/Window/Android/WindowImplAndroid.hpp +++ b/src/SFML/Window/Android/WindowImplAndroid.hpp @@ -27,6 +27,7 @@ //////////////////////////////////////////////////////...
[ "src/SFML/Window/Android/WindowImplAndroid.hpp" ]
[ { "comment": "```suggestion\r\n /// \\brief Convert a Android key to SFML key code / joystick button code\r\n```", "path": "src/SFML/Window/Android/WindowImplAndroid.hpp", "hunk": "@@ -228,18 +230,23 @@ class WindowImplAndroid : public WindowImpl\n \n static int processScrollEvent(AInputEvent* in...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
What happens if `sfAxisToAndroid` returns `-1`?
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/WindowImplAndroid.cpp b/src/SFML/Window/Android/WindowImplAndroid.cpp index 66fd3a0d0d..01cf6404e1 100644 --- a/src/SFML/Window/Android/WindowImplAndroid.cpp +++ b/src/SFML/Window/Android/WindowImplAndroid.cpp @@ -26,6 +26,7 @@ //////////////////////////////////////////////////////...
[ "src/SFML/Window/Android/WindowImplAndroid.cpp" ]
[ { "comment": "What happens if `sfAxisToAndroid` returns `-1`?", "path": "src/SFML/Window/Android/WindowImplAndroid.cpp", "hunk": "@@ -492,6 +503,34 @@ int WindowImplAndroid::processMotionEvent(AInputEvent* inputEvent, ActivityState\n \n states.touchEvents[id] = touchMoved.position;\n ...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
```suggestion // There seems to be no direct mapping between input event and the ID of the device that // caused the event. However, as the single input event contains all axii changes, it's possible // to poll values for all axii in a single loop iteration. // ...
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/WindowImplAndroid.cpp b/src/SFML/Window/Android/WindowImplAndroid.cpp index 66fd3a0d0d..01cf6404e1 100644 --- a/src/SFML/Window/Android/WindowImplAndroid.cpp +++ b/src/SFML/Window/Android/WindowImplAndroid.cpp @@ -26,6 +26,7 @@ //////////////////////////////////////////////////////...
[ "src/SFML/Window/Android/WindowImplAndroid.cpp" ]
[ { "comment": "```suggestion\r\n // There seems to be no direct mapping between input event and the ID of the device that\r\n // caused the event. However, as the single input event contains all axii changes, it's possible\r\n // to poll values for all axii in a single loop itera...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
We're missing a namespace here, wouldn't want to put this into the global namespace, even if it shouldn't be an issue. I suggest: `namespace sf::priv`
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/JniHelper.hpp b/src/SFML/Window/Android/JniHelper.hpp new file mode 100644 index 0000000000..3b543fe320 --- /dev/null +++ b/src/SFML/Window/Android/JniHelper.hpp @@ -0,0 +1,224 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia...
[ "src/SFML/Window/Android/JniHelper.hpp" ]
[ { "comment": "We're missing a namespace here, wouldn't want to put this into the global namespace, even if it shouldn't be an issue.\r\n\r\nI suggest: `namespace sf::priv`", "path": "src/SFML/Window/Android/JniHelper.hpp", "hunk": "@@ -0,0 +1,204 @@\n+////////////////////////////////////////////////////...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
Maybe instead of using `-1` as surrogate, we could use `std::optional` instead.
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/JoystickImpl.hpp b/src/SFML/Window/Android/JoystickImpl.hpp index e8c0c774e4..7c598d96fb 100644 --- a/src/SFML/Window/Android/JoystickImpl.hpp +++ b/src/SFML/Window/Android/JoystickImpl.hpp @@ -24,6 +24,13 @@ #pragma once +///////////////////////////////////////////////////////...
[ "src/SFML/Window/Android/JoystickImpl.hpp" ]
[ { "comment": "Maybe instead of using `-1` as surrogate, we could use `std::optional` instead.", "path": "src/SFML/Window/Android/JoystickImpl.hpp", "hunk": "@@ -94,13 +94,19 @@ class JoystickImpl\n /// \\return Joystick state\n ///\n //////////////////////////////////////////////////////////...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
Direct access should be fine, as we just check it above ```suggestion states.joystickStates[m_currentDeviceIdx].axes, states.joystickStates[m_currentDeviceIdx].buttons}; ```
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/JoystickImpl.cpp b/src/SFML/Window/Android/JoystickImpl.cpp index aad1aaf10d..f61c13bbc4 100644 --- a/src/SFML/Window/Android/JoystickImpl.cpp +++ b/src/SFML/Window/Android/JoystickImpl.cpp @@ -25,37 +25,154 @@ //////////////////////////////////////////////////////////// // Header...
[ "src/SFML/Window/Android/JoystickImpl.cpp" ]
[ { "comment": "Direct access should be fine, as we just check it above\r\n\r\n```suggestion\r\n states.joystickStates[m_currentDeviceIdx].axes,\r\n states.joystickStates[m_currentDeviceIdx].buttons};\r\n```", "path": "src/SFML/Window/Android/JoystickImpl.cpp", "hunk": "@@ -83,10 +17...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
Direct access should be fine here, as we just checked it above: ```suggestion auto& axes = states.joystickStates[deviceId].axes; ```
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/WindowImplAndroid.cpp b/src/SFML/Window/Android/WindowImplAndroid.cpp index 66fd3a0d0d..01cf6404e1 100644 --- a/src/SFML/Window/Android/WindowImplAndroid.cpp +++ b/src/SFML/Window/Android/WindowImplAndroid.cpp @@ -26,6 +26,7 @@ //////////////////////////////////////////////////////...
[ "src/SFML/Window/Android/WindowImplAndroid.cpp" ]
[ { "comment": "Direct access should be fine here, as we just checked it above:\r\n\r\n```suggestion\r\n auto& axes = states.joystickStates[deviceId].axes;\r\n```", "path": "src/SFML/Window/Android/WindowImplAndroid.cpp", "hunk": "@@ -492,6 +503,28 @@ int WindowImplAndroid::processMotio...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
Direct access should be fine here, as we just checked it above: ```suggestion states.joystickStates[deviceId].buttons[buttonIdx] = action == AKEY_EVENT_ACTION_DOWN; ```
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/WindowImplAndroid.cpp b/src/SFML/Window/Android/WindowImplAndroid.cpp index 66fd3a0d0d..01cf6404e1 100644 --- a/src/SFML/Window/Android/WindowImplAndroid.cpp +++ b/src/SFML/Window/Android/WindowImplAndroid.cpp @@ -26,6 +26,7 @@ //////////////////////////////////////////////////////...
[ "src/SFML/Window/Android/WindowImplAndroid.cpp" ]
[ { "comment": "Direct access should be fine here, as we just checked it above:\r\n\r\n```suggestion\r\n states.joystickStates[deviceId].buttons[buttonIdx] = action == AKEY_EVENT_ACTION_DOWN;\r\n```", "path": "src/SFML/Window/Android/WindowImplAndroid.cpp", "hunk": "@@ -461,6 +458,20 @@ int WindowImplA...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
What's with all the private constructors and friend classes? Why not just use public constructors and drop the friends? What are we protecting against by doing this?
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/JniHelper.hpp b/src/SFML/Window/Android/JniHelper.hpp new file mode 100644 index 0000000000..3b543fe320 --- /dev/null +++ b/src/SFML/Window/Android/JniHelper.hpp @@ -0,0 +1,224 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia...
[ "src/SFML/Window/Android/JniHelper.hpp" ]
[ { "comment": "What's with all the private constructors and friend classes? Why not just use public constructors and drop the friends? What are we protecting against by doing this?", "path": "src/SFML/Window/Android/JniHelper.hpp", "hunk": "@@ -0,0 +1,199 @@\n+////////////////////////////////////////////...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
Instead of using a pointer param and asserting it's not null, let's just use a `JNIEnv&` param.
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/JniHelper.cpp b/src/SFML/Window/Android/JniHelper.cpp new file mode 100644 index 0000000000..8c4b2f4f92 --- /dev/null +++ b/src/SFML/Window/Android/JniHelper.cpp @@ -0,0 +1,290 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia...
[ "src/SFML/Window/Android/JniHelper.cpp" ]
[ { "comment": "Instead of using a pointer param and asserting it's not null, let's just use a `JNIEnv&` param. ", "path": "src/SFML/Window/Android/JniHelper.cpp", "hunk": "@@ -0,0 +1,286 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
See previous comment about using reference params instead of pointers.
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/JniHelper.cpp b/src/SFML/Window/Android/JniHelper.cpp new file mode 100644 index 0000000000..8c4b2f4f92 --- /dev/null +++ b/src/SFML/Window/Android/JniHelper.cpp @@ -0,0 +1,290 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia...
[ "src/SFML/Window/Android/JniHelper.cpp" ]
[ { "comment": "See previous comment about using reference params instead of pointers.", "path": "src/SFML/Window/Android/JniHelper.cpp", "hunk": "@@ -0,0 +1,286 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+// Copyright (C) 2007-20...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
I'm not asking you to change how data is stored in the class. If it's important that these classes be reassignable, we can keep using a pointer instead of a reference.
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/JniHelper.hpp b/src/SFML/Window/Android/JniHelper.hpp new file mode 100644 index 0000000000..3b543fe320 --- /dev/null +++ b/src/SFML/Window/Android/JniHelper.hpp @@ -0,0 +1,224 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia...
[ "src/SFML/Window/Android/JniHelper.hpp" ]
[ { "comment": "I'm not asking you to change how data is stored in the class. If it's important that these classes be reassignable, we can keep using a pointer instead of a reference.", "path": "src/SFML/Window/Android/JniHelper.hpp", "hunk": "@@ -145,16 +145,16 @@ class JniInputDevice\n class JniInputDev...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
There is no need to change the value of data members in a destructor. This is just dead code. I went ahead and removed this line.
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/JniHelper.cpp b/src/SFML/Window/Android/JniHelper.cpp new file mode 100644 index 0000000000..8c4b2f4f92 --- /dev/null +++ b/src/SFML/Window/Android/JniHelper.cpp @@ -0,0 +1,290 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia...
[ "src/SFML/Window/Android/JniHelper.cpp" ]
[ { "comment": "There is no need to change the value of data members in a destructor. This is just dead code. I went ahead and removed this line.", "path": "src/SFML/Window/Android/JniHelper.cpp", "hunk": "@@ -242,39 +242,49 @@ std::optional<JniList<JniMotionRange, JniMotionRangeClass>> JniInputDevice::ge...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
Is there a situation where `m_vm` would be null upon destruction? I believe this pointer is guaranteed to be non-null to added an `assert` to enforce this. Do we want to store a reference internally here?
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/JniHelper.cpp b/src/SFML/Window/Android/JniHelper.cpp new file mode 100644 index 0000000000..8c4b2f4f92 --- /dev/null +++ b/src/SFML/Window/Android/JniHelper.cpp @@ -0,0 +1,290 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia...
[ "src/SFML/Window/Android/JniHelper.cpp" ]
[ { "comment": "Is there a situation where `m_vm` would be null upon destruction? I believe this pointer is guaranteed to be non-null to added an `assert` to enforce this. Do we want to store a reference internally here? ", "path": "src/SFML/Window/Android/JniHelper.cpp", "hunk": "@@ -242,39 +242,49 @@ st...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
What was the reasoning for adding `getEnv`? It appears that anywhere we use `getEnv` we could also access the environment through `states.activity`.
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/WindowImplAndroid.cpp b/src/SFML/Window/Android/WindowImplAndroid.cpp index 66fd3a0d0d..01cf6404e1 100644 --- a/src/SFML/Window/Android/WindowImplAndroid.cpp +++ b/src/SFML/Window/Android/WindowImplAndroid.cpp @@ -26,6 +26,7 @@ //////////////////////////////////////////////////////...
[ "src/SFML/Window/Android/WindowImplAndroid.cpp" ]
[ { "comment": "What was the reasoning for adding `getEnv`? It appears that anywhere we use `getEnv` we could also access the environment through `states.activity`.", "path": "src/SFML/Window/Android/WindowImplAndroid.cpp", "hunk": "@@ -716,11 +717,12 @@ char32_t WindowImplAndroid::getUnicode(AInputEvent*...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
Name should match declaration in header: ```suggestion bool JoystickImpl::open(unsigned int index) ```
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/JoystickImpl.cpp b/src/SFML/Window/Android/JoystickImpl.cpp index aad1aaf10d..f61c13bbc4 100644 --- a/src/SFML/Window/Android/JoystickImpl.cpp +++ b/src/SFML/Window/Android/JoystickImpl.cpp @@ -25,37 +25,154 @@ //////////////////////////////////////////////////////////// // Header...
[ "src/SFML/Window/Android/JoystickImpl.cpp" ]
[ { "comment": "Name should match declaration in header:\n\n\n```suggestion\nbool JoystickImpl::open(unsigned int index)\n```", "path": "src/SFML/Window/Android/JoystickImpl.cpp", "hunk": "@@ -25,53 +25,173 @@\n ////////////////////////////////////////////////////////////\n // Headers\n //////////////////...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
We're looping here, should we give up on the first missing capability or try to continue?
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/JoystickImpl.cpp b/src/SFML/Window/Android/JoystickImpl.cpp index aad1aaf10d..f61c13bbc4 100644 --- a/src/SFML/Window/Android/JoystickImpl.cpp +++ b/src/SFML/Window/Android/JoystickImpl.cpp @@ -25,37 +25,154 @@ //////////////////////////////////////////////////////////// // Header...
[ "src/SFML/Window/Android/JoystickImpl.cpp" ]
[ { "comment": "We're looping here, should we give up on the first missing capability or try to continue?", "path": "src/SFML/Window/Android/JoystickImpl.cpp", "hunk": "@@ -25,53 +25,173 @@\n ////////////////////////////////////////////////////////////\n // Headers\n //////////////////////////////////////...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
Do we need to reset `m_currentDeviceIdx`?
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/JoystickImpl.cpp b/src/SFML/Window/Android/JoystickImpl.cpp index aad1aaf10d..f61c13bbc4 100644 --- a/src/SFML/Window/Android/JoystickImpl.cpp +++ b/src/SFML/Window/Android/JoystickImpl.cpp @@ -25,37 +25,154 @@ //////////////////////////////////////////////////////////// // Header...
[ "src/SFML/Window/Android/JoystickImpl.cpp" ]
[ { "comment": "Do we need to reset `m_currentDeviceIdx`?", "path": "src/SFML/Window/Android/JoystickImpl.cpp", "hunk": "@@ -25,53 +25,173 @@\n ////////////////////////////////////////////////////////////\n // Headers\n ////////////////////////////////////////////////////////////\n+#include <SFML/Window/A...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
Can we align the type to be `ref` or `ptr` across the different classes?
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/JniHelper.inl b/src/SFML/Window/Android/JniHelper.inl new file mode 100644 index 0000000000..66ecce685b --- /dev/null +++ b/src/SFML/Window/Android/JniHelper.inl @@ -0,0 +1,153 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia...
[ "src/SFML/Window/Android/JniHelper.inl" ]
[ { "comment": "Can we align the type to be `ref` or `ptr` across the different classes?", "path": "src/SFML/Window/Android/JniHelper.inl", "hunk": "@@ -0,0 +1,149 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+// Copyright (C) 2007-...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
Don't think there's a good reason to make `Jni` movable
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/JniHelper.hpp b/src/SFML/Window/Android/JniHelper.hpp new file mode 100644 index 0000000000..3b543fe320 --- /dev/null +++ b/src/SFML/Window/Android/JniHelper.hpp @@ -0,0 +1,224 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia...
[ "src/SFML/Window/Android/JniHelper.hpp" ]
[ { "comment": "Don't think there's a good reason to make `Jni` movable", "path": "src/SFML/Window/Android/JniHelper.hpp", "hunk": "@@ -0,0 +1,224 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+// Copyright (C) 2007-2025 Laurent Gomi...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
Year needs to be updated everyhwere
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/JoystickButton.hpp b/src/SFML/Window/Android/JoystickButton.hpp new file mode 100644 index 0000000000..6a04da5553 --- /dev/null +++ b/src/SFML/Window/Android/JoystickButton.hpp @@ -0,0 +1,61 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and F...
[ "src/SFML/Window/Android/JoystickButton.hpp" ]
[ { "comment": "Year needs to be updated everyhwere", "path": "src/SFML/Window/Android/JoystickButton.hpp", "hunk": "@@ -0,0 +1,61 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+// Copyright (C) 2007-2025 Laurent Gomila (laurent@sfml...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
This should actually be ```suggestion assert(idx < m_length); ```
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/JniHelper.inl b/src/SFML/Window/Android/JniHelper.inl new file mode 100644 index 0000000000..66ecce685b --- /dev/null +++ b/src/SFML/Window/Android/JniHelper.inl @@ -0,0 +1,153 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia...
[ "src/SFML/Window/Android/JniHelper.inl" ]
[ { "comment": "This should actually be\n```suggestion\n assert(idx < m_length);\n```", "path": "src/SFML/Window/Android/JniHelper.inl", "hunk": "@@ -0,0 +1,149 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+// Copyright (C) 2...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
Missing `return 0;` statement
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/WindowImplAndroid.cpp b/src/SFML/Window/Android/WindowImplAndroid.cpp index 66fd3a0d0d..01cf6404e1 100644 --- a/src/SFML/Window/Android/WindowImplAndroid.cpp +++ b/src/SFML/Window/Android/WindowImplAndroid.cpp @@ -26,6 +26,7 @@ //////////////////////////////////////////////////////...
[ "src/SFML/Window/Android/WindowImplAndroid.cpp" ]
[ { "comment": "Missing `return 0;` statement", "path": "src/SFML/Window/Android/WindowImplAndroid.cpp", "hunk": "@@ -810,22 +849,13 @@ char32_t WindowImplAndroid::getUnicode(AInputEvent* event)\n ActivityStates& states = getActivity();\n const std::lock_guard lock(states.mutex);\n \n- //...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
I think Thrasher already hinted at that, but this will lead to the moved-from object to retain a valid pointer, that could potentially corrupt the moved-to object, once the destructor is called. ```suggestion Jni::Jni(Jni&& other) noexcept : m_vm(other.m_vm), m_env(other.m_env) { other.m_vm = nullptr; ...
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/JniHelper.cpp b/src/SFML/Window/Android/JniHelper.cpp new file mode 100644 index 0000000000..8c4b2f4f92 --- /dev/null +++ b/src/SFML/Window/Android/JniHelper.cpp @@ -0,0 +1,290 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia...
[ "src/SFML/Window/Android/JniHelper.cpp" ]
[ { "comment": "I think Thrasher already hinted at that, but this will lead to the moved-from object to retain a valid pointer, that could potentially corrupt the moved-to object, once the destructor is called.\n\n\n```suggestion\nJni::Jni(Jni&& other) noexcept :\n m_vm(other.m_vm),\n m_env(other.m_env)\n{\...
true
SFML/SFML
3,497
comment_to_fix
Feature: Android joystick support
Same issue as with the Jni class ```suggestion JniArray(JniArray&& other) noexcept : m_env(other.m_env), m_array(other.m_array), m_length(other.m_length), m_data(other.m_data) { other.m_env = nullptr; other.m_array = nullptr; other.m_length = 0; o...
3577f199477afadb547d6088b26d971023db998a
9d185f2160182c63dec9339365ce446775a2c730
diff --git a/src/SFML/Window/Android/JniHelper.inl b/src/SFML/Window/Android/JniHelper.inl new file mode 100644 index 0000000000..66ecce685b --- /dev/null +++ b/src/SFML/Window/Android/JniHelper.inl @@ -0,0 +1,153 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia...
[ "src/SFML/Window/Android/JniHelper.inl" ]
[ { "comment": "Same issue as with the Jni class\n\n```suggestion\n JniArray(JniArray&& other) noexcept :\n m_env(other.m_env),\n m_array(other.m_array),\n m_length(other.m_length),\n m_data(other.m_data)\n {\n other.m_env = nullptr;\n other.m_array = nullptr;\n ...
true
SFML/SFML
3,704
issue_to_patch
Add deprecations for the documentation
## Description - Makes it visible in the doxygen documentation - Lists it under the deprecation in the doxygen documentation ## How to test this PR? - Documentation should build - Should be visible in the documentation
08996418f52315b4ec8d85be089b13fec1f96613
7868817f8d691c3cc7e33370c720dc9c88fbdb22
diff --git a/include/SFML/Graphics/Text.hpp b/include/SFML/Graphics/Text.hpp index aa0b7c8c4a..39edc48db6 100644 --- a/include/SFML/Graphics/Text.hpp +++ b/include/SFML/Graphics/Text.hpp @@ -478,6 +478,8 @@ class SFML_GRAPHICS_API Text : public Drawable, public Transformable ///////////////////////////////////////...
[ "include/SFML/Graphics/Text.hpp", "include/SFML/Network/Ftp.hpp", "include/SFML/Network/IpAddress.hpp" ]
[]
true
SFML/SFML
3,703
issue_to_patch
Disable HarfBuzz GPU library, was SFML doesn't use it yet
## Description [Version 14.0.0](https://github.com/harfbuzz/harfbuzz/releases/tag/14.0.0) introduced libharfbuzz-gpu with the Slug algorithm, but as we're not using it (yet?!), there's no need in building said library. ## How to test this PR? CI should pass
01071fa097301ccb364a943db4fd3fd9ebbd8768
39481f6894252b1e32a23ea9ef9dd0c1277f5f2a
diff --git a/src/SFML/Graphics/CMakeLists.txt b/src/SFML/Graphics/CMakeLists.txt index f5a234d837..bba99cd738 100644 --- a/src/SFML/Graphics/CMakeLists.txt +++ b/src/SFML/Graphics/CMakeLists.txt @@ -152,6 +152,7 @@ else() set(HB_BUILD_SUBSET OFF) set(HB_BUILD_RASTER OFF) set(HB_BUILD_VECTOR O...
[ "src/SFML/Graphics/CMakeLists.txt" ]
[]
true
SFML/SFML
3,702
issue_to_patch
Fixed audio issues
This changeset fixes 2 minor issues: - The sample rate used by the sound effects example was incorrectly using the sample rate of the source audio data and not the sample rate of the playback device which is the sample rate of the data passed to the processing callback - The size of the audio frame buffer that was au...
97fa81b43c8d6cabf5fbacb957dd75b991923062
33f04e49ed439b943749089425fd250dc4357f19
diff --git a/examples/sound_effects/SoundEffects.cpp b/examples/sound_effects/SoundEffects.cpp index 49edace91e..647e568e31 100644 --- a/examples/sound_effects/SoundEffects.cpp +++ b/examples/sound_effects/SoundEffects.cpp @@ -811,7 +811,8 @@ struct HighPassFilter : BiquadFilter { static constexpr auto cu...
[ "examples/sound_effects/SoundEffects.cpp", "include/SFML/Audio/SoundSource.hpp", "src/SFML/Audio/AudioDevice.cpp" ]
[]
true
SFML/SFML
3,701
issue_to_patch
Update dependencies
## Description - Update miniaudio to v0.11.25 - Update ogg to v1.3.6 - Update FLAC to v1.5.0 - Update FreeType to v2.14.3 - Update HarfBuzz to v14.1.0 - Update all GitHub Actions ## How to test this PR? - CI should pass - Test text rendering - Test OGG loading / saving - Test FLAC loading / saving - T...
548cdb9c394da1b08e563a1d7f6fa6225a6f3ece
a5b0eeef674b5f772a1b545f058de33e42eb9b41
diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index 6f686d6ca6..dd5136a9c3 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -32,7 +32,7 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@v4 + uses: actions/checkout@v6 ...
[ ".github/workflows/analyze.yml", ".github/workflows/build.yml", ".github/workflows/docs.yml", ".github/workflows/format.yml", ".github/workflows/release.yml", "extlibs/headers/miniaudio/miniaudio.h", "src/SFML/Audio/CMakeLists.txt", "src/SFML/Graphics/CMakeLists.txt", "tools/flac/PatchFLAC.cmake", ...
[]
true
SFML/SFML
3,700
issue_to_patch
Avoid symbol conflict when static linking with a lib shipping own QOI
## Description When several libraries linked statically into the project ship an "implementation header" C library/functions, the linker may end up with multiple symbols conflict, especially when the original sources were tweaked. With SFML, this happens e.g. when linking statically with the KTX library or Basis Un...
765d790f4ccdad20ca7aef5ad4d8588a4629a4b5
1577de07ed0d97c3d5fd07d5e8c935740a9507af
diff --git a/src/SFML/Graphics/Image.cpp b/src/SFML/Graphics/Image.cpp index aeefc4b48b..c592140393 100644 --- a/src/SFML/Graphics/Image.cpp +++ b/src/SFML/Graphics/Image.cpp @@ -37,6 +37,10 @@ #endif #define QOI_IMPLEMENTATION +#define qoi_decode sf_qoi_decode +#define qoi_encode sf_qoi_encode +#define qoi_read ...
[ "src/SFML/Graphics/Image.cpp" ]
[]
true
SFML/SFML
3,696
issue_to_patch
Allow configuring the default CA store at build time ### Prerequisite Checklist - [x] I searched for [existing issues](https://github.com/search?q=repo%3ASFML%2FSFML&type=issues) to prevent duplicates - [x] I searched for [existing discussions on the forum](https://www.google.com/search?q=site%3Ahttps%3A%2F%2Fen.sfml...
Allow loading a CA bundle from a custom path using the SFML_CA_BUNDLE_PATH CMake option
Title. Some users may want to specify a specific CA bundle file to populate the CA certificate store, see #3694. When the user sets the `SFML_CA_PATH` CMake option on the applicable systems, it is used instead of the built-in search directories to load system certificates from. Fixes #3694 @jcowgill
9120eeb6a36186961b80efece608caaba606d64e
2e02996ea98e7ac44cfd434b1453feb0b60d70fe
diff --git a/src/SFML/Network/CMakeLists.txt b/src/SFML/Network/CMakeLists.txt index d62e802b76..cf77462186 100644 --- a/src/SFML/Network/CMakeLists.txt +++ b/src/SFML/Network/CMakeLists.txt @@ -139,3 +139,10 @@ endif() if(SFML_OS_MACOS) target_link_libraries(sfml-network PRIVATE "-framework Security" "-framework...
[ "src/SFML/Network/CMakeLists.txt", "src/SFML/Network/TcpSocket.cpp" ]
[ { "comment": "Any reason to go with `#ifdef` here instead of `#if defined()` as with the other defs?", "path": "src/SFML/Network/TcpSocket.cpp", "hunk": "@@ -154,6 +154,19 @@ bool loadSystemCertificates([[maybe_unused]] mbedtls_x509_crt* x509crt, [[maybe_\n return loadStore(\"ROOT\") && loadStore(\"...
true
SFML/SFML
3,696
comment_to_fix
Allow loading a CA bundle from a custom path using the SFML_CA_BUNDLE_PATH CMake option
Any reason to go with `#ifdef` here instead of `#if defined()` as with the other defs?
9120eeb6a36186961b80efece608caaba606d64e
2e02996ea98e7ac44cfd434b1453feb0b60d70fe
diff --git a/src/SFML/Network/TcpSocket.cpp b/src/SFML/Network/TcpSocket.cpp index 52703b9a4a..f4f1b59da5 100644 --- a/src/SFML/Network/TcpSocket.cpp +++ b/src/SFML/Network/TcpSocket.cpp @@ -154,6 +154,36 @@ bool loadSystemCertificates([[maybe_unused]] mbedtls_x509_crt* x509crt, [[maybe_ return loadStore("ROOT") &...
[ "src/SFML/Network/TcpSocket.cpp" ]
[ { "comment": "Any reason to go with `#ifdef` here instead of `#if defined()` as with the other defs?", "path": "src/SFML/Network/TcpSocket.cpp", "hunk": "@@ -154,6 +154,19 @@ bool loadSystemCertificates([[maybe_unused]] mbedtls_x509_crt* x509crt, [[maybe_\n return loadStore(\"ROOT\") && loadStore(\"...
true
SFML/SFML
3,696
comment_to_fix
Allow loading a CA bundle from a custom path using the SFML_CA_BUNDLE_PATH CMake option
Should we add a check, that validates the path first or do we delegate that to MbedTls?
9120eeb6a36186961b80efece608caaba606d64e
2e02996ea98e7ac44cfd434b1453feb0b60d70fe
diff --git a/src/SFML/Network/TcpSocket.cpp b/src/SFML/Network/TcpSocket.cpp index 52703b9a4a..f4f1b59da5 100644 --- a/src/SFML/Network/TcpSocket.cpp +++ b/src/SFML/Network/TcpSocket.cpp @@ -154,6 +154,36 @@ bool loadSystemCertificates([[maybe_unused]] mbedtls_x509_crt* x509crt, [[maybe_ return loadStore("ROOT") &...
[ "src/SFML/Network/TcpSocket.cpp" ]
[ { "comment": "Should we add a check, that validates the path first or do we delegate that to MbedTls?", "path": "src/SFML/Network/TcpSocket.cpp", "hunk": "@@ -154,6 +154,19 @@ bool loadSystemCertificates([[maybe_unused]] mbedtls_x509_crt* x509crt, [[maybe_\n return loadStore(\"ROOT\") && loadStore(\...
true
SFML/SFML
3,519
issue_to_patch
Use const ref instead of cloning channelMap
getChannelMap was cloning the data unnecessarily. It wasn't building the data in the function, so I saw no reason why it had to pass by value instead of simply passing by const reference. This is just a proposal, so nothing too serious. The one major benefit is simply being more consistent. There are other uses of t...
406ad93700dc0e241af0948f8443fb39d883f081
12ce307c36675c07dc5a5eee10d39a0918876180
diff --git a/include/SFML/Audio/SoundBuffer.hpp b/include/SFML/Audio/SoundBuffer.hpp index 3fa2484b63..c071bcfe28 100644 --- a/include/SFML/Audio/SoundBuffer.hpp +++ b/include/SFML/Audio/SoundBuffer.hpp @@ -291,7 +291,7 @@ class SFML_AUDIO_API SoundBuffer /// \see `getSampleRate`, `getChannelCount`, `getDuration` ...
[ "include/SFML/Audio/SoundBuffer.hpp", "include/SFML/Audio/SoundStream.hpp", "src/SFML/Audio/SoundBuffer.cpp", "src/SFML/Audio/SoundStream.cpp" ]
[]
true
SFML/SFML
3,697
issue_to_patch
[Android] portable linker rule to keep symbol `ANativeActivity_onCreate`
## Fixes Without this, the `ANativeActivity_onCreate` was being stripped and the app would crash at launch. After the fix, the sfml android app launches and runs as expected. ## Description Retains `-u` behavior by using recommended cmake `"LINKER:<expr>"` expression format while building for android with dif...
9120eeb6a36186961b80efece608caaba606d64e
c9138de729f81cde8ee5a6d80bcda4d8043f4b5c
diff --git a/src/SFML/Main/CMakeLists.txt b/src/SFML/Main/CMakeLists.txt index 22630ebda9..d536646f0f 100644 --- a/src/SFML/Main/CMakeLists.txt +++ b/src/SFML/Main/CMakeLists.txt @@ -30,7 +30,7 @@ if(SFML_OS_ANDROID) target_link_libraries(sfml-main PRIVATE android) # Ensure this method is not stripped - ...
[ "src/SFML/Main/CMakeLists.txt" ]
[]
true
SFML/SFML
3,691
issue_to_patch
Added support for retrieving the library version that is loaded at runtime via sf::version()
Title. If application code relies on the `SFML_VERSION_` `#define`s to output the library version during runtime e.g. for diagnostic or error reporting purposes it will always output the version of the headers that were included when the application was built. When running an application that is dynamically linked, ...
9120eeb6a36186961b80efece608caaba606d64e
bc6f11261ac5996173b0060af7dbac71e03cf115
diff --git a/examples/text/Text.cpp b/examples/text/Text.cpp index b459fbfc86..3c173f8a7b 100644 --- a/examples/text/Text.cpp +++ b/examples/text/Text.cpp @@ -15,14 +15,6 @@ #include <cmath> -#define STR_HELPER(x) #x -#define STR(x) STR_HELPER(x) - -// SFML version string wrapped in unicode directional form...
[ "examples/text/Text.cpp", "include/SFML/System.hpp", "include/SFML/System/Version.hpp", "src/SFML/Network/TcpSocket.cpp", "src/SFML/System/CMakeLists.txt", "src/SFML/System/Version.cpp", "test/System/CMakeLists.txt", "test/System/Version.test.cpp" ]
[ { "comment": "Just like the Config.hpp tests, we can get the exact version numbers from CMake to make these tests more precise.", "path": "test/System/Version.test.cpp", "hunk": "@@ -0,0 +1,12 @@\n+#include <SFML/System/Version.hpp>\n+\n+#include <catch2/catch_test_macros.hpp>\n+\n+TEST_CASE(\"[System] ...
diff --git a/test/System/CMakeLists.txt b/test/System/CMakeLists.txt index 5647ebef45..7cc632b95d 100644 --- a/test/System/CMakeLists.txt +++ b/test/System/CMakeLists.txt @@ -13,6 +13,7 @@ set(SYSTEM_SRC Utf.test.cpp Vector2.test.cpp Vector3.test.cpp + Version.test.cpp ) sfml_add_test(test-sfml-syst...
true
SFML/SFML
3,691
comment_to_fix
Added support for retrieving the library version that is loaded at runtime via sf::version()
Just like the Config.hpp tests, we can get the exact version numbers from CMake to make these tests more precise.
9120eeb6a36186961b80efece608caaba606d64e
bc6f11261ac5996173b0060af7dbac71e03cf115
diff --git a/test/System/Version.test.cpp b/test/System/Version.test.cpp new file mode 100644 index 0000000000..02d071135f --- /dev/null +++ b/test/System/Version.test.cpp @@ -0,0 +1,23 @@ +#include <SFML/System/Version.hpp> + +#include <catch2/catch_test_macros.hpp> + +TEST_CASE("[System] sf::version") +{ + const a...
[ "test/System/Version.test.cpp" ]
[ { "comment": "Just like the Config.hpp tests, we can get the exact version numbers from CMake to make these tests more precise.", "path": "test/System/Version.test.cpp", "hunk": "@@ -0,0 +1,12 @@\n+#include <SFML/System/Version.hpp>\n+\n+#include <catch2/catch_test_macros.hpp>\n+\n+TEST_CASE(\"[System] ...
true
SFML/SFML
3,691
comment_to_fix
Added support for retrieving the library version that is loaded at runtime via sf::version()
I’d slightly prefer omitting `-release` from official releases, but I can live with this.
9120eeb6a36186961b80efece608caaba606d64e
bc6f11261ac5996173b0060af7dbac71e03cf115
diff --git a/src/SFML/System/Version.cpp b/src/SFML/System/Version.cpp new file mode 100644 index 0000000000..020f021c0c --- /dev/null +++ b/src/SFML/System/Version.cpp @@ -0,0 +1,50 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007...
[ "src/SFML/System/Version.cpp" ]
[ { "comment": "I’d slightly prefer omitting `-release` from official releases, but I can live with this.", "path": "src/SFML/System/Version.cpp", "hunk": "@@ -0,0 +1,50 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+// Copyright (C)...
true
SFML/SFML
3,691
comment_to_fix
Added support for retrieving the library version that is loaded at runtime via sf::version()
Maybe use a smaller int type to micro optimize memory usage and because SFML will likely not reach major version numbers greater than 255 😅 Fixed width ints are marginally more ABI stable which is usually not something I’d think twice about, but this API is motivated by a use case that relies on stable-ish ABIs so it...
9120eeb6a36186961b80efece608caaba606d64e
bc6f11261ac5996173b0060af7dbac71e03cf115
diff --git a/include/SFML/System/Version.hpp b/include/SFML/System/Version.hpp new file mode 100644 index 0000000000..ebcd5f22b5 --- /dev/null +++ b/include/SFML/System/Version.hpp @@ -0,0 +1,71 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyri...
[ "include/SFML/System/Version.hpp" ]
[ { "comment": "Maybe use a smaller int type to micro optimize memory usage and because SFML will likely not reach major version numbers greater than 255 😅\n\nFixed width ints are marginally more ABI stable which is usually not something I’d think twice about, but this API is motivated by a use case that relies ...
true
SFML/SFML
3,691
comment_to_fix
Added support for retrieving the library version that is loaded at runtime via sf::version()
Does this clang-tidy check fire even when using the codepoint inside a string? The docs are a bit light on this check so it’s hard to tell how it behaves inside of strings. It only provides an example of using this outside of a string.
9120eeb6a36186961b80efece608caaba606d64e
bc6f11261ac5996173b0060af7dbac71e03cf115
diff --git a/examples/text/Text.cpp b/examples/text/Text.cpp index b459fbfc86..3c173f8a7b 100644 --- a/examples/text/Text.cpp +++ b/examples/text/Text.cpp @@ -15,14 +15,6 @@ #include <cmath> -#define STR_HELPER(x) #x -#define STR(x) STR_HELPER(x) - -// SFML version string wrapped in unicode directional form...
[ "examples/text/Text.cpp" ]
[ { "comment": "Does this clang-tidy check fire even when using the codepoint inside a string? The docs are a bit light on this check so it’s hard to tell how it behaves inside of strings. It only provides an example of using this outside of a string.", "path": "examples/text/Text.cpp", "hunk": "@@ -37,6 ...
true
SFML/SFML
3,691
comment_to_fix
Added support for retrieving the library version that is loaded at runtime via sf::version()
This macro is not used anymore.
9120eeb6a36186961b80efece608caaba606d64e
bc6f11261ac5996173b0060af7dbac71e03cf115
diff --git a/src/SFML/Network/TcpSocket.cpp b/src/SFML/Network/TcpSocket.cpp index 52703b9a4a..f0533dbef9 100644 --- a/src/SFML/Network/TcpSocket.cpp +++ b/src/SFML/Network/TcpSocket.cpp @@ -33,6 +33,7 @@ #include <SFML/System/Err.hpp> #include <SFML/System/String.hpp> +#include <SFML/System/Version.hpp> #includ...
[ "src/SFML/Network/TcpSocket.cpp" ]
[ { "comment": "This macro is not used anymore.", "path": "src/SFML/Network/TcpSocket.cpp", "hunk": "@@ -323,9 +324,8 @@ struct MbedTlsSharedState\n #define SFML_NUMBER_TO_STRING_HELPER(x) #x\n #define SFML_NUMBER_TO_STRING(x) SFML_NUMBER_TO_STRING_HELPER(x)", "resolving_sha": "bc6f11261ac59961...
true
SFML/SFML
3,691
comment_to_fix
Added support for retrieving the library version that is loaded at runtime via sf::version()
```suggestion /// which SFML version is currently loaded at runtime, it ```
9120eeb6a36186961b80efece608caaba606d64e
bc6f11261ac5996173b0060af7dbac71e03cf115
diff --git a/include/SFML/System/Version.hpp b/include/SFML/System/Version.hpp new file mode 100644 index 0000000000..ebcd5f22b5 --- /dev/null +++ b/include/SFML/System/Version.hpp @@ -0,0 +1,71 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyri...
[ "include/SFML/System/Version.hpp" ]
[ { "comment": "```suggestion\n/// which SFML version is currently loaded at runtime, it\n```", "path": "include/SFML/System/Version.hpp", "hunk": "@@ -0,0 +1,71 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+// Copyright (C) 2007-20...
true
SFML/SFML
3,695
issue_to_patch
SocketSelector test fails with the default open file descriptor limit ### Prerequisite Checklist - [x] I searched for [existing issues](https://github.com/search?q=repo%3ASFML%2FSFML&type=issues) to prevent duplicates - [x] I searched for [existing discussions on the forum](https://www.google.com/search?q=site%3Ahttp...
Allow configuring the maximum number of file descriptors opened during network tests
Title. Some users might have their ulimit for nofds set to the common value of 1024. This means that a single process cannot open more than 1024 file descriptors (this includes sockets). The recently added socket selector tests assumed that this limit would be increased by users who intended to run those tests on th...
9120eeb6a36186961b80efece608caaba606d64e
27d6e4c2edc2cf56abe8f7d56cfec1406642f455
diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index 7fe8e4d60a..6f686d6ca6 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -59,7 +59,7 @@ jobs: echo "$(brew --prefix llvm@18)/bin" >> $GITHUB_PATH - name: Configure - run: cmake --preset ...
[ ".github/workflows/analyze.yml", ".github/workflows/build.yml", "test/Network/CMakeLists.txt", "test/Network/SocketSelector.test.cpp" ]
[ { "comment": "Is it okay to use `std::cout` in a test? Does Catch2 provide a \"logging\" interface?", "path": "test/Network/SocketSelector.test.cpp", "hunk": "@@ -36,8 +37,12 @@ TEST_CASE(\"[Network] sf::SocketSelector\")\n \n TEST_CASE(\"[Network] sf::SocketSelector Many Connections\", runIpV4LoopbackT...
diff --git a/test/Network/CMakeLists.txt b/test/Network/CMakeLists.txt index 83b69737f7..7e8a11c83e 100644 --- a/test/Network/CMakeLists.txt +++ b/test/Network/CMakeLists.txt @@ -13,6 +13,10 @@ set(NETWORK_SRC UdpSocket.test.cpp ) sfml_add_test(test-sfml-network "${NETWORK_SRC}" SFML::Network) + +sfml_set_option...
true
SFML/SFML
3,695
comment_to_fix
Allow configuring the maximum number of file descriptors opened during network tests
Is it okay to use `std::cout` in a test? Does Catch2 provide a "logging" interface?
9120eeb6a36186961b80efece608caaba606d64e
27d6e4c2edc2cf56abe8f7d56cfec1406642f455
diff --git a/test/Network/SocketSelector.test.cpp b/test/Network/SocketSelector.test.cpp index b8d86e63e6..39b3f3201c 100644 --- a/test/Network/SocketSelector.test.cpp +++ b/test/Network/SocketSelector.test.cpp @@ -9,6 +9,7 @@ #include <NetworkUtil.hpp> #include <algorithm> +#include <iostream> #include <list> #i...
[ "test/Network/SocketSelector.test.cpp" ]
[ { "comment": "Is it okay to use `std::cout` in a test? Does Catch2 provide a \"logging\" interface?", "path": "test/Network/SocketSelector.test.cpp", "hunk": "@@ -36,8 +37,12 @@ TEST_CASE(\"[Network] sf::SocketSelector\")\n \n TEST_CASE(\"[Network] sf::SocketSelector Many Connections\", runIpV4LoopbackT...
true
SFML/SFML
3,695
comment_to_fix
Allow configuring the maximum number of file descriptors opened during network tests
Should we have a fallback in C++ code or is it good enough to rely on CMake providing the def?
9120eeb6a36186961b80efece608caaba606d64e
27d6e4c2edc2cf56abe8f7d56cfec1406642f455
diff --git a/test/Network/SocketSelector.test.cpp b/test/Network/SocketSelector.test.cpp index b8d86e63e6..39b3f3201c 100644 --- a/test/Network/SocketSelector.test.cpp +++ b/test/Network/SocketSelector.test.cpp @@ -9,6 +9,7 @@ #include <NetworkUtil.hpp> #include <algorithm> +#include <iostream> #include <list> #i...
[ "test/Network/SocketSelector.test.cpp" ]
[ { "comment": "Should we have a fallback in C++ code or is it good enough to rely on CMake providing the def?", "path": "test/Network/SocketSelector.test.cpp", "hunk": "@@ -36,8 +37,12 @@ TEST_CASE(\"[Network] sf::SocketSelector\")\n \n TEST_CASE(\"[Network] sf::SocketSelector Many Connections\", runIpV4...
true
SFML/SFML
3,684
issue_to_patch
(Linux) Window Close Event not triggered with sf::Style None, Titlebar, Resize ### Prerequisite Checklist - [X] I searched for [existing issues](https://github.com/search?q=repo%3ASFML%2FSFML&type=issues) to prevent duplicates - [X] I searched for [existing discussions on the forum](https://www.google.com/search?q=si...
Fixed and improved multiple issues with the X11 window implementation.
From the commit message: - Removed forced centering of windows when they are created (the implementation was broken anyway) - Make use of `PPosition` instead of `USPosition` when we have to set the fullscreen window position - Fixed window properties being completely overwritten when only a subset of their fiel...
140be9c2f44f0733a3c40700bc3ec4b2bf8041f2
0a1b0fad68c4136379598873039a5d66383052da
diff --git a/include/SFML/Window/WindowEnums.hpp b/include/SFML/Window/WindowEnums.hpp index cd9a8fb94d..c52abf5473 100644 --- a/include/SFML/Window/WindowEnums.hpp +++ b/include/SFML/Window/WindowEnums.hpp @@ -33,13 +33,18 @@ namespace Style /// \ingroup window /// \brief Enumeration of the window styles /// +/// N...
[ "include/SFML/Window/WindowEnums.hpp", "src/SFML/Window/Unix/WindowImplX11.cpp", "src/SFML/Window/Unix/WindowImplX11.hpp" ]
[]
true
SFML/SFML
3,687
issue_to_patch
Use `generic_string()` instead on libssh2 calls
<!-- Thanks a lot for making a contribution to SFML! 🙂 Please make sure you are targetting the correct branch. No more features are planned for the 2.x branches! (See [the readme](https://github.com/SFML/SFML#state-of-development)) Before creating the pull request, we ask you to check the following boxes: (For ...
140be9c2f44f0733a3c40700bc3ec4b2bf8041f2
0dd58c4f2dc5d68960d9cf45719387adf68d5cb2
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp index a789194129..cc74750d18 100644 --- a/src/SFML/Network/Sftp.cpp +++ b/src/SFML/Network/Sftp.cpp @@ -81,6 +81,23 @@ struct SftpSessionDeleter } }; +// Portable UTF-8 string conversions for C++17/C++20 compatibility +// See: https://www.open-s...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "All of this could probably be replaced by a simple template function.\n```cpp\ntemplate <typename T>\nstd::string fromUtf8String(const T& s)\n{\n return std::string(s.begin(), s.end());\n}\n```\nThe reason why they provide 3 overloads in the paper is because they were trying to optimize perform...
true
SFML/SFML
3,687
comment_to_fix
Use `generic_string()` instead on libssh2 calls
All of this could probably be replaced by a simple template function. ```cpp template <typename T> std::string fromUtf8String(const T& s) { return std::string(s.begin(), s.end()); } ``` The reason why they provide 3 overloads in the paper is because they were trying to optimize performance in every scenario. Since ...
140be9c2f44f0733a3c40700bc3ec4b2bf8041f2
0dd58c4f2dc5d68960d9cf45719387adf68d5cb2
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp index a789194129..cc74750d18 100644 --- a/src/SFML/Network/Sftp.cpp +++ b/src/SFML/Network/Sftp.cpp @@ -81,6 +81,23 @@ struct SftpSessionDeleter } }; +// Portable UTF-8 string conversions for C++17/C++20 compatibility +// See: https://www.open-s...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "All of this could probably be replaced by a simple template function.\n```cpp\ntemplate <typename T>\nstd::string fromUtf8String(const T& s)\n{\n return std::string(s.begin(), s.end());\n}\n```\nThe reason why they provide 3 overloads in the paper is because they were trying to optimize perform...
true
SFML/SFML
3,687
comment_to_fix
Use `generic_string()` instead on libssh2 calls
Because `char8_t` and thus `std::u8string` didn't exist yet in C++17, the standard provided another way for developers to inform `std::filesystem` that the path should be constructed from UTF-8 input: `std::filesystem::u8path`. `std::filesystem::u8path` is deprecated in C++20 for obviously reasons, but in C++17 it is t...
140be9c2f44f0733a3c40700bc3ec4b2bf8041f2
0dd58c4f2dc5d68960d9cf45719387adf68d5cb2
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp index a789194129..cc74750d18 100644 --- a/src/SFML/Network/Sftp.cpp +++ b/src/SFML/Network/Sftp.cpp @@ -81,6 +81,23 @@ struct SftpSessionDeleter } }; +// Portable UTF-8 string conversions for C++17/C++20 compatibility +// See: https://www.open-s...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "Because `char8_t` and thus `std::u8string` didn't exist yet in C++17, the standard provided another way for developers to inform `std::filesystem` that the path should be constructed from UTF-8 input: `std::filesystem::u8path`. `std::filesystem::u8path` is deprecated in C++20 for obviously reasons...
true
SFML/SFML
3,687
comment_to_fix
Use `generic_string()` instead on libssh2 calls
This function could also take a `std::string_view` instead of `const std::string&`. This allows us to save constructing a temporary `std::string` object when constructing the path from a data buffer as we do in this file.
140be9c2f44f0733a3c40700bc3ec4b2bf8041f2
0dd58c4f2dc5d68960d9cf45719387adf68d5cb2
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp index a789194129..cc74750d18 100644 --- a/src/SFML/Network/Sftp.cpp +++ b/src/SFML/Network/Sftp.cpp @@ -81,6 +81,23 @@ struct SftpSessionDeleter } }; +// Portable UTF-8 string conversions for C++17/C++20 compatibility +// See: https://www.open-s...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "This function could also take a `std::string_view` instead of `const std::string&`. This allows us to save constructing a temporary `std::string` object when constructing the path from a data buffer as we do in this file.", "path": "src/SFML/Network/Sftp.cpp", "hunk": "@@ -81,6 +81,34 @@ s...
true
SFML/SFML
3,687
comment_to_fix
Use `generic_string()` instead on libssh2 calls
We could pass a `std::string_view` instead of `std::string` here.
140be9c2f44f0733a3c40700bc3ec4b2bf8041f2
0dd58c4f2dc5d68960d9cf45719387adf68d5cb2
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp index a789194129..cc74750d18 100644 --- a/src/SFML/Network/Sftp.cpp +++ b/src/SFML/Network/Sftp.cpp @@ -81,6 +81,23 @@ struct SftpSessionDeleter } }; +// Portable UTF-8 string conversions for C++17/C++20 compatibility +// See: https://www.open-s...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "We could pass a `std::string_view` instead of `std::string` here.", "path": "src/SFML/Network/Sftp.cpp", "hunk": "@@ -865,14 +882,14 @@ Sftp::PathResult Sftp::resolvePath(const std::filesystem::path& path, const Time\n if (result < 0)\n return {makeError(m_impl->ssh2Session.get...
true
SFML/SFML
3,687
comment_to_fix
Use `generic_string()` instead on libssh2 calls
We could pass a `std::string_view` instead of `std::string` here.
140be9c2f44f0733a3c40700bc3ec4b2bf8041f2
0dd58c4f2dc5d68960d9cf45719387adf68d5cb2
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp index a789194129..cc74750d18 100644 --- a/src/SFML/Network/Sftp.cpp +++ b/src/SFML/Network/Sftp.cpp @@ -81,6 +81,23 @@ struct SftpSessionDeleter } }; +// Portable UTF-8 string conversions for C++17/C++20 compatibility +// See: https://www.open-s...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "We could pass a `std::string_view` instead of `std::string` here.", "path": "src/SFML/Network/Sftp.cpp", "hunk": "@@ -955,8 +972,9 @@ Sftp::ListingResult Sftp::getDirectoryListing(const std::filesystem::path& path,\n \n if (result > 0)\n {\n+ // The f...
true
SFML/SFML
3,681
issue_to_patch
[macOS] Heap-buffer-overflow in JoystickImpl / stringFromCFString when joystick is connected ### Prerequisite Checklist - [x] I searched for [existing issues](https://github.com/search?q=repo%3ASFML%2FSFML&type=issues) to prevent duplicates - [x] I searched for [existing discussions on the forum](https://www.google.c...
Fixed allocated buffer being too small when converting CFStringRef to std::string in the macOS joystick implementation.
Title. `CFStringGetLength()` retrieves the string length in UTF-16 codepoints. `CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8)` retrieves the maximum UTF-8 byte count of the UTF-16 string. If we use the UTF-16 length to allocate a buffer into which we write up to UTF-8 length bytes we will over...
c267bbaa908e39ca60ca78202f1f80f9598ce094
3dd39403d3a2b7b170e925bb7de773940356d187
diff --git a/src/SFML/Window/macOS/JoystickImpl.cpp b/src/SFML/Window/macOS/JoystickImpl.cpp index 1aab576430..030a1c83a0 100644 --- a/src/SFML/Window/macOS/JoystickImpl.cpp +++ b/src/SFML/Window/macOS/JoystickImpl.cpp @@ -43,9 +43,8 @@ namespace // Convert a CFStringRef to std::string std::string stringFromCFString(...
[ "src/SFML/Window/macOS/JoystickImpl.cpp" ]
[]
true
SFML/SFML
3,675
issue_to_patch
Added support for SFTP as a replacement for FTP
Title. There are numerous problems/limitations of FTP (without extensions): - FTP was not designed to be a secure protocol, both the control and data streams are unencrypted and unauthenticated - When the data stream is opened using the PASV command (which is what SFML currently uses), IPv6 is not supported - FTP...
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/.clang-format b/.clang-format index b67ec43da3..3f7116035d 100644 --- a/.clang-format +++ b/.clang-format @@ -112,7 +112,7 @@ IncludeCategories: - Priority: 8 Regex: '^<SFML\/System' - Priority: 9 - Regex: '^<(glad|gl|X11|jni|android|stb_|GLES2|vorbis|miniaudio|catch2)' + Regex: '^<(glad|g...
[ ".clang-format", ".github/workflows/analyze.yml", ".github/workflows/build.yml", "cmake/Modules/FindLibssh2.cmake", "examples/CMakeLists.txt", "examples/ftp/Ftp.cpp", "examples/sftp/CMakeLists.txt", "examples/sftp/Sftp.cpp", "include/SFML/Network.hpp", "include/SFML/Network/Ftp.hpp", "include/SF...
[ { "comment": "[possible scoping issue] Should this not be `target_sources`?", "path": "examples/sftp/CMakeLists.txt", "hunk": "@@ -0,0 +1,7 @@\n+# all source files\n+set(SRC Sftp.cpp)", "resolving_sha": "c33977a7e4e78d6d368598e1a6063aea606abd66", "resolving_diff": "diff --git a/examples/sftp/CMa...
diff --git a/test/Network/CMakeLists.txt b/test/Network/CMakeLists.txt index 483c826d3c..83b69737f7 100644 --- a/test/Network/CMakeLists.txt +++ b/test/Network/CMakeLists.txt @@ -4,6 +4,7 @@ set(NETWORK_SRC Http.test.cpp IpAddress.test.cpp Packet.test.cpp + Sftp.test.cpp Socket.test.cpp Sock...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
[possible scoping issue] Should this not be `target_sources`?
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/examples/sftp/CMakeLists.txt b/examples/sftp/CMakeLists.txt new file mode 100644 index 0000000000..2d2865c070 --- /dev/null +++ b/examples/sftp/CMakeLists.txt @@ -0,0 +1,7 @@ +# all source files +set(SRC Sftp.cpp) + +# define the sftp target +sfml_add_example(sftp + SOURCES ${SRC} + ...
[ "examples/sftp/CMakeLists.txt" ]
[ { "comment": "[possible scoping issue] Should this not be `target_sources`?", "path": "examples/sftp/CMakeLists.txt", "hunk": "@@ -0,0 +1,7 @@\n+# all source files\n+set(SRC Sftp.cpp)", "resolving_sha": "c33977a7e4e78d6d368598e1a6063aea606abd66", "resolving_diff": "diff --git a/examples/sftp/CMa...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
[nitpick] perhaps not the best choice of signal number given it's often used to Control + C out of a program (should this somehow get stuck).
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/examples/sftp/Sftp.cpp b/examples/sftp/Sftp.cpp new file mode 100644 index 0000000000..2c3858deb3 --- /dev/null +++ b/examples/sftp/Sftp.cpp @@ -0,0 +1,461 @@ +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <S...
[ "examples/sftp/Sftp.cpp" ]
[ { "comment": "[nitpick] perhaps not the best choice of signal number given it's often used to Control + C out of a program (should this somehow get stuck).", "path": "examples/sftp/Sftp.cpp", "hunk": "@@ -0,0 +1,454 @@\n+////////////////////////////////////////////////////////////\n+// Headers\n+///////...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
[opinion] it's generally better to avoid default captures so that it's clear what a lambda is using.
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/examples/sftp/Sftp.cpp b/examples/sftp/Sftp.cpp new file mode 100644 index 0000000000..2c3858deb3 --- /dev/null +++ b/examples/sftp/Sftp.cpp @@ -0,0 +1,461 @@ +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include <S...
[ "examples/sftp/Sftp.cpp" ]
[ { "comment": "[opinion] it's generally better to avoid default captures so that it's clear what a lambda is using.", "path": "examples/sftp/Sftp.cpp", "hunk": "@@ -0,0 +1,454 @@\n+////////////////////////////////////////////////////////////\n+// Headers\n+////////////////////////////////////////////////...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
I'd argue this class should be either: - marked as `final` - given a virtual destructor - given a protected destructor Otherwise anyone deriving from this and deleting a base pointer is going hit UB. This is probably also a style issue (it's not in the style guide but might want to be), so I'd be interested in the in...
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/include/SFML/Network/Sftp.hpp b/include/SFML/Network/Sftp.hpp new file mode 100644 index 0000000000..9be101d562 --- /dev/null +++ b/include/SFML/Network/Sftp.hpp @@ -0,0 +1,987 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (...
[ "include/SFML/Network/Sftp.hpp" ]
[ { "comment": "I'd argue this class should be either:\n- marked as `final`\n- given a virtual destructor\n- given a protected destructor\n\nOtherwise anyone deriving from this and deleting a base pointer is going hit UB.\n\nThis is probably also a style issue (it's not in the style guide but might want to be), s...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
There's some potential UB on the user's side here since Result doesn't have a virtual or protected destructor. See other comment for more info. Other types have a similar issue.
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/include/SFML/Network/Sftp.hpp b/include/SFML/Network/Sftp.hpp new file mode 100644 index 0000000000..9be101d562 --- /dev/null +++ b/include/SFML/Network/Sftp.hpp @@ -0,0 +1,987 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (...
[ "include/SFML/Network/Sftp.hpp" ]
[ { "comment": "There's some potential UB on the user's side here since Result doesn't have a virtual or protected destructor. See other comment for more info.\n\nOther types have a similar issue.", "path": "include/SFML/Network/Sftp.hpp", "hunk": "@@ -0,0 +1,998 @@\n+/////////////////////////////////////...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
Should this be marked as explicit?
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/include/SFML/Network/Sftp.hpp b/include/SFML/Network/Sftp.hpp new file mode 100644 index 0000000000..9be101d562 --- /dev/null +++ b/include/SFML/Network/Sftp.hpp @@ -0,0 +1,987 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (...
[ "include/SFML/Network/Sftp.hpp" ]
[ { "comment": "Should this be marked as explicit?", "path": "include/SFML/Network/Sftp.hpp", "hunk": "@@ -0,0 +1,998 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+// Copyright (C) 2007-2025 Laurent Gomila (laurent@sfml-dev.org)\n+/...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
You should include a deleted copy constructor as well.
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/include/SFML/Network/Sftp.hpp b/include/SFML/Network/Sftp.hpp new file mode 100644 index 0000000000..9be101d562 --- /dev/null +++ b/include/SFML/Network/Sftp.hpp @@ -0,0 +1,987 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (...
[ "include/SFML/Network/Sftp.hpp" ]
[ { "comment": "You should include a deleted copy constructor as well.", "path": "include/SFML/Network/Sftp.hpp", "hunk": "@@ -0,0 +1,998 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+// Copyright (C) 2007-2025 Laurent Gomila (laure...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
It might be wise to decide how to move operations should work since you're declaring the related copy operations too.
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/include/SFML/Network/Sftp.hpp b/include/SFML/Network/Sftp.hpp new file mode 100644 index 0000000000..9be101d562 --- /dev/null +++ b/include/SFML/Network/Sftp.hpp @@ -0,0 +1,987 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (...
[ "include/SFML/Network/Sftp.hpp" ]
[ { "comment": "It might be wise to decide how to move operations should work since you're declaring the related copy operations too.", "path": "include/SFML/Network/Sftp.hpp", "hunk": "@@ -0,0 +1,998 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multim...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
Better to use a string_view here and for the private key data.
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/include/SFML/Network/Sftp.hpp b/include/SFML/Network/Sftp.hpp new file mode 100644 index 0000000000..9be101d562 --- /dev/null +++ b/include/SFML/Network/Sftp.hpp @@ -0,0 +1,987 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (...
[ "include/SFML/Network/Sftp.hpp" ]
[ { "comment": "Better to use a string_view here and for the private key data.", "path": "include/SFML/Network/Sftp.hpp", "hunk": "@@ -0,0 +1,998 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+// Copyright (C) 2007-2025 Laurent Gomil...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
This is unbounded and could result in buffer overruns.
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/include/SFML/Network/Sftp.hpp b/include/SFML/Network/Sftp.hpp new file mode 100644 index 0000000000..9be101d562 --- /dev/null +++ b/include/SFML/Network/Sftp.hpp @@ -0,0 +1,987 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (...
[ "include/SFML/Network/Sftp.hpp" ]
[ { "comment": "This is unbounded and could result in buffer overruns.", "path": "include/SFML/Network/Sftp.hpp", "hunk": "@@ -0,0 +1,998 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+// Copyright (C) 2007-2025 Laurent Gomila (laure...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
Considering this section is RE shared libraries, how come you're referring to the static lib here?
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/src/SFML/Network/CMakeLists.txt b/src/SFML/Network/CMakeLists.txt index 076b4459e9..d62e802b76 100644 --- a/src/SFML/Network/CMakeLists.txt +++ b/src/SFML/Network/CMakeLists.txt @@ -14,6 +14,8 @@ set(SRC ${INCROOT}/IpAddress.hpp ${SRCROOT}/Packet.cpp ${INCROOT}/Packet.hpp + ${SRCROOT}/Sft...
[ "src/SFML/Network/CMakeLists.txt" ]
[ { "comment": "Considering this section is RE shared libraries, how come you're referring to the static lib here?", "path": "src/SFML/Network/CMakeLists.txt", "hunk": "@@ -78,23 +82,55 @@ else()\n FetchContent_MakeAvailable(MbedTLS)\n endblock()\n \n- set_target_properties(mbedtls mbedcryp...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
I would move these into their own headers - reviewing is quite difficult with it all lumped together.
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/include/SFML/Network/Sftp.hpp b/include/SFML/Network/Sftp.hpp new file mode 100644 index 0000000000..9be101d562 --- /dev/null +++ b/include/SFML/Network/Sftp.hpp @@ -0,0 +1,987 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (...
[ "include/SFML/Network/Sftp.hpp" ]
[ { "comment": "I would move these into their own headers - reviewing is quite difficult with it all lumped together.", "path": "include/SFML/Network/Sftp.hpp", "hunk": "@@ -0,0 +1,998 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+/...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
Why not use the enum instead? If there's a good reason, you should static_assert instead of a comment. This will help make sure it's always true / doesn't rot over time, unlikely as that may be.
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp new file mode 100644 index 0000000000..95ab95a45e --- /dev/null +++ b/src/SFML/Network/Sftp.cpp @@ -0,0 +1,1347 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-202...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "Why not use the enum instead?\nIf there's a good reason, you should static_assert instead of a comment.\nThis will help make sure it's always true / doesn't rot over time, unlikely as that may be.", "path": "src/SFML/Network/Sftp.cpp", "hunk": "@@ -0,0 +1,1377 @@\n+////////////////////////...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
This function / pattern is far more complex than it needs to be. We don't need a special object to store the initialisation, although I think I see the purpose of the mutex given we don't know what the client code will do and libssh2_init is not thread safe. However, it would be much easier to reason about by... - re...
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp new file mode 100644 index 0000000000..95ab95a45e --- /dev/null +++ b/src/SFML/Network/Sftp.cpp @@ -0,0 +1,1347 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-202...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "This function / pattern is far more complex than it needs to be.\n\nWe don't need a special object to store the initialisation, although I think I see the purpose of the mutex given we don't know what the client code will do and libssh2_init is not thread safe.\n\nHowever, it would be much easier ...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
This is a bit obtuse to read and there's more standard ones available. I think this should be replaced with `std::filesystem::perm_options`. This reduces the risk of small typos completely changing the meaning, esp. in such a dense piece of code.
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp new file mode 100644 index 0000000000..95ab95a45e --- /dev/null +++ b/src/SFML/Network/Sftp.cpp @@ -0,0 +1,1347 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-202...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "This is a bit obtuse to read and there's more standard ones available. I think this should be replaced with `std::filesystem::perm_options`. This reduces the risk of small typos completely changing the meaning, esp. in such a dense piece of code.", "path": "src/SFML/Network/Sftp.cpp", "hun...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
How come?
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/src/SFML/Network/CMakeLists.txt b/src/SFML/Network/CMakeLists.txt index 076b4459e9..d62e802b76 100644 --- a/src/SFML/Network/CMakeLists.txt +++ b/src/SFML/Network/CMakeLists.txt @@ -14,6 +14,8 @@ set(SRC ${INCROOT}/IpAddress.hpp ${SRCROOT}/Packet.cpp ${INCROOT}/Packet.hpp + ${SRCROOT}/Sft...
[ "src/SFML/Network/CMakeLists.txt" ]
[ { "comment": "How come?", "path": "src/SFML/Network/CMakeLists.txt", "hunk": "@@ -69,6 +72,7 @@ else()\n URL https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-3.6.5/mbedtls-3.6.5.tar.bz2\n URL_HASH SHA256=4a11f1777bb95bf4ad96721cac945a26e04bf19f57d905f241fe77ebeddf46d...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
these should be scoped to a target
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/src/SFML/Network/CMakeLists.txt b/src/SFML/Network/CMakeLists.txt index 076b4459e9..d62e802b76 100644 --- a/src/SFML/Network/CMakeLists.txt +++ b/src/SFML/Network/CMakeLists.txt @@ -14,6 +14,8 @@ set(SRC ${INCROOT}/IpAddress.hpp ${SRCROOT}/Packet.cpp ${INCROOT}/Packet.hpp + ${SRCROOT}/Sft...
[ "src/SFML/Network/CMakeLists.txt" ]
[ { "comment": "these should be scoped to a target", "path": "src/SFML/Network/CMakeLists.txt", "hunk": "@@ -78,23 +82,55 @@ else()\n FetchContent_MakeAvailable(MbedTLS)\n endblock()\n \n- set_target_properties(mbedtls mbedcrypto mbedx509 PROPERTIES FOLDER \"Dependencies\" SYSTEM ON)\n+ ...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
How come the formatting was turned off for just this line?
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp new file mode 100644 index 0000000000..95ab95a45e --- /dev/null +++ b/src/SFML/Network/Sftp.cpp @@ -0,0 +1,1347 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-202...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "How come the formatting was turned off for just this line?", "path": "src/SFML/Network/Sftp.cpp", "hunk": "@@ -0,0 +1,1377 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+// Copyright (C) 2007-2025 Laurent Gomila (laur...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
Do we need to take into account sender vs. receiver time zone here?
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp new file mode 100644 index 0000000000..95ab95a45e --- /dev/null +++ b/src/SFML/Network/Sftp.cpp @@ -0,0 +1,1347 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-202...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "Do we need to take into account sender vs. receiver time zone here?", "path": "src/SFML/Network/Sftp.cpp", "hunk": "@@ -0,0 +1,1377 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+// Copyright (C) 2007-2025 Laurent Gom...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
This error message could be more precise; we know we've got a nullptr.
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp new file mode 100644 index 0000000000..95ab95a45e --- /dev/null +++ b/src/SFML/Network/Sftp.cpp @@ -0,0 +1,1347 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-202...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "This error message could be more precise; we know we've got a nullptr.", "path": "src/SFML/Network/Sftp.cpp", "hunk": "@@ -0,0 +1,1377 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+// Copyright (C) 2007-2025 Laurent ...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
When would you not want to pass the sftp pointer? Would it be better to use an optional here rather than nullptr; easier to spot that it might not have a value later down the line.
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp new file mode 100644 index 0000000000..95ab95a45e --- /dev/null +++ b/src/SFML/Network/Sftp.cpp @@ -0,0 +1,1347 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-202...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "When would you not want to pass the sftp pointer?\nWould it be better to use an optional here rather than nullptr; easier to spot that it might not have a value later down the line.", "path": "src/SFML/Network/Sftp.cpp", "hunk": "@@ -0,0 +1,1377 @@\n+///////////////////////////////////////...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
Given it's deferenced immediately, `implPtr` should be a ref to a pointer instead of a pointer to a pointer.
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp new file mode 100644 index 0000000000..95ab95a45e --- /dev/null +++ b/src/SFML/Network/Sftp.cpp @@ -0,0 +1,1347 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-202...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "Given it's deferenced immediately, `implPtr` should be a ref to a pointer instead of a pointer to a pointer.", "path": "src/SFML/Network/Sftp.cpp", "hunk": "@@ -0,0 +1,1377 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
Downstream users might want to use mutable lambdas here, so a non-const variant would be needed.
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp new file mode 100644 index 0000000000..95ab95a45e --- /dev/null +++ b/src/SFML/Network/Sftp.cpp @@ -0,0 +1,1347 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-202...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "Downstream users might want to use mutable lambdas here, so a non-const variant would be needed.", "path": "src/SFML/Network/Sftp.cpp", "hunk": "@@ -0,0 +1,1377 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+// Copyri...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
This is deprecated upstream. Do you think it's worth adding support given that, or better to just never add it?
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp new file mode 100644 index 0000000000..95ab95a45e --- /dev/null +++ b/src/SFML/Network/Sftp.cpp @@ -0,0 +1,1347 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-202...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "This is deprecated upstream. Do you think it's worth adding support given that, or better to just never add it?", "path": "src/SFML/Network/Sftp.cpp", "hunk": "@@ -0,0 +1,1377 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Libr...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
There's a name mismatch between DSS and DSA here.
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp new file mode 100644 index 0000000000..95ab95a45e --- /dev/null +++ b/src/SFML/Network/Sftp.cpp @@ -0,0 +1,1347 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-202...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "There's a name mismatch between DSS and DSA here.", "path": "src/SFML/Network/Sftp.cpp", "hunk": "@@ -0,0 +1,1377 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+// Copyright (C) 2007-2025 Laurent Gomila (laurent@sfml-...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
It might be preferable to only support SHA256 is both are available? It reduces the attack surface for a bad actor. SHA1 was known hash collision attacks and probably more by now.
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp new file mode 100644 index 0000000000..95ab95a45e --- /dev/null +++ b/src/SFML/Network/Sftp.cpp @@ -0,0 +1,1347 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-202...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "It might be preferable to only support SHA256 is both are available? It reduces the attack surface for a bad actor. SHA1 was known hash collision attacks and probably more by now.", "path": "src/SFML/Network/Sftp.cpp", "hunk": "@@ -0,0 +1,1377 @@\n+/////////////////////////////////////////...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
[nit] this extra nesting can be removed by just checking for this and early returning, rather than an if-else.
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp new file mode 100644 index 0000000000..95ab95a45e --- /dev/null +++ b/src/SFML/Network/Sftp.cpp @@ -0,0 +1,1347 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-202...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "[nit] this extra nesting can be removed by just checking for this and early returning, rather than an if-else.", "path": "src/SFML/Network/Sftp.cpp", "hunk": "@@ -0,0 +1,1377 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Libra...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
Do these have to be set; an empty but valid string may confuse people. Possible alternative: std::optional
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp new file mode 100644 index 0000000000..95ab95a45e --- /dev/null +++ b/src/SFML/Network/Sftp.cpp @@ -0,0 +1,1347 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-202...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "Do these have to be set; an empty but valid string may confuse people. Possible alternative: std::optional", "path": "src/SFML/Network/Sftp.cpp", "hunk": "@@ -0,0 +1,1377 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
unsigned int may be smaller than the size_t password. In extreme cases, this will lead to the uncorrect length being passed and a possible buffer overflow exploit being available. This edge case should be checked for; it's a security issue.
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp new file mode 100644 index 0000000000..95ab95a45e --- /dev/null +++ b/src/SFML/Network/Sftp.cpp @@ -0,0 +1,1347 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-202...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "unsigned int may be smaller than the size_t password. In extreme cases, this will lead to the uncorrect length being passed and a possible buffer overflow exploit being available.\n\nThis edge case should be checked for; it's a security issue.", "path": "src/SFML/Network/Sftp.cpp", "hunk":...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
any info on thread safety here requirements here?
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp new file mode 100644 index 0000000000..95ab95a45e --- /dev/null +++ b/src/SFML/Network/Sftp.cpp @@ -0,0 +1,1347 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-202...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "any info on thread safety here requirements here?", "path": "src/SFML/Network/Sftp.cpp", "hunk": "@@ -0,0 +1,1377 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+// Copyright (C) 2007-2025 Laurent Gomila (laurent@sfml-...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
need to make sure it can fit into an unsigned int, bad actor may craft a very long file path in an attack. The buffer size will limit the ways in which they can exploit that, but they may be able to find other uses.
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp new file mode 100644 index 0000000000..95ab95a45e --- /dev/null +++ b/src/SFML/Network/Sftp.cpp @@ -0,0 +1,1347 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-202...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "need to make sure it can fit into an unsigned int, bad actor may craft a very long file path in an attack. The buffer size will limit the ways in which they can exploit that, but they may be able to find other uses.", "path": "src/SFML/Network/Sftp.cpp", "hunk": "@@ -0,0 +1,1377 @@\n+/////...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
Can we avoid a network call here; is it safe to presume the cwd won't change between ops?
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp new file mode 100644 index 0000000000..95ab95a45e --- /dev/null +++ b/src/SFML/Network/Sftp.cpp @@ -0,0 +1,1347 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-202...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "Can we avoid a network call here; is it safe to presume the cwd won't change between ops?", "path": "src/SFML/Network/Sftp.cpp", "hunk": "@@ -0,0 +1,1377 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+// Copyright (C)...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
why not just use a std::array here? You can get the ptr out via .data()
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp new file mode 100644 index 0000000000..95ab95a45e --- /dev/null +++ b/src/SFML/Network/Sftp.cpp @@ -0,0 +1,1347 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-202...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "why not just use a std::array here? You can get the ptr out via .data()", "path": "src/SFML/Network/Sftp.cpp", "hunk": "@@ -0,0 +1,1377 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+// Copyright (C) 2007-2025 Laurent...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
do you think there's value in asserting the length is >= read here?
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/src/SFML/Network/Sftp.cpp b/src/SFML/Network/Sftp.cpp new file mode 100644 index 0000000000..95ab95a45e --- /dev/null +++ b/src/SFML/Network/Sftp.cpp @@ -0,0 +1,1347 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-202...
[ "src/SFML/Network/Sftp.cpp" ]
[ { "comment": "do you think there's value in asserting the length is >= read here?", "path": "src/SFML/Network/Sftp.cpp", "hunk": "@@ -0,0 +1,1377 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+// Copyright (C) 2007-2025 Laurent Gom...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
```suggestion /// \brief Connect to the specified SFTP server ```
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/include/SFML/Network/Sftp.hpp b/include/SFML/Network/Sftp.hpp new file mode 100644 index 0000000000..9be101d562 --- /dev/null +++ b/include/SFML/Network/Sftp.hpp @@ -0,0 +1,987 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (...
[ "include/SFML/Network/Sftp.hpp" ]
[ { "comment": "```suggestion\n /// \\brief Connect to the specified SFTP server\n```", "path": "include/SFML/Network/Sftp.hpp", "hunk": "@@ -0,0 +1,998 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+// Copyright (C) 2007-2025 Lau...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
Is this being fixed upstream or will users of system packages run into problems with this?
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/tools/libssh2/PatchLibssh2.cmake b/tools/libssh2/PatchLibssh2.cmake new file mode 100644 index 0000000000..9a7f1e8a8d --- /dev/null +++ b/tools/libssh2/PatchLibssh2.cmake @@ -0,0 +1,13 @@ +# Fix returning a pointer to stack memory by forcing libssh to make a copy of it instead +file(READ "${LIBSSH2_DIR}/sr...
[ "tools/libssh2/PatchLibssh2.cmake" ]
[ { "comment": "Is this being fixed upstream or will users of system packages run into problems with this?", "path": "tools/libssh2/PatchLibssh2.cmake", "hunk": "@@ -0,0 +1,13 @@\n+# Fix returning a pointer to stack memory by forcing libssh to make a copy of it instead\n+file(READ \"${LIBSSH2_DIR}/src/mbe...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
Should we have separate result sets, instead of using prefixes?
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/include/SFML/Network/Sftp.hpp b/include/SFML/Network/Sftp.hpp new file mode 100644 index 0000000000..9be101d562 --- /dev/null +++ b/include/SFML/Network/Sftp.hpp @@ -0,0 +1,987 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (...
[ "include/SFML/Network/Sftp.hpp" ]
[ { "comment": "Should we have separate result sets, instead of using prefixes?", "path": "include/SFML/Network/Sftp.hpp", "hunk": "@@ -0,0 +1,998 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+// Copyright (C) 2007-2025 Laurent Gomi...
true
SFML/SFML
3,675
comment_to_fix
Added support for SFTP as a replacement for FTP
Should we have default values? What's the use case of constructing an "empty" Result set?
ae01ab9e7137da4dce9feb4b0db52e30910499e9
c33977a7e4e78d6d368598e1a6063aea606abd66
diff --git a/include/SFML/Network/Sftp.hpp b/include/SFML/Network/Sftp.hpp new file mode 100644 index 0000000000..9be101d562 --- /dev/null +++ b/include/SFML/Network/Sftp.hpp @@ -0,0 +1,987 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (...
[ "include/SFML/Network/Sftp.hpp" ]
[ { "comment": "Should we have default values? What's the use case of constructing an \"empty\" Result set?", "path": "include/SFML/Network/Sftp.hpp", "hunk": "@@ -0,0 +1,998 @@\n+////////////////////////////////////////////////////////////\n+//\n+// SFML - Simple and Fast Multimedia Library\n+// Copyrigh...
true