1
0
Fork 0
Commit graph

4281 commits

Author SHA1 Message Date
Patryk Obara
ef40533d22 Silence 2 switch warnings 2019-11-24 17:14:32 +01:00
Patryk Obara
618ab5ea08 Remove several unused variables in zmbv 2019-11-24 17:14:32 +01:00
Patryk Obara
bdee95848e Silence a number of switch warnings in zmbv 2019-11-24 17:14:32 +01:00
Patryk Obara
723dfdbe46 Silence static analysis false-positive garbage value
Clang static analyzer returned a false-positive issue in line 671:

The right operand of '<' is a garbage value

Variables needed to be moved up, because otherwise initialization
crosses to the next case.
2019-11-24 17:14:32 +01:00
Patryk Obara
f105697165 Silence a number of switch warnings in vga_xga
In total, 28 warnings are removed by adding these few default cases.
2019-11-24 17:14:32 +01:00
Patryk Obara
64671a888c Avoid passing null to strcat
Static analysis indicated an issue, when line was being passed as 2nd
argument to strcat:

Null pointer passed as an argument to a 'nonnull' parameter

Replace repeated strcat with creating a formatted string and use
the opportunity to do a small format cleanup.
2019-11-24 17:14:32 +01:00
Patryk Obara
b344344821 Properly fix warnings about unused variable
A workaround with no-op assignment fools the compiler and static
analyzer, but the proper fix cleans up this code as well.
2019-11-24 17:14:32 +01:00
krcroft
3dd2be0a91 Apply new warnings counts from master 2019-11-24 15:16:44 +01:00
krcroft
30b5246f9f Refactor and expand the CI workflows
- For each OS, builds of the default compiler plus the
  latest-supported compilers are run. When multiple operating systems
  are supported (such as Ubuntu 16.04 and latest), a build on
  the oldest OS using its default compiler is also performed.

- Debug builds are used because they often are more thorough at
  detecting coding issues (debug warning counts are higher).

- Runtime dynamic sanitizers are added and serialized per-compiler.
  Their build and runtime log-files are xz-compressed, and then
  GitHub's asset upload Zips the log directory.

- Each workflow now holds the maximum allowed compiler warnings
  per-build, so we can have tighter control of when new warnings
  are introduced (that would otherwise pass if still below the
  maximum)

- Use of github's new 'cache' feature has been leveraged to restore
  the brew, macports, and msys2 environments to eliminate the
  lenghthy setup times for those environments.  If a new cache
  is needed, then we simply increment the cache `key:` value and
  the next CI run will archive new caches. (Note that GitHub has a
  400MB limit on cache size however they have already said they
  are raising it - so we might be able to cache out longest running
  job which is MSYS+Clang)

- Where it makes sense, multi-line workflow statements have been
  broken out into .github/scripts as files to make the workflow YAML
  leaner and more readable, while giving us a richer environment in
  the scripts.
2019-11-24 15:16:44 +01:00
krcroft
0f11ab8ecb Refactor the build and list-packages scripts
Until now the build and package scripts have supported
several architectures, compilers, build types, package-managers,
and bit-depth targets.

The code might be maintainable if left as-such, however we have plans
to continue expanding the number of architectures (ARM, PPC, ... ),
operating systems (Android, BSDs, ...), and build variations
amung those.

The scripts (regardless of language) would only grow in complexity
as more variations are added. Thus, we needed a solution that can
scale without adding complexity.

To achieve this, the scripts were refactored as follows:
 - all "data" was moved out of code into configuration files
 - A back-end "Automator" engine was written to parse the
   data based on generic variables fed to it by a front-end
   script
 - build.sh and list-packages.sh were re-authored as thin front-end
   scripts that drive the automator
 - Their CLI's were retained so there has been very little change
   needed to the CI invocation lines.  The only changes have been to
   clarify the existing arguments improved based on feedback, ie:
   --build-type release, --build-type debug instead of fast, small
2019-11-24 15:16:44 +01:00
krcroft
fd74aa0720 Allow maximum-issues to be set via command-line
This change allows the maximum issues to be passed in as an argument.
If nothing is passed, then the existing build-in maximum is
used.

Retaining the existing built-in value makes sense for home
users to keep track of their local build (otherwise they would have
to remember the prior number of warnings and pass that value
in for subsequent builds).

Motivation: until now the built-in maximum covers the build permutation
that happens to generate the most warnings versus other builds.
In some cases new warnings may not be cause if they elicit a warning
from the lesser-warning build(s) or compilers, but not in the
maximum-warning build.

This change lets us tighten-down the warning uniquely for each build,
so we can be sure all new warnings are flagged to the developer.
2019-11-24 15:16:44 +01:00
Patryk Obara
e5d43e1b8f Update allowed warnings limit 2019-11-23 18:46:05 +01:00
Patryk Obara
ef144e4bca Merge branch 'svn/trunk' r4294 2019-11-23 18:41:05 +01:00
Peter Veenstra
f923a8e644 a=a can trigger warnings as well. This should be hopefully do the trick.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4294
2019-11-22 07:28:27 +00:00
Patryk Obara
cdc193170c Merge branch 'svn/trunk' r4293 2019-11-21 20:53:21 +01:00
Peter Veenstra
db51b63554 Remove some old code and do an a=a to trick a compiler in non-debug mode
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4293
2019-11-20 07:17:12 +00:00
Peter Veenstra
8cb2e08f31 Refinements of commit 4291, so that precission can be specified as well and less fixed defines are used
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4292
2019-11-19 16:16:06 +00:00
Peter Veenstra
01fe58047e Try to solve the Bitu formatting warning on all supported platforms (both 32 and 64 bit). Did a few places. Still a lot to go. Changed default display of Bitu to be unsigned instead of signed.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4291
2019-11-18 21:08:57 +00:00
Patryk Obara
c5c0164471 Remove SpeexDSP mention from the documentation 2019-11-16 12:16:35 +01:00
Patryk Obara
8e5f7dd55d Merge branch 'svn/trunk' r4290 2019-11-16 12:14:23 +01:00
Patryk Obara
63c946a79c Update allowed warnings limit 2019-11-16 04:31:19 +01:00
Patryk Obara
ea06a145b6 Fix several printf format warnings 2019-11-16 04:31:19 +01:00
Patryk Obara
8824504474 Silence several sometimes-uninitialized warnings
GCC compiler reports these as:

warning: variable (…) is used uninitialized whenever switch default
is taken
2019-11-16 04:31:19 +01:00
Patryk Obara
97ded39c2e Remove unused variable 2019-11-16 04:31:19 +01:00
Patryk Obara
d63849ea72 Remove unused function 2019-11-16 04:31:19 +01:00
Patryk Obara
41126f8ff9 Fix unused-function warning
This function is used only inside x86 ifdef, so move it to prevent the
warning. Also, use this opportunity to improve readability a bit.
2019-11-16 04:31:19 +01:00
Patryk Obara
ce1deb1516 Silence a number of switch warnings
Avoid "default" case when only 1-2 enumarations are missing.
2019-11-16 04:31:19 +01:00
Patryk Obara
5b99e786f0 Colorize linter output 2019-11-16 02:27:24 +01:00
Patryk Obara
9a296eded9 Force python3 pylint
Some distributions provide python2 version of pylint package by default,
but all provide pylint for python3 in some package.  Python 2 reaches
EOL in few months, so there's no reason to support it.

This prevents our scripts from being accidentally marked invalid due to
language changes between python 2 and 3.  Also, newer pylint has nicer
output, that provides exact module filename straight in the warning.
2019-11-16 02:27:24 +01:00
Patryk Obara
2b386fbf52 List files before running linters
Makes it more readable for human consumption. Also, redirect initial
output to stderr to fix e.g. output to json file.
2019-11-16 02:27:24 +01:00
Peter Veenstra
e2e974336a Typo's.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4290
2019-11-15 18:38:02 +00:00
Peter Veenstra
a533565297 Init some more fields in the constructors, else uninited stuff gets copied in copy constructors.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4289
2019-11-15 18:37:20 +00:00
Patryk Obara
ae6c1e9a89 Fix order of includes in Windows-specific files
These files assume, that WIN32 is defined by compiler or MSVC project
file, when in MSYS2 and MinGW environments, it is defined in config.h
and appears after dosbox.h is included, which in turn is included by
associated header (cdrom.h in this case).

Fixes: #42
2019-11-14 23:17:54 +01:00
Patryk Obara
8ea7bcf762 Remove -DWIN32 from build.sh 2019-11-14 23:17:54 +01:00
Patryk Obara
1f07886767 Propagate return code in the msys2 bash wrapper
Fixes: #41
2019-11-14 23:17:54 +01:00
Patryk Obara
2bfae63f1f Run fast script linters before heavier analysis
Includes two small scripts: verify-bash.sh for running shellcheck, and
verify-python.sh for running pylint.

.pylint rc files is a default configuration file generated by
pylint 2.3.1, with one change (min-similarity-lines changed
from 4 to 10).
2019-11-14 20:33:36 +01:00
Patryk Obara
c6167533bf Rename workflow file for static code analysis 2019-11-14 20:33:36 +01:00
Patryk Obara
e954fe3237 Remove unused bash variable
Reported by shellcheck 0.7.0 (SC2034)
2019-11-14 20:33:36 +01:00
Patryk Obara
6de2e6bd41 Remove unnecessary use of a comprehension
Reported by pylint 2.4.4 (unnecessary-comprehension)
2019-11-14 20:33:36 +01:00
Patryk Obara
3b0a62ad4c Change module documentation to a raw string
Prevents anomalous-backslash-in-string ('\m') pylint warning.
2019-11-14 20:33:36 +01:00
Patryk Obara
56a41dd789 Merge branch 'svn/trunk' r4288 2019-11-14 12:31:20 +01:00
Peter Veenstra
96bdc056ee Fix double to be (or not to be ;)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4288
2019-11-12 19:40:43 +00:00
Peter Veenstra
b0d42ff52a update configure -h output for dynamic x64
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4287
2019-11-12 17:55:51 +00:00
Peter Veenstra
1eac5c516c Update INSTALL file (modified version of patch #283 by dreamer_)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4286
2019-11-12 17:54:55 +00:00
Patryk Obara
4e65c8f69f Add asserts to prevent a potential bug
Use C++11 static_assert to assure, that code behaves correctly; if
Chip or Channel structs will be changed to non-std layout or a different
first fields will be introduced, that will invalidate the offset
calculation.

Additionally, add asserts to prevent possibility of introducing a bug
when offset stored in one the tables is 0.
2019-11-12 17:13:01 +01:00
Patryk Obara
1e95311081 Add cases for missing SynthMode enumerations
Silence compiler warnings:
enumeration value 'sm2Percussion' not handled in switch [-Wswitch]
enumeration value 'sm3Percussion' not handled in switch [-Wswitch]
2019-11-12 17:13:01 +01:00
Patryk Obara
a22acca119 Explicitly use C++11 for compilation
Otherwise compilation fails on GCC 5.4 in Steam Runtime environment.

As of 2019, all up-to-date compilers support C++11, most of them
use C++14 as default standard, but C++14 is not fully supported by
autoconf in Ubuntu 16.04 LTS.

Full C++11 support was introduced in GCC 4.8.1 and Clang 3.3.
2019-11-12 17:13:01 +01:00
Patryk Obara
576a104dc8 Use macos-latest and windows-latest in CI jobs
GitHub notified me, that they are dropping macOS-10.14 completely, all
users are upgraded to macOS-10.15 and the only valid value in CI jobs
will be macos-latest from now on.

I haven't seen any indication of the same happening for Windows
machines, but GitHub Actions documentation dropped all references to
windows-2016 and windows-2019 - windows-latest seems to be the only
valid value for shared runners from now on.

Ubuntu machines are left as they are (thankfully).
2019-11-12 16:52:28 +01:00
Patryk Obara
43170ff1c2 Merge branch 'svn/trunk' r4284 2019-11-12 16:13:13 +01:00
Peter Veenstra
fab69cb4c7 Stuff written to the console needs a cariage return since 4114. Thanks for spotting this dreamer_.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4284
2019-11-12 13:31:23 +00:00