From 9878243b4e002b50ee444cf906b9e13faba4fe01 Mon Sep 17 00:00:00 2001 From: Matteo Nastasi Date: Mon, 26 Dec 2016 08:34:21 +0000 Subject: [PATCH] removed '&' symbol behind passed variables as arguments --- web/Obj/brisk.phh | 2 +- web/Obj/dbase_file.phh | 2 +- web/Obj/dbase_pgsql.phh | 2 +- web/Obj/hardban.phh | 4 ++-- web/Obj/sac-a-push.phh | 4 ++-- web/Obj/user.phh | 2 +- web/briskin5/Obj/briskin5.phh | 20 ++++++++++---------- web/briskin5/index_wr.php | 24 ++++++++++++------------ web/briskin5/stat-day.php | 2 +- web/briskin5/statadm.php | 2 +- web/index.php | 4 ++-- web/index_wr.php | 12 +++++++----- 12 files changed, 41 insertions(+), 39 deletions(-) diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index 1eb6f94..3a3d576 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -2796,7 +2796,7 @@ class Brisk $subs = "briskin5/"; $subs_l = strlen($subs); if (!strncmp($path, $subs, $subs_l)) { - $ret = Bin5::request_mgr(&$s_a_p, $header, &$header_out, &$new_socket, substr($path, $subs_l) , $addr, $get, $post, $cookie); + $ret = Bin5::request_mgr($s_a_p, $header, $header_out, $new_socket, substr($path, $subs_l) , $addr, $get, $post, $cookie); return ($ret); } break; diff --git a/web/Obj/dbase_file.phh b/web/Obj/dbase_file.phh index d917a81..9461f1e 100644 --- a/web/Obj/dbase_file.phh +++ b/web/Obj/dbase_file.phh @@ -166,7 +166,7 @@ class BriskDB { } if ($chals->ismod()) { - Challenges::save_data(&$chals); + Challenges::save_data($chals); } Challenges::unlock_data($a_sem); diff --git a/web/Obj/dbase_pgsql.phh b/web/Obj/dbase_pgsql.phh index 77c215f..f8b7538 100644 --- a/web/Obj/dbase_pgsql.phh +++ b/web/Obj/dbase_pgsql.phh @@ -433,7 +433,7 @@ class BriskDB } if ($chals->ismod()) { - Challenges::save_data(&$chals); + Challenges::save_data($chals); } Challenges::unlock_data($a_sem); diff --git a/web/Obj/hardban.phh b/web/Obj/hardban.phh index bcc983d..47fd0b1 100644 --- a/web/Obj/hardban.phh +++ b/web/Obj/hardban.phh @@ -283,7 +283,7 @@ class Hardbans { } } // for (... if ($hban->ismod()) { - Hardbans::save_data(&$hban); + Hardbans::save_data($hban); } } // if (load_data Hardbans::unlock_data($a_sem); @@ -305,7 +305,7 @@ class Hardbans { $hban->add_item($login, $ip, $session, $timeout); if ($hban->ismod()) { - Hardbans::save_data(&$hban); + Hardbans::save_data($hban); } } // if (load_data Hardbans::unlock_data($a_sem); diff --git a/web/Obj/sac-a-push.phh b/web/Obj/sac-a-push.phh index 80db1f4..ca9c0cb 100644 --- a/web/Obj/sac-a-push.phh +++ b/web/Obj/sac-a-push.phh @@ -555,7 +555,7 @@ class Sac_a_push { function pendpage_try_addcont(&$new_socket, $tout, $method, $header, $get, $post, $cookie, $path, $addr, $rest, $cont) { - $pendpage = PendingPage::pendingpage_continue(&$new_socket, $this->curtime, $tout, $method, + $pendpage = PendingPage::pendingpage_continue( $new_socket, $this->curtime, $tout, $method, $header, $get, $post, $cookie, $path, $addr, $rest, $cont); @@ -996,7 +996,7 @@ class Sac_a_push { return cmd_return(401, 'malformed cmd'); } $idx = -1; - if (($user = $this->app->get_user($cmd['sess'], &$idx)) == FALSE) + if (($user = $this->app->get_user($cmd['sess'], $idx)) == FALSE) return cmd_return(402, 'user not found'); if (($user->flags & USER_FLAG_TY_ADMIN) == 0x00) diff --git a/web/Obj/user.phh b/web/Obj/user.phh index 361acda..ad42e7f 100644 --- a/web/Obj/user.phh +++ b/web/Obj/user.phh @@ -830,7 +830,7 @@ function stream_init($init_string, $enc, $header, &$header_out, &$body, $get, $p $this->rd_data_set($curtime, $transp, $enc, $stat, $subst, $step, $from); - $ret = $this->rd_transp->init($enc, $header, &$header_out, $init_string, self::base_get(), $this->rd_scristp); + $ret = $this->rd_transp->init($enc, $header, $header_out, $init_string, self::base_get(), $this->rd_scristp); if ($ret === FALSE) { return FALSE; diff --git a/web/briskin5/Obj/briskin5.phh b/web/briskin5/Obj/briskin5.phh index fb696cb..e2cffa9 100644 --- a/web/briskin5/Obj/briskin5.phh +++ b/web/briskin5/Obj/briskin5.phh @@ -525,7 +525,7 @@ class Bin5_table extends Table { $game_delta = 1; // $this->game_next(1); - $this->game_init(&$bri->user); + $this->game_init($bri->user); } else if ($action == BIN5_RULES_ABANDON) { // return TRUE if all correct if (!($user->handpt <= 2)) { @@ -544,7 +544,7 @@ class Bin5_table extends Table { // Non si cambia mazzo se si abbandona la partita $game_delta = 0; // $this->game_next(0); - $this->game_init(&$bri->user); + $this->game_init($bri->user); } else if ($action == BIN5_RULES_FINISH) { // return TRUE if all correct $this->old_act = $action; @@ -661,7 +661,7 @@ class Bin5_table extends Table { log_points($user->ip, $curtime, $user, "STAT:BRISKIN5:FINISH_GAME", $plist); } - $this->game_init(&$bri->user); + $this->game_init($bri->user); return (TRUE); } @@ -763,7 +763,7 @@ class Bin5_table extends Table { $this->mazzo = $match_data['mazzo_next']; $this->mult = $match_data['mult_next']; $this->match_id = $match_id; - $this->game_init(&$bri->user); + $this->game_init($bri->user); /* reload of the page with the new layout */ for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) { @@ -779,7 +779,7 @@ class Bin5_table extends Table { $user_cur->comm[$user_cur->step % COMM_N] = ""; $user_cur->step_inc(); - $user_cur->comm[$user_cur->step % COMM_N] = show_table(&$bri, &$user_cur, $user_cur->step+1, TRUE, FALSE); + $user_cur->comm[$user_cur->step % COMM_N] = show_table($bri, $user_cur, $user_cur->step+1, TRUE, FALSE); $user_cur->step_inc(); } return (TRUE); @@ -1069,7 +1069,7 @@ class Bin5_user extends User { log_load("RESYNC"); /* NOTE: $this->room is associated with the current $bri object */ printf("xXx CLASS NAME [%s]\n", get_class($this->room)); - $ret = show_table(&$this->room, $this, $this->step, FALSE, FALSE); + $ret = show_table($this->room, $this, $this->step, FALSE, FALSE); } log_rd2("NEWSTAT: ".$this->stat); @@ -1172,7 +1172,7 @@ class Bin5 { $user[$table->player[$i]]->table_token = $table_token; $this->user[$i] = Bin5_user::spawn($user[$table->player[$i]], $this, $table_idx, $i, $get, $post, $cookie); } - $this->table[0] = Bin5_table::spawn(&$table); + $this->table[0] = Bin5_table::spawn($table); log_main("TABLE_OLD_WIN - Bin5:".$this->table[0]->old_asta_win); @@ -1265,7 +1265,7 @@ class Bin5 { $user_cur->the_end = TRUE; /* se gli altri utenti non erano d'accordo questo utente viene bannato */ - $remcalc = $this->table[0]->exitlock_calc(&$this->user, $user_cur->table_pos); + $remcalc = $this->table[0]->exitlock_calc($this->user, $user_cur->table_pos); if ($remcalc < 3) { require_once("${G_base}Obj/hardban.phh"); Hardbans::add(($user_cur->is_auth() ? $user_cur->name : FALSE), @@ -1609,7 +1609,7 @@ function show_table(&$bri, &$user, $sendstep, $is_transition, $is_again) $table_pos = $user->table_pos; $ret = "table_init();"; - $ret .= $table->exitlock_show(&$bri->user, $table_pos); + $ret .= $table->exitlock_show($bri->user, $table_pos); if (!$is_again) { /* GENERAL STATUS */ $ret .= sprintf( 'gst.st = %d; stat = "%s"; subst = "%s"; table_pos = %d;', @@ -1640,7 +1640,7 @@ function show_table(&$bri, &$user, $sendstep, $is_transition, $is_again) } /* NOTIFY FOR THE CARD MAKER */ if ($is_transition) { // && $user->subst == "asta" superfluo - $ret .= show_table_info(&$bri, &$table, $table_pos); + $ret .= show_table_info($bri, $table, $table_pos); $ret .= "setTimeout(preload_images, 500, g_preload_img_arr, g_imgct);"; } else { diff --git a/web/briskin5/index_wr.php b/web/briskin5/index_wr.php index 451b86a..bc69682 100644 --- a/web/briskin5/index_wr.php +++ b/web/briskin5/index_wr.php @@ -59,7 +59,7 @@ function bin5_index_wr_main(&$bin5, $remote_addr_full, $get, $post, $cookie) log_wr(0, 'bin::index_wr.php: COMM: '.xcapemesg($mesg)); - if (($user = &$bin5->get_user($sess, &$idx)) == FALSE) { + if (($user = &$bin5->get_user($sess, $idx)) == FALSE) { echo "Get User Error"; log_wr("Get User Error"); return FALSE; @@ -105,12 +105,12 @@ function bin5_index_wr_main(&$bin5, $remote_addr_full, $get, $post, $cookie) if ($argz[0] == 'tableinfo') { log_wr("PER DI TABLEINFO"); $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; "; - $user->comm[$user->step % COMM_N] .= show_table_info(&$bin5, &$table, $user->table_pos); + $user->comm[$user->step % COMM_N] .= show_table_info($bin5, $table, $user->table_pos); log_wr($user->comm[$user->step % COMM_N]); $user->step_inc(); } else if ($argz[0] == 'chatt') { - $bin5->chatt_send(&$user,$mesg); + $bin5->chatt_send($user, $mesg); } else if ($argz[0] == 'preferences_update') { log_wr("PER DI PREFERENCES_UPDATE"); @@ -130,10 +130,10 @@ function bin5_index_wr_main(&$bin5, $remote_addr_full, $get, $post, $cookie) $logout_cont = TRUE; if ($remcalc >= 3) { - $lockcalc = $table->exitlock_calc(&$bin5->user, $user->table_pos); + $lockcalc = $table->exitlock_calc($bin5->user, $user->table_pos); if ($lockcalc < 3) { $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; "; - $user->comm[$user->step % COMM_N] .= $table->exitlock_show(&$bin5->user, $user->table_pos); + $user->comm[$user->step % COMM_N] .= $table->exitlock_show($bin5->user, $user->table_pos); $user->comm[$user->step % COMM_N] .= show_notify("
I dati presenti sul server non erano allineati con quelli inviati dal tuo browser, adesso lo sono. Riprova ora.", 2000, "torna alla partita.", 400, 100); log_wr($user->comm[$user->step % COMM_N]); @@ -198,12 +198,12 @@ function bin5_index_wr_main(&$bin5, $remote_addr_full, $get, $post, $cookie) /* $table->game_init(&$bin5->user); */ - if ($table->rules_engine(&$bin5, $curtime, BIN5_RULES_ABANDON, $user)) { + if ($table->rules_engine($bin5, $curtime, BIN5_RULES_ABANDON, $user)) { for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) { $user_cur = &$bin5->user[$table->player[$i]]; $ret = sprintf('gst.st = %d;', $user_cur->step+1); - $ret .= show_table(&$bin5,&$user_cur,$user_cur->step+1, TRUE, TRUE); + $ret .= show_table($bin5, $user_cur,$user_cur->step+1, TRUE, TRUE); $user_cur->comm[$user_cur->step % COMM_N] = $ret; $user_cur->step_inc(); } @@ -302,12 +302,12 @@ function bin5_index_wr_main(&$bin5, $remote_addr_full, $get, $post, $cookie) else if ($table->asta_pla_n == 0) { log_wr("PASSANO TUTTI!"); - if ($table->rules_engine(&$bin5, $curtime, BIN5_RULES_ALLPASS, $user)) { + if ($table->rules_engine($bin5, $curtime, BIN5_RULES_ALLPASS, $user)) { for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) { $user_cur = &$bin5->user[$table->player[$i]]; $ret = sprintf('gst.st = %d;', $user_cur->step+1); - $ret .= show_table(&$bin5,&$user_cur,$user_cur->step+1, TRUE, TRUE); + $ret .= show_table($bin5, $user_cur,$user_cur->step+1, TRUE, TRUE); $user_cur->comm[$user_cur->step % COMM_N] = $ret; $user_cur->step_inc(); } @@ -490,10 +490,10 @@ function bin5_index_wr_main(&$bin5, $remote_addr_full, $get, $post, $cookie) if ($table->turn == (BIN5_PLAYERS_N * BIN5_CARD_HAND)) { /* game finished */ log_wr(sprintf("GIOCO FINITO !!!")); - if ($table->rules_engine(&$bin5, $curtime, BIN5_RULES_FINISH, $user)) { + if ($table->rules_engine($bin5, $curtime, BIN5_RULES_FINISH, $user)) { for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) { $user_cur = &$bin5->user[$table->player[$i]]; - $retar[$i] .= show_table(&$bin5,&$user_cur,$user_cur->step+1,TRUE, TRUE); + $retar[$i] .= show_table($bin5, $user_cur, $user_cur->step+1, TRUE, TRUE); } } } @@ -505,7 +505,7 @@ function bin5_index_wr_main(&$bin5, $remote_addr_full, $get, $post, $cookie) $user_cur->step_inc(); } - log_wr(sprintf("TURN: %d",$table->turn)); + log_wr(sprintf("TURN: %d", $table->turn)); /* Have played all the players ? */ /* NO: switch the focus and enable the next player to play. */ diff --git a/web/briskin5/stat-day.php b/web/briskin5/stat-day.php index 0359bfe..d96cb6c 100644 --- a/web/briskin5/stat-day.php +++ b/web/briskin5/stat-day.php @@ -141,7 +141,7 @@ function main_file($curtime) for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) { // echo $p." i) ".$i."
"; $username = $ar[9+($i*2)]; - if (($item = $bdb->getitem_bylogin($username, &$id)) == FALSE) { + if (($item = $bdb->getitem_bylogin($username, $id)) == FALSE) { echo "WARNING: the user [".$username."] NOT EXISTS!
"; continue; } diff --git a/web/briskin5/statadm.php b/web/briskin5/statadm.php index 652a11d..a65acef 100644 --- a/web/briskin5/statadm.php +++ b/web/briskin5/statadm.php @@ -123,7 +123,7 @@ function main_file($curtime) for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) { // echo $p." i) ".$i."
"; $username = $ar[9+($i*2)]; - if (($item = $bdb->getitem_bylogin($username, &$id)) == FALSE) { + if (($item = $bdb->getitem_bylogin($username, $id)) == FALSE) { echo "WARNING: the user [".$username."] NOT EXISTS!
"; continue; } diff --git a/web/index.php b/web/index.php index d68f270..21adca2 100644 --- a/web/index.php +++ b/web/index.php @@ -415,7 +415,7 @@ function index_main(&$brisk, $transp_type, $header, &$header_out, $remote_addr_f log_main("pre garbage_manager UNO"); $brisk->garbage_manager(TRUE); log_main("post garbage_manager"); - if (($user = &$brisk->get_user($sess, &$idx)) != FALSE) { + if (($user = $brisk->get_user($sess, $idx)) != FALSE) { if ($user->the_end == FALSE) { $brisk->sess_cur_set($user->sess); log_main("user stat: ".$user->stat); @@ -448,7 +448,7 @@ function index_main(&$brisk, $transp_type, $header, &$header_out, $remote_addr_f /* try login */ if ($banned == FALSE && - ($user = $brisk->add_user(&$sess, &$idx, $name, $pass_private, + ($user = $brisk->add_user($sess, $idx, $name, $pass_private, $remote_addr, $header, $cookie)) != FALSE) { $brisk->sess_cur_set($user->sess); $ACTION = "room"; diff --git a/web/index_wr.php b/web/index_wr.php index b0c9ac0..71b3f9c 100644 --- a/web/index_wr.php +++ b/web/index_wr.php @@ -160,7 +160,7 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie) $curtime = time(); $dt = date("H:i ", $curtime); - if (($user = $brisk->get_user($sess, &$idx)) == FALSE) { + if (($user = $brisk->get_user($sess, $idx)) == FALSE) { $argz = explode('|', xcapemesg($mesg)); if ($argz[0] == 'getchallenge') { @@ -190,7 +190,7 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie) echo '1|'; } if ($chals->ismod()) { - Challenges::save_data(&$chals); + Challenges::save_data($chals); } } @@ -392,7 +392,7 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie) if ($user->subst == 'sitdown' || $user->stat == 'table') $brisk->room_wakeup($user); else if ($user->subst == 'standup') - $brisk->room_outstandup(&$user); + $brisk->room_outstandup($user); else { log_rd2("SHUTDOWN FROM WHAT ???"); } @@ -746,7 +746,7 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie) } else if ($argz[0] == 'chatt') { - $brisk->chatt_send(&$user, xcapemesg($mesg)); + $brisk->chatt_send($user, xcapemesg($mesg)); } else if ($argz[0] == 'tosmgr') { // check IF is authnticated user, both terms of service versions matches @@ -898,7 +898,9 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie) $bin5_user_cur->trans_step = $user_cur->step + 1; $bin5_user_cur->comm[$bin5_user_cur->step % COMM_N] = ""; $bin5_user_cur->step_inc(); - $bin5_user_cur->comm[$bin5_user_cur->step % COMM_N] = show_table(&$bin5,&$bin5_user_cur,$bin5_user_cur->step+1,TRUE,FALSE); + $bin5_user_cur->comm[$bin5_user_cur->step % COMM_N] = show_table($bin5, $bin5_user_cur, + $bin5_user_cur->step+1, + TRUE, FALSE); $bin5_user_cur->step_inc(); log_wr("TRY PRESAVE: ".$bin5_user_cur->step." TRANS STEP: ".$bin5_user_cur->trans_step); -- 2.17.1