Commit Graph

20679 Commits

Author SHA1 Message Date
Sebastian fd3e1ceefc
donate-cpu.py: Enable new libraries (planned after release of 1.88) (#1940)
Tested locally
2019-07-01 10:40:10 +02:00
IOBYTE bf4e1ef790 template simplifier: consistently handle templates with no arguments (#1939)
this fixes daca boost1.67 crashes
2019-07-01 07:01:14 +02:00
Georgy Komarov f8c350fc70 misra.py: Add R18.7 check (#1934)
* misra.py: Add 18.7 check

* Simplify R18.7 check

* use token.link

* Remove isStruct method
2019-07-01 07:00:43 +02:00
Daniel Marjamäki 0eedcfc160 Fixed #7464 (warn about opposite if and else-if conditions) 2019-06-30 23:26:49 +02:00
Daniel Marjamäki 8be4af33d3 tools/donate-cpu-server: speed up the diff reports using the new diff files 2019-06-30 23:16:04 +02:00
Scott Furry e459762bcd Suppress Code semantic and syntax warnings (#1936)
Sources were built with Clang but with increased verbosity of error detection.

A number of syntax and semantic warnings were encountered. Commit adds
changes to correct these warnings.

Some changes involve removing extra, and unncessary, semi-colons at EOL
(e.g. at end of switch clause).

Project astyle settings are not currently setup to detect if a file is to
have an extra carriage return after the last line of data. Two files were
altered to ensure an extra carriage return.

An advisory to enhance code was encountered in triage code. Clang advisory
on a for-loop interation value suggested that:
`use reference type 'const QString &' to prevent copying`
2019-06-30 21:43:25 +02:00
Scott Furry a195477470 Correct Zero/Null as pointer constant (#1938)
Building with enhanced clang warnings indicated a large number of
instances with the warning:

`warning: zero as null pointer constant`

Recommended practice in C++11 is to use `nullptr` as value for
a NULL or empty pointer value. All instances where this warning
was encountered were corrected in this commit.

Where warning was encountered in dependency code (i.e. external library)
no chnages were made. Patching will be offered upstream.
2019-06-30 21:39:22 +02:00
Daniel Marjamäki 7fe021199b tools/pr.py: use -b to just checkout pull request code in a branch 2019-06-30 21:24:11 +02:00
Sebastian 389df97352
gtk.cfg: Add/improve g_ascii_*() functions (#1927)
* gtk.cfg: Add/improve g_ascii_*() functions

Found via daca@home

* gtk.cfg: Add `<const/>` where applicable (forgotten in last commit)

* gtk.cfg: Add `<valid>0:255</valid>` for `gchar` ASCII value arguments
2019-06-30 21:16:45 +02:00
Daniel Marjamäki c0b06fbce9 tools/readme.md: short description of astyle-client 2019-06-30 19:20:29 +02:00
Daniel Marjamäki daa770a5ee tools/daca2-report.py: I removed this script, I do not see any usage for it 2019-06-30 18:53:09 +02:00
Daniel Marjamäki 4d81b77249 Fixed Cppcheck warning, condition is always false 2019-06-30 18:43:55 +02:00
Daniel Marjamäki 56df6169fb Fixed #8356 (ValueFlow: variable is not changed in for loop) 2019-06-30 17:50:35 +02:00
albert-github 280a0a7b2f Wrong argument name used in documentation (#1937)
Trivial error in documentation
2019-06-30 15:41:53 +02:00
orbitcowboy b07cc09fa9 wxwidgets.cfg: Added support for more interfaces. 2019-06-30 14:20:54 +02:00
Daniel Marjamäki 098144fbe8 donate-cpu-server.py: Fixed bug 2019-06-30 14:14:02 +02:00
Daniel Marjamäki c9db395d43 donate-cpu-server: Refactor diff handling. Statistics for a package is generated when the package is uploaded. 2019-06-30 14:02:51 +02:00
Daniel Marjamäki 423e23b430 donate-cpu: changed names 2019-06-30 12:43:05 +02:00
Daniel Marjamäki 54a5a73d6a Add chschmidt to AUTHORS 2019-06-30 11:58:47 +02:00
Scott Furry 1994b21ae5 Minor Corrections to Doxygen data (#1935)
Increasing the verbosity in Clang, warnings were produced that identified
differences in code and doxygen-formatted comments.

Corrections applied to silence warnings yet still convey intent of original comments.
2019-06-30 09:17:42 +02:00
Daniel Marjamäki d9a9743b8a Revert "Calculate token scopes in advance rather than as the tokenlist is iterated (#1882)"
This reverts commit 0d7836f3a0.
2019-06-30 09:12:18 +02:00
Daniel Marjamäki 236c1955ac createrelease: automate a little more 2019-06-29 16:17:39 +02:00
rebnridgway 0d7836f3a0 Calculate token scopes in advance rather than as the tokenlist is iterated (#1882)
* Added scopeinfo member to token class

Moved ScopeInfo2 declaration here as well because that's where it needs to be now.

* Added scopeinfo accessors and declaration to class

* Add new method for calculating scopes

This replaces the methods in the TemplateSimplifier which calculate the current scope as the token list is iterated.  The old method required checking if the scope had changed for every token multiple times (for multiple iterations), which was surprisingly costly.  Calculating scopes in advance like this decreases runtime on a worst-case file by around thirty percent.
ScopeInfo objects are disposed of when the TemplateSimplification is done as they are not used later.

* Add calculateScopes method to header

* Removed code that calculated current scope

This has been replaced by code that calculates the scopes up front and stores them with each token, which is much faster.

* Fixed compile errors from extra parentheses

* Added missing code to fix memory leak

* Added code to actually clean up ScopeInfo structs

* Tidy up a dodgy for loop

* Convert argument to const ref

* Calculate missing scopes

As the templatesimplificator expands templates and does multiple passes it needs to make sure all scopes are calculated.

* Remove copying the scope to the next token

This is now done properly when scopes are calculated.

* Remove call to calculateScopes

This is now done by the TemplateSimplifier.

* Recalculate scopes for every pass of simplifyTemplates

* Add code to calculate extra scopes as they are added

I thought that this might be useful for calculating scopes when Tokens are created, but as there are several ways of creating Tokens that don't guarantee that they are placed in a list it is easier to just calculate scopes when you know you have a list and when you know you're adding to a list.

* Fix several bugs and poorly designed code

Remove the global scopes collection, and clean them up instead by iterating through the tokenlist to find them.  This means scopes can be calculated by functions in the Token class as well as in the Tokenizer class without leaking the scope object.
Fix a couple of bugs in the calculateScopes method and make it more efficient.

* Remove unnecessary calls to calculateScopes

* Move brace to correct position

Calculating scopes during insertToken only needs to happen if we created a new Token.

* Handle 'using namespace' declarations separately

This fixes a bug caused by a statement matching 'struct B < 0 > ;'

* Fix argument name mismatch

* Actually use newScopeInfo when inserting Token

* Switch to using shared_ptr to hold scopeInfos

This means ScopeInfo2 objects get properly cleaned up when they are no longer needed.

* Change ScopeInfo member to be a shared_ptr

* Update code to use shared_ptr

* Add missing include for shared_ptr

* Remove unnecessary cleanup code

This has been replaced by shared_ptr for ScopeInfo2 objects
2019-06-29 14:34:22 +02:00
Rikard Falkeborn d1d622b74c Valueflow: support global static const variables (#1861) 2019-06-29 14:33:55 +02:00
Daniel Marjamäki 090fa255e8 daca@home: use Cppcheck-1.88 as base version 2019-06-29 11:01:42 +02:00
Daniel Marjamäki 987be045b8 Update createrelease 2019-06-29 10:49:59 +02:00
Daniel Marjamäki 17c5587ac5 Restore Makefile after release 2019-06-29 10:22:35 +02:00
Daniel Marjamäki 7b3efa3f52 createrelease: Update script 2019-06-29 10:21:03 +02:00
Daniel Marjamäki 4b67780bae cppcheck.wxs: Install more --library configuration files 2019-06-29 09:51:25 +02:00
PKEuS 21f4574e74 lupdate and lrelease
Updated german translation
2019-06-29 09:50:53 +02:00
Daniel Marjamäki 069ecb0a50 1.88: Update Makefile 2019-06-29 09:24:02 +02:00
Daniel Marjamäki faaabc74a7 Set version 1.88 2019-06-29 08:38:13 +02:00
Daniel Marjamäki 4f2c0ee8ac Update AUTHORS 2019-06-29 08:34:21 +02:00
Daniel Marjamäki 341406ab17 Fixed Cppcheck warning; ::AddonInfo::getFullPath can be static 2019-06-29 07:59:55 +02:00
Daniel Marjamäki 0a41f1ad6b Fix Cppcheck warning: Suppressions::dump can be const 2019-06-29 07:53:32 +02:00
Daniel Marjamäki 84cc09d17c Update Copyright 2019-06-29 07:49:14 +02:00
Daniel Marjamäki d8daca30bf lupdate gui.pro 2019-06-29 07:47:36 +02:00
Daniel Marjamäki 9c3c2d785b Fixed Cppcheck warning 2019-06-29 07:46:25 +02:00
Daniel Marjamäki 0ab3d07f75 Revert "GUI: Show information label if Cppcheck is outdated"
I plan to add something like this again after the release.
2019-06-28 22:36:19 +02:00
Rikard Falkeborn 0d69a86bf8 Remove debug printout (#1933) 2019-06-28 22:08:32 +02:00
IOBYTE 8b347aed42 Fixed #8663 (Stack overflow with template disambiguator) (#1932) 2019-06-28 22:07:21 +02:00
Daniel Marjamäki 5f759e89b3 GUI: Show information label if Cppcheck is outdated 2019-06-28 20:13:59 +02:00
Daniel Marjamäki c2144d73b3 windows.cfg: SetClipboardData takes the data so the configuration should not say <leak-ignore>/ (https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-setclipboarddata) 2019-06-28 17:30:05 +02:00
Scott Furry 6d3d44835a Add keyboard shortcuts for CodeEditor Widget (#1931)
Functionality for `copy` and `select all` text already exists as part
of widget construction. Commit adds connection of those existing
functions to execution with keyboard shortcuts user would normally expect.
(e.g. CTRL+C for copy text)

Qt does translation of keyboard shortcuts for platform
(i.e. Mac OS uses command key rather than control).
2019-06-28 17:17:24 +02:00
Daniel Marjamäki 325af2399b man: document the <smart-pointer> element 2019-06-28 17:15:53 +02:00
Daniel Marjamäki 481d94f059 reference-cfg-format: Document the direction attribute 2019-06-28 15:18:00 +02:00
IOBYTE 16788df055 template simplifier: various small fixes (#1916)
* fix adding instantiation of first argument to an instantiation

* add support for function pointer template variables

* fix more cases where templates ending in ">>" are changed to end in "> >"

* fix travis build

* standard types can't be a template parameter name

* remove redundant level == 0 checks

* fix lambda in template variable

* fix a test
2019-06-28 11:14:20 +02:00
Carlo Marcelo Arenas Belón ec4e43767e minor improvements (#1929)
* lib: isNonBoolStdType no longer needed

lib/checkbool.cpp:50:13: warning: unused function 'isNonBoolStdType'
      [-Wunused-function]
static bool isNonBoolStdType(const Variable* var)

* cmake: C++11 is required

also change instructions to a more common syntax
2019-06-28 06:57:05 +02:00
Daniel Marjamäki 243db9b69a astyle_client: reformat given source files 2019-06-27 09:24:22 +02:00
Ken-Patrick 927d139488 Fix FP #9165 (#1928)
Properly check the type of the expressions, instead of using the type
of the tokens
2019-06-27 07:48:44 +02:00