Commit Graph
162 Commits
Author SHA1 Message Date
Tom Krizek cf92d05908 Enforce Python codestyle with black
Black is an opinionated tool for auto-formatting Python code so we no
longer have to worry about the codestyle.

For the codestyle decisions and discussion, refer to the upstream
documentation [1].

[1] https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html
2022-06-08 13:29:01 +02:00
Tom Krizek 8668c8c061 Remove trailing whitespace
My editor doesn't like that!

(cherry picked from commit 5d64d05be9)
2022-06-08 13:24:30 +02:00
Ondřej SurýandOndřej Surý b624be2544 Remove use of the inline keyword used as suggestion to compiler
Historically, the inline keyword was a strong suggestion to the compiler
that it should inline the function marked inline.  As compilers became
better at optimising, this functionality has receded, and using inline
as a suggestion to inline a function is obsolete.  The compiler will
happily ignore it and inline something else entirely if it finds that's
a better optimisation.

Therefore, remove all the occurences of the inline keyword with static
functions inside single compilation unit and leave the decision whether
to inline a function or not entirely on the compiler

NOTE: We keep the usage the inline keyword when the purpose is to change
the linkage behaviour.

(cherry picked from commit 20f0936cf2)
2022-03-25 09:37:18 +01:00
Ondřej SurýandOndřej Surý 75f9dd8e82 Simplify way we tag unreachable code with only ISC_UNREACHABLE()
Previously, the unreachable code paths would have to be tagged with:

    INSIST(0);
    ISC_UNREACHABLE();

There was also older parts of the code that used comment annotation:

    /* NOTREACHED */

Unify the handling of unreachable code paths to just use:

    UNREACHABLE();

The UNREACHABLE() macro now asserts when reached and also uses
__builtin_unreachable(); when such builtin is available in the compiler.

(cherry picked from commit 584f0d7a7e)
2022-03-25 09:33:51 +01:00
Ondřej SurýandOndřej Surý 673e53f81d Add FALLTHROUGH macro for __attribute__((fallthrough))
Gcc 7+ and Clang 10+ have implemented __attribute__((fallthrough)) which
is explicit version of the /* FALLTHROUGH */ comment we are currently
using.

Add and apply FALLTHROUGH macro that uses the attribute if available,
but does nothing on older compilers.

In one case (lib/dns/zone.c), using the macro revealed that we were
using the /* FALLTHROUGH */ comment in wrong place, remove that comment.

(cherry picked from commit fe7ce629f4)
2022-03-25 09:30:16 +01:00
Ondřej Surý 2bf7921c7e Update the copyright information in all files in the repository
This commit converts the license handling to adhere to the REUSE
specification.  It specifically:

1. Adds used licnses to LICENSES/ directory

2. Add "isc" template for adding the copyright boilerplate

3. Changes all source files to include copyright and SPDX license
   header, this includes all the C sources, documentation, zone files,
   configuration files.  There are notes in the doc/dev/copyrights file
   on how to add correct headers to the new files.

4. Handle the rest that can't be modified via .reuse/dep5 file.  The
   binary (or otherwise unmodifiable) files could have license places
   next to them in <foo>.license file, but this would lead to cluttered
   repository and most of the files handled in the .reuse/dep5 file are
   system test files.

(cherry picked from commit 58bd26b6cf)
2022-01-11 12:22:09 +01:00
Evan Hunt df698d73f4 update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
Ondřej SurýandOndřej Surý 58e20fa746 Convert the documentation to Sphinx documentation format
The ARM and the manpages have been converted into Sphinx documentation
format.

Sphinx uses reStructuredText as its markup language, and many of its
strengths come from the power and straightforwardness of
reStructuredText and its parsing and translating suite, the Docutils.

(cherry picked from commit 9fb6d11abb)
2020-06-01 09:54:45 +02:00
Mark AndrewsandOndřej Surý af14091f65 Refactor the isc_log API so it cannot fail on memory failures
The isc_mem API now crashes on memory allocation failure, and this is
the next commit in series to cleanup the code that could fail before,
but cannot fail now, e.g. isc_result_t return type has been changed to
void for the isc_log API functions that could only return ISC_R_SUCCESS.

(cherry picked from commit 0b793166d0)
2020-03-18 11:44:18 +01:00
Evan Hunt f0972d5bbd some Fossies-reported spelling errors were accidentally left unfixed
(cherry picked from commit a2aa29ed4f)
2020-02-21 14:15:18 -08:00
Evan Hunt 11a0d771f9 fix spelling errors reported by Fossies.
(cherry picked from commit ba0313e649)
2020-02-21 07:05:31 +00:00
Evan Hunt b9a5508e52 remove ISC_QUEUE as it is no longer used 2019-11-07 11:55:37 -08:00
Ondřej Surý 212e267b05 Update the coding style to reflect the year 2019 and C11 standard 2019-10-22 12:19:14 +02:00
Ondřej Surý 1b716a39f5 Simplify isc_mem_create() to always use defaults and never fail
Previously, the isc_mem_create() and isc_mem_createx() functions took `max_size`
and `target_size` as first two arguments.  Those values were never used in the
BIND 9 code.  The refactoring removes those arguments and let BIND 9 always use
the default values.

Previously, the isc_mem_create() and isc_mem_createx() functions could have
failed because of failed memory allocation.  As this was no longer true and the
functions have always returned ISC_R_SUCCESS, the have been refactored to return
void.
2019-09-12 09:26:09 +02:00
Ondřej Surý ae83801e2b Remove blocks checking whether isc_mem_get() failed using the coccinelle 2019-07-23 15:32:35 -04:00
Ondřej Surý 1877139a32 Simple text files with docs on build or design don't really need copyright on their own 2019-04-18 08:52:00 +02:00
Ondřej Surý 2621db706e Update dev documentation to explicitly mention that #include <config.h> should not be used 2019-03-08 17:14:38 +01:00
Ondřej Surý fa33b4ee23 Remove the traces of ATF from documentation 2018-11-15 16:29:51 +01:00
Evan Hunt bf9c60078a don't use $() in system tests 2018-09-11 14:02:25 -04:00
Ondřej Surý f0f71420c8 Remove legacy support for AIX 2018-08-28 10:31:47 +02:00
Witold Kręcicki 44cec639c4 CHANGES/notes/docs 2018-08-16 19:46:10 +02:00
Ondřej Surý 994e656977 Replace custom isc_boolean_t with C standard bool type 2018-08-08 09:37:30 +02:00
Ondřej Surý cb6a185c69 Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-08 09:37:28 +02:00
Mark AndrewsandEvan Hunt bb1937aaec Resolve "run xmllint on *.xml and *.docbook in precheck" 2018-07-10 20:49:40 -04:00
Evan Hunt 9147a31b94 copyrights 2018-05-23 12:39:40 -04:00
Ondřej Surý 174d00fbb8 Add notice about closing stdout/stderr file descriptors to style.md 2018-05-14 07:54:23 +02:00
Ondřej Surý 55a10b7acd Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
Michał KępieńandOndřej Surý 4df4a8e731 Use dns_fixedname_initname() where possible
Replace dns_fixedname_init() calls followed by dns_fixedname_name()
calls with calls to dns_fixedname_initname() where it is possible
without affecting current behavior and/or performance.

This patch was mostly prepared using Coccinelle and the following
semantic patch:

    @@
    expression fixedname, name;
    @@
    -	dns_fixedname_init(&fixedname);
    	...
    -	name = dns_fixedname_name(&fixedname);
    +	name = dns_fixedname_initname(&fixedname);

The resulting set of changes was then manually reviewed to exclude false
positives and apply minor tweaks.

It is likely that more occurrences of this pattern can be refactored in
an identical way.  This commit only takes care of the low-hanging fruit.
2018-04-09 12:14:16 +02:00
Ondřej Surý c34d76ed36 Remove idnkit-1.0 copy from BIND sources 2018-03-17 13:05:19 +00:00
Evan Hunt 0fabe0da83 update file headers 2018-03-15 18:33:13 -07:00
Evan Hunt 985d35f6b7 Set up CONTRIBUTING.md
- moved into place from doc/dev/contrib.md
- build CONTRIBUTING from CONTRIBUTING.md, like README and OPTIONS
2018-02-27 14:40:34 -08:00
Mukund SivaramanandEvan Hunt 451241a776 working directory is usually not in PATH 2018-02-26 12:55:12 -08:00
Ondřej Surý 843d389661 Update license headers to not include years in copyright in all applicable files 2018-02-23 10:12:02 +01:00
Tinderbox User 08f18efba2 update copyright notice / whitespace 2017-10-26 23:45:58 +00:00
Evan Hunt 63270d33f1 [master] some improvements in doc/dev [RT #46011]
- add info about rdatasets, etc, to dev.md (thanks to Tony Finch)
- convert rdata.html to markdown
2017-10-25 23:30:10 -07:00
Evan Hunt 1e14ea024a [master] revise style guide information on bracing 2017-10-05 11:28:00 -07:00
Evan Hunt 8eb88aafee [master] add libns and remove liblwres
4708.   [cleanup]       Legacy Windows builds (i.e. for XP and earlier)
                        are no longer supported. [RT #45186]

4707.	[func]		The lightweight resolver daemon and library (lwresd
			and liblwres) have been removed. [RT #45186]

4706.	[func]		Code implementing name server query processing has
			been moved from bin/named to a new library "libns".
			Functions remaining in bin/named are now prefixed
			with "named_" rather than "ns_".  This will make it
			easier to write unit tests for name server code, or
			link name server functionality into new tools.
			[RT #45186]
2017-09-08 13:47:34 -07:00
Evan Hunt a7dc84cd4b [master] change markdown comment style for pandoc 2017-04-27 23:43:44 -07:00
Evan Hunt 6ce8a05f6c [master] update copyrights that had been missed recently 2017-04-23 17:06:00 -07:00
Evan Hunt 95f7e98da0 [master] update README, remove FAQ
4593.	[doc]		Update README using markdown, remove outdated FAQ
			file in favor of the knowledge base.
2017-04-20 19:21:54 -07:00
Mark Andrews ed1a24cc86 update example copyright notice 2016-07-21 19:09:16 +10:00
Mark Andrews 0c27b3fe77 4401. [misc] Change LICENSE to MPL 2.0. 2016-06-27 14:56:38 +10:00
Tinderbox User 1d94248a12 update copyright notice 2014-04-12 23:46:08 +00:00
Evan Hunt 682d0209e8 [master] customize configure --help 2014-04-11 17:35:54 -07:00
Automatic Updater 6bf23b0270 update copyright notice 2009-08-06 23:47:44 +00:00
Mark Andrews 9be408c368 update how to regenerate the documentation 2009-08-06 01:31:50 +00:00
Mark Andrews 3f5510b6fd update "Update the copyrights" directions 2009-08-06 01:21:58 +00:00
Automatic Updater 70e5a7403f update copyright notice 2007-06-19 23:47:24 +00:00
Mark Andrews 2f8d63983c regen 2007-06-18 23:37:20 +00:00
Automatic Updater e2acdb193a update copyright notice 2007-02-15 23:40:09 +00:00