Skip to content

Commit

Permalink
Clearer types in code rather than void pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
teusbenschop committed Jan 5, 2024
1 parent 88df824 commit 0c30f5b
Show file tree
Hide file tree
Showing 157 changed files with 171 additions and 161 deletions.
1 change: 1 addition & 0 deletions access/logic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include <filter/url.h>
#include <filter/roles.h>
#include <database/privileges.h>
#include <webserver/request.h>
using namespace std;


Expand Down
2 changes: 1 addition & 1 deletion bb/book.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ std::string bible_book_url ()

bool bible_book_acl (Webserver_Request& webserver_request)
{
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::manager ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::manager ());
}


Expand Down
2 changes: 1 addition & 1 deletion bb/chapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ std::string bible_chapter_url ()

bool bible_chapter_acl (Webserver_Request& webserver_request)
{
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::manager ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::manager ());
}


Expand Down
2 changes: 1 addition & 1 deletion bb/css.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ std::string bible_css_url ()

bool bible_css_acl (Webserver_Request& webserver_request)
{
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::translator ());
}


Expand Down
2 changes: 1 addition & 1 deletion bb/import.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ std::string bible_import_url ()

bool bible_import_acl (Webserver_Request& webserver_request)
{
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::manager ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::manager ());
}


Expand Down
2 changes: 1 addition & 1 deletion bb/manage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ std::string bible_manage_url ()

bool bible_manage_acl (Webserver_Request& webserver_request)
{
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::translator ());
}


Expand Down
2 changes: 1 addition & 1 deletion bb/order.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ std::string bible_order_url ()

bool bible_order_acl (Webserver_Request& webserver_request)
{
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::translator ());
}


Expand Down
2 changes: 1 addition & 1 deletion bb/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ std::string bible_settings_url ()

bool bible_settings_acl (Webserver_Request& webserver_request)
{
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::translator ());
}


Expand Down
2 changes: 1 addition & 1 deletion changes/change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ string changes_change_url ()

bool changes_change_acl (Webserver_Request& webserver_request)
{
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::consultant ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::consultant ());
}


Expand Down
2 changes: 1 addition & 1 deletion changes/changes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ string changes_changes_url ()

bool changes_changes_acl (Webserver_Request& webserver_request)
{
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::consultant ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::consultant ());
}


Expand Down
2 changes: 1 addition & 1 deletion changes/manage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ string changes_manage_url ()

bool changes_manage_acl (Webserver_Request& webserver_request)
{
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::manager ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::manager ());
}


Expand Down
2 changes: 1 addition & 1 deletion changes/statistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ string changes_statistics_url ()

bool changes_statistics_acl (Webserver_Request& webserver_request)
{
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::consultant ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::consultant ());
}


Expand Down
2 changes: 1 addition & 1 deletion checks/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ std::string checks_index_url ()

bool checks_index_acl (Webserver_Request& webserver_request)
{
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::translator ());
}


Expand Down
2 changes: 1 addition & 1 deletion checks/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ bool checks_settings_acl ([[maybe_unused]] Webserver_Request& webserver_request)
#ifdef HAVE_CLIENT
return true;
#else
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::manager ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::manager ());
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion checks/settingspairs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ bool checks_settingspairs_acl ([[maybe_unused]] Webserver_Request& webserver_req
#ifdef HAVE_CLIENT
return true;
#else
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::manager ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::manager ());
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion checks/settingspatterns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ bool checks_settingspatterns_acl ([[maybe_unused]] Webserver_Request& webserver_
#ifdef HAVE_CLIENT
return true;
#else
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::manager ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::manager ());
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion checks/settingssentences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ bool checks_settingssentences_acl ([[maybe_unused]] Webserver_Request& webserver
#ifdef HAVE_CLIENT
return true;
#else
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::manager ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::manager ());
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion checks/suppress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ string checks_suppress_url ()

bool checks_suppress_acl (Webserver_Request& webserver_request)
{
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::translator ());
}


Expand Down
2 changes: 1 addition & 1 deletion client/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ std::string client_index_url ()

bool client_index_acl (Webserver_Request& webserver_request)
{
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::member ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::member ());
}


Expand Down
2 changes: 1 addition & 1 deletion collaboration/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ std::string collaboration_index_url ()

bool collaboration_index_acl (Webserver_Request& webserver_request)
{
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::admin ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::admin ());
}


Expand Down
2 changes: 1 addition & 1 deletion collaboration/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ string collaboration_settings_url ()

bool collaboration_settings_acl (Webserver_Request& webserver_request)
{
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::admin ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::admin ());
}


Expand Down
2 changes: 1 addition & 1 deletion compare/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ std::string compare_index_url ()

bool compare_index_acl (Webserver_Request& webserver_request)
{
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::consultant ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::consultant ());
}


Expand Down
2 changes: 1 addition & 1 deletion consistency/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ string consistency_index_url ()

bool consistency_index_acl (Webserver_Request& webserver_request)
{
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::translator ());
}


Expand Down
2 changes: 1 addition & 1 deletion consistency/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ string consistency_input_url ()

bool consistency_input_acl (Webserver_Request& webserver_request)
{
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::translator ());
}


Expand Down
2 changes: 1 addition & 1 deletion consistency/poll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ string consistency_poll_url ()

bool consistency_poll_acl (Webserver_Request& webserver_request)
{
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::translator ());
}


Expand Down
3 changes: 2 additions & 1 deletion developer/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include <config/globals.h>
#include <library/bibledit.h>
#include <developer/logic.h>
#include <webserver/request.h>
using namespace std;


Expand All @@ -45,7 +46,7 @@ const char * developer_index_url ()

bool developer_index_acl (Webserver_Request& webserver_request)
{
return Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::admin ());
return Filter_Roles::access_control (webserver_request, Filter_Roles::admin ());
}


Expand Down
2 changes: 1 addition & 1 deletion edit/edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ string edit_edit_url ()

bool edit_edit_acl (Webserver_Request& webserver_request)
{
if (Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ()))
if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ()))
return true;
auto [read, write] = access_bible::any (std::addressof(webserver_request));
return read;
Expand Down
2 changes: 1 addition & 1 deletion edit/id.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ string edit_id_url ()

bool edit_id_acl (Webserver_Request& webserver_request)
{
if (Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ()))
if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ()))
return true;
auto [ read, write ] = access_bible::any (std::addressof(webserver_request));
return read;
Expand Down
2 changes: 1 addition & 1 deletion edit/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ std::string edit_index_url ()

bool edit_index_acl (Webserver_Request& webserver_request)
{
if (Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ()))
if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ()))
return true;
auto [ read, write ] = access_bible::any (std::addressof(webserver_request));
return write;
Expand Down
2 changes: 1 addition & 1 deletion edit/load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ string edit_load_url ()

bool edit_load_acl (Webserver_Request& webserver_request)
{
if (Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ()))
if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ()))
return true;
auto [ read, write ] = access_bible::any (std::addressof(webserver_request));
return write;
Expand Down
2 changes: 1 addition & 1 deletion edit/navigate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ std::string edit_navigate_url ()

bool edit_navigate_acl (Webserver_Request& webserver_request)
{
if (Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ()))
if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ()))
return true;
auto [ read, write ] = access_bible::any (std::addressof(webserver_request));
return write;
Expand Down
2 changes: 1 addition & 1 deletion edit/position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ std::string edit_position_url ()

bool edit_position_acl (Webserver_Request& webserver_request)
{
if (Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ()))
if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ()))
return true;
auto [ read, write ] = access_bible::any (std::addressof(webserver_request));
return write;
Expand Down
2 changes: 1 addition & 1 deletion edit/preview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ string edit_preview_url ()

bool edit_preview_acl (Webserver_Request& webserver_request)
{
if (Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ()))
if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ()))
return true;
auto [ read, write ] = access_bible::any (std::addressof(webserver_request));
return read;
Expand Down
2 changes: 1 addition & 1 deletion edit/save.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ string edit_save_url ()

bool edit_save_acl (Webserver_Request& webserver_request)
{
if (Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ()))
if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ()))
return true;
auto [ read, write ] = access_bible::any (std::addressof(webserver_request));
return read;
Expand Down
2 changes: 1 addition & 1 deletion edit/styles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ string edit_styles_url ()

bool edit_styles_acl (Webserver_Request& webserver_request)
{
if (Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ()))
if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ()))
return true;
auto [ read, write ] = access_bible::any (std::addressof(webserver_request));
return read;
Expand Down
2 changes: 1 addition & 1 deletion edit/update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ string edit_update_url ()

bool edit_update_acl (Webserver_Request& webserver_request)
{
if (Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ()))
if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ()))
return true;
auto [ read, write ] = access_bible::any (std::addressof(webserver_request));
return read;
Expand Down
2 changes: 1 addition & 1 deletion editone2/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ bool editone2_index_acl (Webserver_Request& webserver_request)
{
// Default minimum role for getting access.
int minimum_role = Filter_Roles::translator ();
if (Filter_Roles::access_control (std::addressof(webserver_request), minimum_role))
if (Filter_Roles::access_control (webserver_request, minimum_role))
return true;
auto [ read, write ] = access_bible::any (std::addressof(webserver_request));
return read;
Expand Down
2 changes: 1 addition & 1 deletion editone2/load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ string editone2_load_url ()

bool editone2_load_acl (Webserver_Request& webserver_request)
{
if (Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ()))
if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ()))
return true;
auto [ read, write ] = access_bible::any (std::addressof(webserver_request));
return read;
Expand Down
2 changes: 1 addition & 1 deletion editone2/save.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ string editone2_save_url ()

bool editone2_save_acl (Webserver_Request& webserver_request)
{
if (Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ()))
if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ()))
return true;
auto [ read, write ] = access_bible::any (std::addressof(webserver_request));
return read;
Expand Down
2 changes: 1 addition & 1 deletion editone2/update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ string editone2_update_url ()

bool editone2_update_acl (Webserver_Request& webserver_request)
{
if (Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ()))
if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ()))
return true;
auto [ read, write ] = access_bible::any (std::addressof(webserver_request));
return read;
Expand Down
2 changes: 1 addition & 1 deletion editone2/verse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ string editone2_verse_url ()

bool editone2_verse_acl (Webserver_Request& webserver_request)
{
if (Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ()))
if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ()))
return true;
auto [ read, write ] = access_bible::any (std::addressof(webserver_request));
return read;
Expand Down
2 changes: 1 addition & 1 deletion editor/id.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ string editor_id_url ()

bool editor_id_acl (Webserver_Request& webserver_request)
{
if (Filter_Roles::access_control (std::addressof(webserver_request), Filter_Roles::translator ()))
if (Filter_Roles::access_control (webserver_request, Filter_Roles::translator ()))
return true;
auto [ read, write ] = access_bible::any (std::addressof(webserver_request));
return read;
Expand Down
Loading

0 comments on commit 0c30f5b

Please sign in to comment.