Commit Graph

18 Commits

Author SHA1 Message Date
Jay Berkenbilt 7c0fdf8510 Format code, bump clang-format version to 18 2023-12-22 21:45:10 -05:00
m-holger 5906dd5c1f Code tidy - Clang-Tidy rule modernize-use-default-member-init 2023-06-09 15:43:21 +01:00
Jay Berkenbilt 60965d5f4d Rerun clang-format 2023-05-21 13:35:09 -04:00
m-holger d0682f0f60 Use nullptr instead of 0 or NULL 2023-05-20 15:41:36 +01:00
Jay Berkenbilt 1e53da74bc
Merge pull request #918 from m-holger/fixqdf
Code tidy QdfFixer methods
2023-03-18 14:00:11 -04:00
m-holger cfcceff6aa Replace std::regex_search with string_view methods in QdfFixer::processLines 2023-03-09 12:16:33 +00:00
m-holger 011b1d7e3a Use std::string_view in QdfFixer::processLines
Change type of local var lines to string_view. Also, instead of
constructing a list of lines, read the entire input into a single string
and break it up into lines on the fly.stash
2023-03-09 11:44:26 +00:00
m-holger 82efe52b7d Tidy QdfFixer::adjustOstreamXref 2023-03-08 10:00:17 +00:00
m-holger fc828c2a50 Tidy QdfFixer::checkObjId 2023-03-08 09:56:53 +00:00
m-holger 71bba5d40d Code tidy QdfFixer::writeBinary 2023-03-08 09:50:49 +00:00
m-holger 2e6869483b Replace calls to QUtil::int_to_string with std::to_string 2022-09-21 15:57:14 -04:00
Jay Berkenbilt 7f023701dd Formatting: remove space in range-style for loops
Change .clang-format and commit automated changes from a fresh run of
format-code
2022-04-30 13:26:43 -04:00
Jay Berkenbilt 12f1eb15ca Programmatically apply new formatting to code
Run this:

for i in  **/*.cc **/*.c **/*.h **/*.hh; do
  clang-format < $i >| $i.new && mv $i.new $i
done
2022-04-04 08:10:40 -04:00
Jay Berkenbilt cb769c62e5 WHITESPACE ONLY -- expand tabs in source code
This comment expands all tabs using an 8-character tab-width. You
should ignore this commit when using git blame or use git blame -w.

In the early days, I used to use tabs where possible for indentation,
since emacs did this automatically. In recent years, I have switched
to only using spaces, which means qpdf source code has been a mixture
of spaces and tabs. I have avoided cleaning this up because of not
wanting gratuitous whitespaces change to cloud the output of git
blame, but I changed my mind after discussing with users who view qpdf
source code in editors/IDEs that have other tab widths by default and
in light of the fact that I am planning to start applying automatic
code formatting soon.
2022-02-08 11:51:15 -05:00
Jay Berkenbilt 0dea276997 Fix fix-qdf for empty streams 2020-10-23 06:39:42 -04:00
Jay Berkenbilt 578c5ac66c Use more references when iterating
When possible, use `for (auto&` or `for (auto const&` when iterating
using C++-11 style iterators.
2020-04-10 13:30:33 -04:00
Jay Berkenbilt 1a7d3700a6 Fix unnecessary copies in auto iter (fixes #426)
Also switch to colon-style iteration in some cases. Thanks to Dean
Scarff for drawing this to my attention after detecting some
unnecessary copies with
https://clang.llvm.org/extra/clang-tidy/checks/performance-for-range-copy.html
2020-04-08 20:45:26 -04:00
Jay Berkenbilt 388990f7bc Rewrite fix-qdf in C++ 2020-01-14 11:53:19 -05:00