diff --git a/.htaccess b/.htaccess index ddb818a..c2351fb 100644 --- a/.htaccess +++ b/.htaccess @@ -281,9 +281,6 @@ AddDefaultCharset utf-8 # (5) # RewriteOptions - # Redirect "democlient.html" to the new place... - Redirect permanent /democlient.html https://cppcheck.sourceforge.io/demo/ - # Redirect "devinfo.html" to the new place... Redirect permanent /devinfo.html https://cppcheck.sourceforge.io/devinfo/ diff --git a/demo/index.php b/demo/index.php deleted file mode 100644 index 1f69217..0000000 --- a/demo/index.php +++ /dev/null @@ -1,102 +0,0 @@ - - - - - Online Demo - Cppcheck - - - - - - - - - - -
- -
-
-
-

Online Demo

-
-

(max 1024 characters)
-
- -

-
-

Examples

-

This code can be copied and pasted in the edit box above.

-

NULL pointers

-
void f1(struct fred_t *p)
-{
-    // dereference p and then check if it's NULL
-    int x = p->x;
-    if (p)
-        do_something(x);
-}
-
-void f2()
-{
-    const char *p = NULL;
-    for (int i = 0; str[i] != '\0'; i++)
-    {
-        if (str[i] == ' ')
-        {
-            p = str + i;
-            break;
-        }
-    }
-
-    // p is NULL if str doesn't have a space. If str always has a
-    // a space then the condition (str[i] != '\0') would be redundant
-    return p[1];
-}
-
-void f3(int a)
-{
-    struct fred_t *p = NULL;
-    if (a == 1)
-        p = fred1;
-
-    // if a is not 1 then p is NULL
-    p->x = 0;
-}
-
-
- - - diff --git a/demo/report/index.php b/demo/report/index.php deleted file mode 100644 index 21d0636..0000000 --- a/demo/report/index.php +++ /dev/null @@ -1,176 +0,0 @@ - $code - ) - ); - - $opts = array('http' => - array( - 'method' => 'POST', - 'header' => 'Content-type: application/x-www-form-urlencoded', - 'content' => $postdata - ) - ); - - $context = stream_context_create($opts); - - return @file_get_contents('https://cppcheck.sourceforge.io/cgi-bin/democlient.cgi', false, $context); - } - - function cut_string($string, $length = 1024) { - if (strlen($string) > $length) { - return substr($string, 0, $length); - } - return $string; - } - - //-------------------------------------------------------------------------------- - // XML output... - //-------------------------------------------------------------------------------- - if ($isXmlOutput) { //if XML output... - header('Content-Type: text/xml'); - - if (!$isCodePosted) { //if NO code posted... - echo "\n\n"; - exit; - } - - $output = get_democlient_output(cut_string($_POST['code'])); - - if ($output === false) { //if NO demo client output... - echo "\n\n"; - exit; - } - - echo $output; - exit; - } - //-------------------------------------------------------------------------------- -?> - - - - - Online Demo Report - Cppcheck - - - - - - - - - - -
- -
-
-
-

Online Demo Report

-errors->error as $error) { //for all errors... - $severity = (string)$error->attributes()->severity; - $msg = (string)$error->attributes()->msg; - $line = (string)$error->location->attributes()->line; - if (!empty($severity) && !empty($msg) && !empty($line)) { //if complete error... - $parsed[] = array('severity' => $severity, 'msg' => $msg, 'line' => $line); - } - } - return $parsed; - } - catch (Exception $ex) { - return array(); - } - } - - if ($isCodePosted) { //if code posted... - include_once '../../site/geshi/geshi.php'; - - $code = cut_string($_POST['code']); - - $geshi = new GeSHi($code, 'cpp'); - $geshi->enable_classes(); - $geshi->set_header_type(GESHI_HEADER_PRE_TABLE); - $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS); - $geshi->set_overall_class('geshicode'); - - echo "

Input

\n"; - echo $geshi->parse_code(); - - echo "

Output

\n"; - - $output = get_democlient_output($code); - - if (!$output === false) { - $results = parse_democlient_output($output); - - if (!empty($results)) { - echo "\n"; - echo "\n"; - echo " \n"; - echo "\n"; - echo "\n"; - foreach ($results as $result) { //for each result... - echo " \n"; - } - echo "\n"; - echo "
LineSeverityMessage
" . htmlspecialchars($result['line']) . "" . htmlspecialchars($result['severity']) . "" . htmlspecialchars($result['msg']) . "
\n"; - } - else { - echo "

No errors found.

\n"; - } - } - else { - echo "

Problem with demo client. Please try again.

\n"; - } - } - else { //if NO code posted... - echo "

Use the online demo page to create the report.

\n"; - } -?> -
-
- - - diff --git a/devinfo/index.php b/devinfo/index.php index 58bcfc0..f2618ce 100644 --- a/devinfo/index.php +++ b/devinfo/index.php @@ -40,7 +40,6 @@
  • Forum
  • Issues
  • Developer Info
  • -
  • Online Demo
  • Project page
  • diff --git a/gsoc2014.php b/gsoc2014.php index a0e2613..b5095f9 100644 --- a/gsoc2014.php +++ b/gsoc2014.php @@ -22,7 +22,6 @@
  • Home
  • Issues
  • Developer Info
  • -
  • Online Demo
  • Project page
  • diff --git a/gsoc2016.php b/gsoc2016.php index addcf8b..cfeb950 100644 --- a/gsoc2016.php +++ b/gsoc2016.php @@ -24,7 +24,6 @@
  • Forum
  • Issues
  • Developer Info
  • -
  • Online Demo
  • Project page
  • diff --git a/index.php b/index.php index 4492acc..a72de46 100644 --- a/index.php +++ b/index.php @@ -30,7 +30,6 @@
  • Forum
  • Issues
  • Developer Info
  • -
  • Online Demo
  • Project page
  • diff --git a/make.js b/make.js index 6d949d9..87cd196 100644 --- a/make.js +++ b/make.js @@ -35,8 +35,7 @@ // pack.css var inCss = cat(["site/css/normalize.css", - "site/css/all.css", - "site/css/demo.css"]); + "site/css/all.css"]); var minifier = new CleanCSS({ keepSpecialComments: 0, diff --git a/misra.php b/misra.php index 0ddb1a2..e575142 100644 --- a/misra.php +++ b/misra.php @@ -25,7 +25,6 @@
  • Forum
  • Issues
  • Developer Info
  • -
  • Online Demo
  • Project page
  • diff --git a/site/css/demo.css b/site/css/demo.css deleted file mode 100644 index 4a69f76..0000000 --- a/site/css/demo.css +++ /dev/null @@ -1,77 +0,0 @@ -/* Source Code */ -.geshicode { - padding: 0.5em; - background: #f7f7f7; - border: 1px solid #e2e2e2; -} - -/* Results table */ -#resultsTable { - border-collapse: collapse; -} - -#resultsTable th { - padding: 0.25em; - text-align: left; - background: #e2e2e2; - border: 1px solid #e2e2e2; -} - -#resultsTable td { - padding: 0.25em; - background: #f7f7f7; - border: 1px solid #e2e2e2; -} - -#resultsTable .center { - text-align: center; -} - -/* Max characters */ -.maxChars { - margin-left: 2em; - color: #888; - font-size: smaller; - font-style: italic; -} - -/** - * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann - * (http://qbnz.com/highlighter/ and http://geshi.org/) - */ -.cpp.geshicode .de1, .cpp.geshicode .de2 {font:normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;} -.cpp.geshicode {font-family:monospace;} -.cpp.geshicode .imp {font-weight:bold; color:red;} -.cpp.geshicode li, .cpp.geshicode .li1 {font-weight:normal; vertical-align:top;} -.cpp.geshicode .ln {width:1px; text-align:right; margin:0; padding:0 2px; vertical-align:top; color:#999999;} -.cpp.geshicode .kw1 {color:#0000ff;} -.cpp.geshicode .kw2 {color:#0000ff;} -.cpp.geshicode .kw3 {color:#0000dd;} -.cpp.geshicode .kw4 {color:#0000ff;} -.cpp.geshicode .co1 {color:#666666;} -.cpp.geshicode .co2 {color:#339900;} -.cpp.geshicode .coMULTI {color:#ff0000; font-style:italic;} -.cpp.geshicode .es0 {color:#000099; font-weight:bold;} -.cpp.geshicode .es1 {color:#000099; font-weight:bold;} -.cpp.geshicode .es2 {color:#660099; font-weight:bold;} -.cpp.geshicode .es3 {color:#660099; font-weight:bold;} -.cpp.geshicode .es4 {color:#660099; font-weight:bold;} -.cpp.geshicode .es5 {color:#006699; font-weight:bold;} -.cpp.geshicode .br0 {color:#008000;} -.cpp.geshicode .sy0 {color:#008000;} -.cpp.geshicode .sy1 {color:#000080;} -.cpp.geshicode .sy2 {color:#000040;} -.cpp.geshicode .sy3 {color:#000040;} -.cpp.geshicode .sy4 {color:#008080;} -.cpp.geshicode .st0 {color:#ff0000;} -.cpp.geshicode .nu0 {color:#0000dd;} -.cpp.geshicode .nu6 {color:#208080;} -.cpp.geshicode .nu8 {color:#208080;} -.cpp.geshicode .nu12 {color:#208080;} -.cpp.geshicode .nu16 {color:#800080;} -.cpp.geshicode .nu17 {color:#800080;} -.cpp.geshicode .nu18 {color:#800080;} -.cpp.geshicode .nu19 {color:#800080;} -.cpp.geshicode .me1 {color:#007788;} -.cpp.geshicode .me2 {color:#007788;} -.cpp.geshicode span.xtra {display:block;} diff --git a/site/css/pack.css b/site/css/pack.css index 5a91fa0..9af0edb 100644 --- a/site/css/pack.css +++ b/site/css/pack.css @@ -1 +1 @@ -html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}body{padding:0;font:16px Calibri,Verdana,sans-serif;color:#000;background-color:#eee}dt{font-weight:700}a:hover{-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a:link,a:visited{color:#036;text-decoration:underline}a:active,a:focus,a:hover,a:visited{color:#369}#header{color:#69c;background-color:#036}#header a{color:inherit;text-decoration:none}#header h1{margin:0;padding:0;font-family:Orbitron}#header p{margin:0;padding:0;font-size:larger}#tabs{color:#eee;background-color:#369;border-top:1px solid #000;border-bottom:1px solid #000}#tabs ul{margin:0;padding:0;list-style-type:none;font-size:larger}#tabs li{display:inline;padding:0 .5em;border-right:1px solid #000}#tabs li:first-child{padding-left:0}#tabs li:last-child{border:none}#tabs a:link,#tabs a:visited{color:#eee;text-decoration:none}#tabs a:active,#tabs a:focus,#tabs a:hover{color:#fff;text-decoration:underline}#anchors ul{margin:0;padding:.5em 0;list-style-type:none;font-size:smaller}#anchors li{display:inline;padding:0 .5em}#anchors li:first-child{padding-left:0}#anchors .wrap{padding:0}.wrap{width:50em;margin:0 auto;padding:.5em;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.rssfeeditems em{margin-left:.5em;color:#888;font-size:smaller}a.author:active,a.author:focus,a.author:link,a.author:link:hover,a.author:visited,a.author:visited:hover{color:#888}.cmd{padding:.5em;background-color:#f7f7f7;border:1px solid silver;border-left:10px solid silver}.table{border-collapse:collapse;border:1px solid #000}.table tr:nth-child(even){background-color:#f7f7f7}.table tr:nth-child(odd){background-color:#dedede}.table th{text-align:left;color:#eee;background-color:#369}.table td,.table th{padding:.2em;border-top:1px solid #000;border-bottom:1px solid #000}@media print{#header{color:#000;border-bottom:1px solid #000}#tabs{display:none}#resultsTable td,#resultsTable th{background-color:#fff;border:1px solid #000}}.geshicode{padding:.5em;background:#f7f7f7;border:1px solid #e2e2e2}#resultsTable{border-collapse:collapse}#resultsTable th{padding:.25em;text-align:left;background:#e2e2e2;border:1px solid #e2e2e2}#resultsTable td{padding:.25em;background:#f7f7f7;border:1px solid #e2e2e2}#resultsTable .center{text-align:center}.maxChars{margin-left:2em;color:#888;font-size:smaller;font-style:italic}.cpp.geshicode .de1,.cpp.geshicode .de2{font:normal normal 1em/1.2em monospace;margin:0;padding:0;background:0 0;vertical-align:top}.cpp.geshicode{font-family:monospace}.cpp.geshicode .imp{font-weight:700;color:red}.cpp.geshicode .li1,.cpp.geshicode li{font-weight:400;vertical-align:top}.cpp.geshicode .ln{width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;color:#999}.cpp.geshicode .kw1,.cpp.geshicode .kw2{color:#00f}.cpp.geshicode .kw3{color:#00d}.cpp.geshicode .kw4{color:#00f}.cpp.geshicode .co1{color:#666}.cpp.geshicode .co2{color:#390}.cpp.geshicode .coMULTI{color:red;font-style:italic}.cpp.geshicode .es0,.cpp.geshicode .es1{color:#009;font-weight:700}.cpp.geshicode .es2,.cpp.geshicode .es3,.cpp.geshicode .es4{color:#609;font-weight:700}.cpp.geshicode .es5{color:#069;font-weight:700}.cpp.geshicode .br0,.cpp.geshicode .sy0{color:green}.cpp.geshicode .sy1{color:navy}.cpp.geshicode .sy2,.cpp.geshicode .sy3{color:#000040}.cpp.geshicode .sy4{color:teal}.cpp.geshicode .st0{color:red}.cpp.geshicode .nu0{color:#00d}.cpp.geshicode .nu12,.cpp.geshicode .nu6,.cpp.geshicode .nu8{color:#208080}.cpp.geshicode .nu16,.cpp.geshicode .nu17,.cpp.geshicode .nu18,.cpp.geshicode .nu19{color:purple}.cpp.geshicode .me1,.cpp.geshicode .me2{color:#078}.cpp.geshicode span.xtra{display:block} \ No newline at end of file +html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}body{padding:0;font:16px Calibri,Verdana,sans-serif;color:#000;background-color:#eee}dt{font-weight:700}a:hover{-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a:link,a:visited{color:#036;text-decoration:underline}a:active,a:focus,a:hover,a:visited{color:#369}#header{color:#69c;background-color:#036}#header a{color:inherit;text-decoration:none}#header h1{margin:0;padding:0;font-family:Orbitron}#header p{margin:0;padding:0;font-size:larger}#tabs{color:#eee;background-color:#369;border-top:1px solid #000;border-bottom:1px solid #000}#tabs ul{margin:0;padding:0;list-style-type:none;font-size:larger}#tabs li{display:inline;padding:0 .5em;border-right:1px solid #000}#tabs li:first-child{padding-left:0}#tabs li:last-child{border:none}#tabs a:link,#tabs a:visited{color:#eee;text-decoration:none}#tabs a:active,#tabs a:focus,#tabs a:hover{color:#fff;text-decoration:underline}#anchors ul{margin:0;padding:.5em 0;list-style-type:none;font-size:smaller}#anchors li{display:inline;padding:0 .5em}#anchors li:first-child{padding-left:0}#anchors .wrap{padding:0}.wrap{width:50em;margin:0 auto;padding:.5em;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.rssfeeditems em{margin-left:.5em;color:#888;font-size:smaller}a.author:active,a.author:focus,a.author:link,a.author:link:hover,a.author:visited,a.author:visited:hover{color:#888}.cmd{padding:.5em;background-color:#f7f7f7;border:1px solid silver;border-left:10px solid silver}.table{border-collapse:collapse;border:1px solid #000}.table tr:nth-child(even){background-color:#f7f7f7}.table tr:nth-child(odd){background-color:#dedede}.table th{text-align:left;color:#eee;background-color:#369}.table td,.table th{padding:.2em;border-top:1px solid #000;border-bottom:1px solid #000}@media print{#header{color:#000;border-bottom:1px solid #000}#tabs{display:none}#resultsTable td,#resultsTable th{background-color:#fff;border:1px solid #000}} \ No newline at end of file