Skip to content

clang-tidy fixes#478

Open
neheb wants to merge 7 commits intomfontanini:masterfrom
neheb:clang
Open

clang-tidy fixes#478
neheb wants to merge 7 commits intomfontanini:masterfrom
neheb:clang

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 <rosenp@gmail.com>
Found with google-readability-casting

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Found with readability-container-data-pointer

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Found with readability-container-size-empty

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Found with readability-inconsistent-declaration-parameter-name

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Found with performance-unnecessary-value-param

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Found with modernize-deprecated-headers

Signed-off-by: Rosen Penev <rosenp@gmail.com>
@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

Comments