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 7, 2024
1 parent f241a00 commit 70aedf4
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion changes/change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ bool changes_change_acl (Webserver_Request& webserver_request)
string changes_change (Webserver_Request& webserver_request)
{
Database_Modifications database_modifications {};
Database_Notes database_notes = Database_Notes (webserver_request);
Database_Notes database_notes (webserver_request);
Notes_Logic notes_logic (webserver_request);


Expand Down
10 changes: 5 additions & 5 deletions changes/modifications.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ using namespace std;


// Internal function declarations.
void changes_process_identifiers (Webserver_Request * request,
void changes_process_identifiers (Webserver_Request& webserver_request,
const string & user,
const vector <string> & recipients,
const string & bible,
Expand All @@ -60,7 +60,7 @@ void changes_process_identifiers (Webserver_Request * request,
// Helper function.
// $user: The user whose changes are being processed.
// $recipients: The users who opted for receiving online notifications of any contributor.
void changes_process_identifiers (Webserver_Request * request,
void changes_process_identifiers (Webserver_Request& webserver_request,
const string & user,
const vector <string> & recipients,
const string & bible,
Expand Down Expand Up @@ -108,7 +108,7 @@ void changes_process_identifiers (Webserver_Request * request,
email += " ";
email += modification;
email += "</div>";
if (request->database_config_user()->getUserUserChangesNotificationsOnline (user)) {
if (webserver_request.database_config_user()->getUserUserChangesNotificationsOnline (user)) {
database_modifications.recordNotification ({user}, changes_personal_category (), bible, book, chapter, verse, old_html, modification, new_html);
}
// Go over all the receipients to record the change for them.
Expand Down Expand Up @@ -231,7 +231,7 @@ void changes_modifications ()
new_id = id_set.newid;

if (restart) {
changes_process_identifiers (&webserver_request, user, recipients_named_contributors, bible, book, chapter, notification_bibles_per_user, reference_new_id, new_id, email, change_count, modification_time_total, modification_time_count);
changes_process_identifiers (webserver_request, user, recipients_named_contributors, bible, book, chapter, notification_bibles_per_user, reference_new_id, new_id, email, change_count, modification_time_total, modification_time_count);
reference_new_id = new_id;
last_new_id = new_id;
restart = false;
Expand All @@ -246,7 +246,7 @@ void changes_modifications ()
}

// Process the last set of identifiers.
changes_process_identifiers (&webserver_request, user, recipients_named_contributors, bible, book, chapter, notification_bibles_per_user, reference_new_id, new_id, email, change_count, modification_time_total, modification_time_count);
changes_process_identifiers (webserver_request, user, recipients_named_contributors, bible, book, chapter, notification_bibles_per_user, reference_new_id, new_id, email, change_count, modification_time_total, modification_time_count);

}
}
Expand Down
2 changes: 1 addition & 1 deletion database/maintenance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void database_maintenance ()
database_ipc.trim ();


Database_Notes database_notes = Database_Notes (webserver_request);
Database_Notes database_notes (webserver_request);
database_notes.trim ();
if (!client_mode) database_notes.trim_server ();
database_notes.optimize ();
Expand Down
4 changes: 2 additions & 2 deletions email/send.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ string email_send ([[maybe_unused]] string to_mail,
return "";
}

Webserver_Request request;
Sync_Logic sync_logic = Sync_Logic (&request);
Webserver_Request webserver_request;
Sync_Logic sync_logic (webserver_request);

map <string, string> post;
post ["n"] = filter::strings::bin2hex (to_name);
Expand Down
2 changes: 1 addition & 1 deletion notes/logic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ bool Notes_Logic::handleEmailNew (string from, string subject, string body)
// Post the note.
string sessionuser = m_webserver_request.session_logic()->currentUser ();
m_webserver_request.session_logic()->set_username (username);
Database_Notes database_notes = Database_Notes(m_webserver_request);
Database_Notes database_notes (m_webserver_request);
string bible = m_webserver_request.database_config_user()->getBible ();
int identifier = database_notes.store_new_note (bible, static_cast<int>(book), chapter, verse, summary, body, false);
handlerNewNote (identifier);
Expand Down
2 changes: 1 addition & 1 deletion search/all.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ string search_all (Webserver_Request& webserver_request)
vector <string> queryWords = filter::strings::explode (queryString, ' ');


Database_Notes database_notes = Database_Notes (webserver_request);
Database_Notes database_notes (webserver_request);


const string site_url = config::logic::site_url (webserver_request);
Expand Down
2 changes: 1 addition & 1 deletion sendreceive/bibles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void sendreceive_bibles ()


Webserver_Request webserver_request;
Sync_Logic sync_logic = Sync_Logic (webserver_request);
Sync_Logic sync_logic (webserver_request);


string response = client_logic_connection_setup ("", "");
Expand Down
2 changes: 1 addition & 1 deletion sendreceive/changes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void sendreceive_changes ()


Webserver_Request webserver_request;
Sync_Logic sync_logic = Sync_Logic (webserver_request);
Sync_Logic sync_logic (webserver_request);
Database_Modifications database_modifications;


Expand Down
2 changes: 1 addition & 1 deletion sendreceive/files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void sendreceive_files ()


Webserver_Request webserver_request {};
Sync_Logic sync_logic = Sync_Logic (webserver_request);
Sync_Logic sync_logic (webserver_request);


Database_Logs::log (sendreceive_files_sendreceive_text (), Filter_Roles::translator ());
Expand Down
2 changes: 1 addition & 1 deletion sync/bibles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ string sync_bibles_receive_chapter (Webserver_Request& webserver_request, string

string sync_bibles (Webserver_Request& webserver_request)
{
Sync_Logic sync_logic = Sync_Logic (webserver_request);
Sync_Logic sync_logic (webserver_request);

if (!sync_logic.security_okay ()) {
// When the Cloud enforces https, inform the client to upgrade.
Expand Down
2 changes: 1 addition & 1 deletion sync/logic.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Sync_Logic_Range
class Sync_Logic
{
public:
Sync_Logic (Webserver_Request& webserver_request_in);
Sync_Logic (Webserver_Request& webserver_request);

static constexpr int settings_get_total_checksum = 1;
static constexpr int settings_send_workspace_urls = 2;
Expand Down

0 comments on commit 70aedf4

Please sign in to comment.