Passed
Pull Request — master (#5505)
by David
16:57 queued 05:46
created
html/inc/prefs_project.inc 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 }
70 70
 
71 71
 if ($app_types->cpu) {
72
-    $project_pref_descs[] = new PREF_BOOL (
72
+    $project_pref_descs[] = new PREF_BOOL(
73 73
         tra("Use CPU"),
74 74
         "Request CPU-only tasks from this project.",
75 75
         "no_cpu",
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     );
79 79
 }
80 80
 if ($app_types->ati) {
81
-    $project_pref_descs[] = new PREF_BOOL (
81
+    $project_pref_descs[] = new PREF_BOOL(
82 82
         tra("Use AMD GPU"),
83 83
         "Request AMD GPU tasks from this project.",
84 84
         "no_ati",
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     );
88 88
 }
89 89
 if ($app_types->cuda) {
90
-    $project_pref_descs[] = new PREF_BOOL (
90
+    $project_pref_descs[] = new PREF_BOOL(
91 91
         tra("Use NVIDIA GPU"),
92 92
         "Request NVIDIA GPU tasks from this project.",
93 93
         "no_cuda",
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     );
97 97
 }
98 98
 if ($app_types->intel_gpu) {
99
-    $project_pref_descs[] = new PREF_BOOL (
99
+    $project_pref_descs[] = new PREF_BOOL(
100 100
         tra("Use Intel GPU"),
101 101
         "Request Intel GPU tasks from this project.",
102 102
         "no_intel_gpu",
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
     );
106 106
 }
107 107
 if ($app_types->apple_gpu) {
108
-    $project_pref_descs[] = new PREF_BOOL (
108
+    $project_pref_descs[] = new PREF_BOOL(
109 109
         tra("Use Apple GPU"),
110 110
         "Request Apple GPU tasks from this project.",
111 111
         "no_apple_gpu",
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     $x = "";
131 131
 }
132 132
 
133
-$privacy_pref_descs = array (
133
+$privacy_pref_descs = array(
134 134
     new PREF_BOOL(
135 135
         tra("Is it OK for %1 and your team (if any) to email you?", PROJECT).$x,
136 136
         "",
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
     global $in_project_specific;
179 179
     global $venue_name;
180 180
 
181
-    switch($name) {
181
+    switch ($name) {
182 182
     case "venue":
183 183
         $venue_name = $attrs["name"];
184 184
         $top_parse_result = $parse_result;
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
         break;
191 191
     default:
192 192
         if ($in_project_specific) {
193
-            $text= $text."<$name>";
193
+            $text = $text."<$name>";
194 194
         } else {
195 195
             $text = "";
196 196
         }
@@ -205,12 +205,12 @@  discard block
 block discarded – undo
205 205
     global $venue_name;
206 206
     global $project_pref_descs;
207 207
 
208
-    foreach($project_pref_descs as $p) {
208
+    foreach ($project_pref_descs as $p) {
209 209
         if ($p->xml_parse($parse_result, $name, $text)) {
210 210
             return;
211 211
         }
212 212
     }
213
-    switch($name) {
213
+    switch ($name) {
214 214
     case "venue":
215 215
         $top_parse_result->$venue_name = $parse_result;
216 216
         $parse_result = $top_parse_result;
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
     return $parse_result;
255 255
 }
256 256
 
257
-function prefs_show_project($prefs, $columns=false) {
257
+function prefs_show_project($prefs, $columns = false) {
258 258
     global $project_pref_descs;
259 259
     if ($columns) {
260 260
         foreach ($project_pref_descs as $p) {
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
     }
294 294
 }
295 295
 
296
-function prefs_show_project_specific($prefs, $columns=false) {
296
+function prefs_show_project_specific($prefs, $columns = false) {
297 297
     if ($columns) {
298 298
         $project_specific_prefs = project_specific_prefs_parse($prefs->project_specific);
299 299
         $project_specific_prefs->home = isset($prefs->home) ? project_specific_prefs_parse($prefs->home->project_specific) : "";
@@ -305,10 +305,10 @@  discard block
 block discarded – undo
305 305
     project_specific_prefs_show($project_specific_prefs, $columns);
306 306
 }
307 307
 
308
-function print_prefs_display_project($user, $columns=false) {
308
+function print_prefs_display_project($user, $columns = false) {
309 309
     $project_prefs = prefs_parse_project($user->project_prefs);
310 310
 
311
-    $switch_link = " <font size=\"-1\"><a href=prefs.php?subset=project&cols=". (int)!$columns .">".tra("(Switch View)")."</a></font>";
311
+    $switch_link = " <font size=\"-1\"><a href=prefs.php?subset=project&cols=".(int)!$columns.">".tra("(Switch View)")."</a></font>";
312 312
     if ($columns) {
313 313
         start_table();
314 314
         row_heading(tra("Combined preferences").$switch_link);
@@ -359,14 +359,14 @@  discard block
 block discarded – undo
359 359
     }
360 360
 }
361 361
 
362
-function prefs_form_project($prefs, $error=false) {
362
+function prefs_form_project($prefs, $error = false) {
363 363
     global $project_pref_descs;
364 364
     foreach ($project_pref_descs as $p) {
365 365
         $p->show_form_row($prefs, $error);
366 366
     }
367 367
 }
368 368
 
369
-function prefs_form_project_specific($prefs_xml, $error=false) {
369
+function prefs_form_project_specific($prefs_xml, $error = false) {
370 370
     $prefs = project_specific_prefs_parse($prefs_xml);
371 371
     project_specific_prefs_edit($prefs, $error);
372 372
 }
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 
415 415
 // given a prefs structure, return the corresponding XML string
416 416
 //
417
-function project_prefs_make_xml($prefs, $primary=true) {
417
+function project_prefs_make_xml($prefs, $primary = true) {
418 418
     global $project_pref_descs;
419 419
     $xml = "";
420 420
     if ($primary) {
@@ -449,8 +449,8 @@  discard block
 block discarded – undo
449 449
 //
450 450
 function project_prefs_update(&$user, $prefs) {
451 451
     $prefs_xml = BoincDb::escape_string(project_prefs_make_xml($prefs));
452
-    $send_email = $user->send_email?1:0;
453
-    $show_hosts = $user->show_hosts?1:0;
452
+    $send_email = $user->send_email ? 1 : 0;
453
+    $show_hosts = $user->show_hosts ? 1 : 0;
454 454
     $retval = $user->update("project_prefs='$prefs_xml', send_email=$send_email, show_hosts=$show_hosts");
455 455
     if (!$retval) {
456 456
         return 1;
Please login to merge, or discard this patch.
html/inc/common_defs.inc 1 patch
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -27,74 +27,74 @@
 block discarded – undo
27 27
 define('BATCH_STATE_RETIRED', 4);
28 28
 
29 29
 define('ANON_PLATFORM_UNKNOWN', -1);
30
-define('ANON_PLATFORM_CPU',     -2);
31
-define('ANON_PLATFORM_NVIDIA',  -3);
32
-define('ANON_PLATFORM_ATI',     -4);
33
-define('ANON_PLATFORM_INTEL_GPU',   -5);
34
-define('ANON_PLATFORM_APPLE_GPU',   -6);
30
+define('ANON_PLATFORM_CPU', -2);
31
+define('ANON_PLATFORM_NVIDIA', -3);
32
+define('ANON_PLATFORM_ATI', -4);
33
+define('ANON_PLATFORM_INTEL_GPU', -5);
34
+define('ANON_PLATFORM_APPLE_GPU', -6);
35 35
 
36
-define('RESULT_SERVER_STATE_INACTIVE',       1);
37
-define('RESULT_SERVER_STATE_UNSENT',         2);
38
-define('RESULT_SERVER_STATE_IN_PROGRESS',    4);
39
-define('RESULT_SERVER_STATE_OVER',           5);
36
+define('RESULT_SERVER_STATE_INACTIVE', 1);
37
+define('RESULT_SERVER_STATE_UNSENT', 2);
38
+define('RESULT_SERVER_STATE_IN_PROGRESS', 4);
39
+define('RESULT_SERVER_STATE_OVER', 5);
40 40
 
41
-define('RESULT_OUTCOME_INIT',             0);
42
-define('RESULT_OUTCOME_SUCCESS',          1);
43
-define('RESULT_OUTCOME_COULDNT_SEND',     2);
44
-define('RESULT_OUTCOME_CLIENT_ERROR',     3);
45
-define('RESULT_OUTCOME_NO_REPLY',         4);
46
-define('RESULT_OUTCOME_DIDNT_NEED',       5);
47
-define('RESULT_OUTCOME_VALIDATE_ERROR',   6);
48
-define('RESULT_OUTCOME_CLIENT_DETACHED',  7);
41
+define('RESULT_OUTCOME_INIT', 0);
42
+define('RESULT_OUTCOME_SUCCESS', 1);
43
+define('RESULT_OUTCOME_COULDNT_SEND', 2);
44
+define('RESULT_OUTCOME_CLIENT_ERROR', 3);
45
+define('RESULT_OUTCOME_NO_REPLY', 4);
46
+define('RESULT_OUTCOME_DIDNT_NEED', 5);
47
+define('RESULT_OUTCOME_VALIDATE_ERROR', 6);
48
+define('RESULT_OUTCOME_CLIENT_DETACHED', 7);
49 49
 
50
-define('VALIDATE_STATE_INIT',        0);
51
-define('VALIDATE_STATE_VALID',       1);
52
-define('VALIDATE_STATE_INVALID',     2);
53
-define('VALIDATE_STATE_NO_CHECK',    3);
54
-define('VALIDATE_STATE_INCONCLUSIVE',4);
55
-define('VALIDATE_STATE_TOO_LATE',    5);
50
+define('VALIDATE_STATE_INIT', 0);
51
+define('VALIDATE_STATE_VALID', 1);
52
+define('VALIDATE_STATE_INVALID', 2);
53
+define('VALIDATE_STATE_NO_CHECK', 3);
54
+define('VALIDATE_STATE_INCONCLUSIVE', 4);
55
+define('VALIDATE_STATE_TOO_LATE', 5);
56 56
 
57
-define('WU_ERROR_COULDNT_SEND_RESULT',           1);
58
-define('WU_ERROR_TOO_MANY_ERROR_RESULTS',        2);
59
-define('WU_ERROR_TOO_MANY_SUCCESS_RESULTS',      4);
60
-define('WU_ERROR_TOO_MANY_TOTAL_RESULTS',        8);
61
-define('WU_ERROR_CANCELLED',                     16);
62
-define('WU_ERROR_NO_CANONICAL_RESULT',           32);
57
+define('WU_ERROR_COULDNT_SEND_RESULT', 1);
58
+define('WU_ERROR_TOO_MANY_ERROR_RESULTS', 2);
59
+define('WU_ERROR_TOO_MANY_SUCCESS_RESULTS', 4);
60
+define('WU_ERROR_TOO_MANY_TOTAL_RESULTS', 8);
61
+define('WU_ERROR_CANCELLED', 16);
62
+define('WU_ERROR_NO_CANONICAL_RESULT', 32);
63 63
 
64
-define('FILE_DELETE_INIT',       0);
65
-define('FILE_DELETE_READY',      1);
66
-define('FILE_DELETE_DONE',       2);
67
-define('FILE_DELETE_ERROR',      3);
64
+define('FILE_DELETE_INIT', 0);
65
+define('FILE_DELETE_READY', 1);
66
+define('FILE_DELETE_DONE', 2);
67
+define('FILE_DELETE_ERROR', 3);
68 68
 
69
-define('ASSIMILATE_INIT',       0);
70
-define('ASSIMILATE_READY',      1);
71
-define('ASSIMILATE_DONE',       2);
69
+define('ASSIMILATE_INIT', 0);
70
+define('ASSIMILATE_READY', 1);
71
+define('ASSIMILATE_DONE', 2);
72 72
 
73 73
 // from lib/common_defs.h
74 74
 //
75
-define('RESULT_NEW',                 0);
76
-define('RESULT_FILES_DOWNLOADING',   1);
77
-define('RESULT_FILES_DOWNLOADED',    2);
78
-define('RESULT_COMPUTE_ERROR',       3);
79
-define('RESULT_FILES_UPLOADING',     4);
80
-define('RESULT_FILES_UPLOADED',      5);
81
-define('RESULT_ABORTED',             6);
82
-define('RESULT_UPLOAD_FAILED',       7);
75
+define('RESULT_NEW', 0);
76
+define('RESULT_FILES_DOWNLOADING', 1);
77
+define('RESULT_FILES_DOWNLOADED', 2);
78
+define('RESULT_COMPUTE_ERROR', 3);
79
+define('RESULT_FILES_UPLOADING', 4);
80
+define('RESULT_FILES_UPLOADED', 5);
81
+define('RESULT_ABORTED', 6);
82
+define('RESULT_UPLOAD_FAILED', 7);
83 83
 
84 84
 // from lib/error_numbers.h
85 85
 // returned by some web RPCs
86 86
 //
87
-define('ERR_XML_PARSE',               -112);
88
-define('ERR_DB_NOT_FOUND',            -136);
89
-define('ERR_DB_NOT_UNIQUE',           -137);
90
-define('ERR_DB_CANT_CONNECT',         -138);
91
-define('ERR_PROJECT_DOWN',            -183);
92
-define('ERR_BAD_USER_NAME',           -188);
93
-define('ERR_NO_OPTION',               -191);
94
-define('ERR_BAD_EMAIL_ADDR',          -205);
95
-define('ERR_BAD_PASSWD',              -206);
96
-define('ERR_ACCT_CREATION_DISABLED',  -208);
97
-define('ERR_ATTACH_FAIL_INIT',        -209);
98
-define('ERR_ATTACH_FAIL_DOWNLOAD',    -210);
99
-define('ERR_ACCT_REQUIRE_CONSENT',    -242);
87
+define('ERR_XML_PARSE', -112);
88
+define('ERR_DB_NOT_FOUND', -136);
89
+define('ERR_DB_NOT_UNIQUE', -137);
90
+define('ERR_DB_CANT_CONNECT', -138);
91
+define('ERR_PROJECT_DOWN', -183);
92
+define('ERR_BAD_USER_NAME', -188);
93
+define('ERR_NO_OPTION', -191);
94
+define('ERR_BAD_EMAIL_ADDR', -205);
95
+define('ERR_BAD_PASSWD', -206);
96
+define('ERR_ACCT_CREATION_DISABLED', -208);
97
+define('ERR_ATTACH_FAIL_INIT', -209);
98
+define('ERR_ATTACH_FAIL_DOWNLOAD', -210);
99
+define('ERR_ACCT_REQUIRE_CONSENT', -242);
100 100
 ?>
Please login to merge, or discard this patch.
html/user/gpu_ratios.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,26 +34,26 @@
 block discarded – undo
34 34
 $intel_gpu_credit_sum = 0;
35 35
 $apple_gpu_scale_sum = 0;
36 36
 $apple_gpu_credit_sum = 0;
37
-$total_credit_sum= 0;
37
+$total_credit_sum = 0;
38 38
 
39 39
 $apps = BoincApp::enum("deprecated=0");
40 40
 foreach ($apps as $app) {
41 41
     $avs = BoincAppVersion::enum("appid=$app->id and deprecated=0");
42 42
     foreach ($avs as $av) {
43 43
         if (strstr($av->plan_class, "ati")) {
44
-            $ati_scale_sum += $av->pfc_scale * $av->expavg_credit;
44
+            $ati_scale_sum += $av->pfc_scale*$av->expavg_credit;
45 45
             $ati_credit_sum += $av->expavg_credit;
46 46
         } else if (strstr($av->plan_class, "nvidia") || strstr($av->plan_class, "cuda")) {
47
-            $nvidia_scale_sum += $av->pfc_scale * $av->expavg_credit;
47
+            $nvidia_scale_sum += $av->pfc_scale*$av->expavg_credit;
48 48
             $nvidia_credit_sum += $av->expavg_credit;
49 49
         } else if (strstr($av->plan_class, "intel_gpu")) {
50
-            $intel_gpu_scale_sum += $av->pfc_scale * $av->expavg_credit;
50
+            $intel_gpu_scale_sum += $av->pfc_scale*$av->expavg_credit;
51 51
             $intel_gpu_credit_sum += $av->expavg_credit;
52 52
         } else if (strstr($av->plan_class, "apple_gpu")) {
53
-            $apple_gpu_scale_sum += $av->pfc_scale * $av->expavg_credit;
53
+            $apple_gpu_scale_sum += $av->pfc_scale*$av->expavg_credit;
54 54
             $apple_gpu_credit_sum += $av->expavg_credit;
55 55
         } else {
56
-            $cpu_scale_sum += $av->pfc_scale * $av->expavg_credit;
56
+            $cpu_scale_sum += $av->pfc_scale*$av->expavg_credit;
57 57
             $cpu_credit_sum += $av->expavg_credit;
58 58
         }
59 59
         $total_credit_sum += $av->expavg_credit;
Please login to merge, or discard this patch.