dosbox-staging:po/safe-strcpy-win-1

Last commit made on 2020-04-02
Get this branch:
git clone -b po/safe-strcpy-win-1 https://git.launchpad.net/dosbox-staging

Branch merges

Branch information

Name:
po/safe-strcpy-win-1
Repository:
lp:dosbox-staging

Recent commits

d6a4218... by dreamer_

WIP test safe str*cpy replacements

68a1291... by dreamer_

Update clang-format rules to 9.0

Set AllowAllConstructorInitializersOnNextLine to false. This prevents
formatting problem when initializer list is long enough to be wrapped
once, but all initializers fitted into the next line.

Turn on AlignConsecutiveMacros option.

48c7add... by Patrick McMorris <email address hidden>

Organize files in VS solution

Mirror project structure on the file system.

78ae277... by krcroft <email address hidden>

Expand use and support for LTO and FDO builds

Adds LTO to the CI build for Linux, which bring it as close as possible
to the planned formal release, which will additionally use FDO.

Adds some helper scripts to work with FDO files.

Improves the build notes for how to create and use FDO files.

0759165... by dreamer_

Implement script for re-formatting recent commits

This script is intended to be used in two situations:

- When user can't configure clang-format in code editor or IDE
- Potentially to be used in CI in the future

Normal usecase is to run this script after commit, then review and
add formatted code, and amend the commit, e.g.:

  git commit -m "Edit some C++ code"
  ./scripts/format-commit.sh
  git add -p # select formatting changes you want to use
  git commit --amend

Run:

  ./scripts/format-commit.sh --help

to learn about other options.

e4d3188... by dreamer_

Add clang-format rules

Rules are defined for all C/C++ code, except src/libs.

These rules are designed to emulate kernel coding convention with some
adaptations for C++11. Configuration file uses options available in
clang-format 8.0 (the newest version in 10.0) to provide compatibility
with older environments and operating systems. Some options are
commented out and marked with TODOs - those need to be investigated and
enabled/disabled during upgrade to clang-format 9.0.

DOSBox codebase is a mix of various styles with only few consistent
rules seen throughout the codebase, these clang-format rules preserve
some of existing conventions and conciously break with others.

Some unwritten upstream rules, that are now encoded in clang-format:

- Using tab for indentation.
- K&R-like indentation for control statements.
- Indentation rules for structs, classes, and non-anonymous enums.
- Case labels in switch statements are aligned the same way goto
  statements would be (also K&R rule).

Some formatting aspects that were not followed consistently throughout
old DOSBox code, but are now encoded in clang-format:

- Space placing in control statements and function calls (makes the code
  much more readable).
- Control statements (if-else, while) must be broken into multiple lines
  (makes the code more readable, helps with debugging, reading compiler
  logs and static analysis reports).

Some unwritten upstream rules, that are now changed by these rules:

- Placing opening function bracket in the same line as function
  declaration (not in line with K&R). This rule makes it hard to make
  constructor formatting consistent - old code dealt with it by not
  formatting initializer lists at all. Unformatted initializer list can
  result in lines hundreds of lines long and make it hard to add/remove
  class fields while assuring correct initialization order.
  In new clang-format rules K&R indentation is followed, allowing
  initalizer lists to be formatted one initializer per line (which makes
  it much easier to read and edit.

71f892d... by dreamer_

Cleanup workflow files

abb6e12... by dreamer_

Move PVS Studio static analysis to a separate file

This job depends on credentials stored in GitHub secrets, therefore
fails for pull requests created by new contributors out of their forked
repos.

619742f... by krcroft <email address hidden>

Improve comment about EXPOSED event

c2b3015... by krcroft <email address hidden>

Eliminate redundant use void arguments