borgbackup/borg
Thomas Waldmann 5d1ef09a5e add parens for C preprocessor macro argument usages
this is needed for correctness because the preprocessor is just
doing text replacement.

This is the correct way:

#define MUL(x, y) ((x) * (y))

MUL(1+2, 3-4) -> ((1+2) * (3-4))    # not: (1+2 * 3-4)

I didn't put parens around all arg usages for readability.

Some stuff (like index) is not expected to be an expression.

Also, when a arg is only used in another macro or function call,
no parens are needed either.

I reviewed the code: no harm was done (yet) due to this fault.

Thanks to @rciorba who found this.

(cherry picked from commit a3cecf599f)
(cherry picked from commit 981a936f47)
2017-12-23 18:56:46 +01:00
..
testsuite get rid of datetime.isoformat to avoid bugs like #2994 2017-09-10 05:58:03 +02:00
__init__.py implement borgmajor/minor/patch placeholders, fixes #1694 2016-10-22 00:20:50 +02:00
__main__.py cosmetic source cleanup (flake8) 2016-01-30 21:32:45 +01:00
_chunker.c add parens for C preprocessor macro argument usages 2017-12-23 18:56:46 +01:00
_hashindex.c add parens for C preprocessor macro argument usages 2017-12-23 18:56:46 +01:00
archive.py set bsdflags last (include immutable flag), fixes #3263 2017-12-09 03:06:00 +01:00
archiver.py Clarify encrypted key format for borg key export (fixes #3296) 2017-12-09 01:51:29 +01:00
cache.py ignore corrupt files cache, fixes #2939 2017-08-19 01:03:38 +02:00
chunker.pyx chunker: fix invalid use of types 2017-06-21 15:31:33 +02:00
compress.pyx Fix compression exceptions (#2224) 2017-03-10 19:06:54 +01:00
crypto.pyx API_VERSION: use numberspaces, fixes #2023 2017-01-13 21:24:17 +01:00
fuse.py migrate locks to child PID when daemonize is used 2017-08-14 00:25:51 +02:00
hashindex.pyx fix ChunkIndex.__contains__ assertion for big-endian archs 2017-03-10 18:56:18 +01:00
helpers.py fix LDLP restoration for subprocesses, fixes #3077 2017-10-01 22:25:29 +02:00
key.py use prepared env for calling BORG_PASSCOMMAND, fixes #3050 2017-09-30 01:47:05 +02:00
keymanager.py keymanager: don't depend on optional readline module 2017-08-30 11:29:32 +02:00
locking.py migrate locks to child PID when daemonize is used 2017-08-14 00:25:51 +02:00
logger.py sane remote logging, remote stderr, fixes #461 2015-12-12 22:15:08 +01:00
lrucache.py Merge branch 'master' into lrucache 2015-08-14 10:59:21 +01:00
paperkey.html key export: center QR code on the page 2017-02-12 22:26:10 +01:00
platform.py use prepared env for borg umount 2017-09-30 01:54:12 +02:00
platform_darwin.pyx API_VERSION: use numberspaces, fixes #2023 2017-01-13 21:24:17 +01:00
platform_freebsd.pyx API_VERSION: use numberspaces, fixes #2023 2017-01-13 21:24:17 +01:00
platform_linux.pyx use prepared env for borg umount 2017-09-30 01:54:12 +02:00
remote.py Merge pull request #3073 from ThomasWaldmann/fix-partial-lines-1.0 2017-09-30 03:33:53 +02:00
repository.py get rid of datetime.isoformat to avoid bugs like #2994 2017-09-10 05:58:03 +02:00
shellpattern.py fix most python-source related sphinx warnings 2016-07-10 17:26:04 +02:00
upgrader.py always setup module level "logger" in the same way 2017-01-06 05:48:50 +01:00
xattr.py use prepared env for xattr module's fakeroot version check 2017-09-30 02:00:24 +02:00