Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang-tidy fixes #478

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

clang-tidy fixes #478

wants to merge 7 commits into from

Conversation

neheb
Copy link

@neheb neheb commented May 28, 2022

No description provided.

neheb added 7 commits May 28, 2022 13:48
Found with google-readability-namespace-comments

Signed-off-by: Rosen Penev <[email protected]>
Found with google-readability-casting

Signed-off-by: Rosen Penev <[email protected]>
Found with readability-container-data-pointer

Signed-off-by: Rosen Penev <[email protected]>
Found with readability-container-size-empty

Signed-off-by: Rosen Penev <[email protected]>
Found with readability-inconsistent-declaration-parameter-name

Signed-off-by: Rosen Penev <[email protected]>
Found with performance-unnecessary-value-param

Signed-off-by: Rosen Penev <[email protected]>
Found with modernize-deprecated-headers

Signed-off-by: Rosen Penev <[email protected]>
@neheb
Copy link
Author

neheb commented May 28, 2022

why is there still C++98 support?

edit: just tested. It doesn't compile with C++98 because of std::function.

edit2: fix for that:

--- a/include/tins/crypto.h
+++ b/include/tins/crypto.h
@@ -35,9 +35,6 @@
 #include <map>
 #include <string>
 #include <vector>
-#ifdef TINS_HAVE_WPA2_CALLBACKS
-    #include <functional>
-#endif // TINS_HAVE_WPA2_CALLBACKS
 #include <tins/macros.h>
 #include <tins/handshake_capturer.h>

@@ -268,8 +265,8 @@ public:
      * The first argument to the function will be the access point's SSID and
      * the second one its BSSID.
      */
-    typedef std::function<void(const std::string&,
-                               const address_type&)> ap_found_callback_type;
+    typedef void(*ap_found_callback_type)(const std::string&,
+                               const address_type&);

     /**
      * The type used to store the callback type used when a new handshake
@@ -279,9 +276,9 @@ public:
      * the second one its BSSID. The third argument will be the client's hardware
      * address.
      */
-    typedef std::function<void(const std::string&,
+    typedef void(*handshake_captured_callback_type) (const std::string&,
                                const address_type&,
-                               const address_type&)> handshake_captured_callback_type;
+                               const address_type&);

     #endif // TINS_HAVE_WPA2_CALLBACKS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant