Commit Graph

30 Commits

Author SHA1 Message Date
Mike Gelfand 82df3a87f4 Update to Uncrustify 0.68.1
Tweak a few rules in the process. Now all code in cli, daemon, gtk,
libtransmission, qt, and utils is properly formatted with no manual
intervention.
2019-02-15 09:21:48 +03:00
Mike Gelfand a53bae2849 Fix file-test on Win32 due to file/dir symlinks difference 2018-09-04 01:06:21 +03:00
Mike Gelfand 6da6629887 Add unit tests uncovering improper UNC paths resolution
While resolved paths always contain the `\\?\` prefix, it's not always
correct to strip only those 4 chars. In case of UNC paths, the prefix
is actually a bit longer (`\\?\UNC\`) and needs to be replaced with `\\`
instead.

Failing to do so results in invalid paths, e.g. `\\Host\Share\File` becomes
`UNC\Host\Share\File` which totally wrong.
2018-01-24 23:12:17 +03:00
Mike Gelfand 30c7c05cbb Refactor completion scripts execution
There're still a few issues here and there, but overall I believe it's now
better than it was before.
2017-11-28 10:03:08 +03:00
Mike Gelfand 55b41c9015 Patch up file test to allow for a bit of time discrepancy
Since one cannot really compare system time to filesystem time (see e.g.
https://lkml.org/lkml/2017/3/30/809), allow for 1 second error to avoid
(or at least minimize) random test failures.
2017-07-21 00:45:30 +03:00
Mike Gelfand 5f7bc801c8 Make use of new checking capabilities in unit tests 2017-05-30 20:56:12 +03:00
Mike Gelfand 437904198e Transform `check_uint_eq` into generic `check_uint` (libtest) 2017-05-30 17:51:50 +03:00
Mike Gelfand 9c3c6f11e0 Transform `check_int_eq` into generic `check_int` (libtest) 2017-05-30 17:51:50 +03:00
Mike Gelfand 14c30119d4 Transform `check_str_eq` into generic `check_str` (libtest) 2017-05-30 17:51:46 +03:00
Mike Gelfand 341b778099 Continue running other test-cases even if one fails (libtest) 2017-05-30 17:44:51 +03:00
Mike Gelfand 7a238e7c65 Rename `check_streq` to `check_str_eq` to be in line with other macros (libtest) 2017-05-30 17:44:42 +03:00
Mike Gelfand 6303bb2247 Disable part of mmap test on OpenBSD that depends on UBC 2017-05-20 13:34:23 +03:00
Mike Gelfand 1e3d20422a Reduce for loop variables scope 2017-05-14 01:38:31 +03:00
Mike Gelfand e1d53855f4 Avoid declaring multiple variables on the same line 2017-05-01 18:46:41 +03:00
Mike Gelfand 4f9d9ad92b Code style change leftovers
For some reason, GTK client wasn't fully processed. All the rest of changes
are mostly in comments.
2017-04-21 10:40:57 +03:00
Mike Gelfand dadffa2c0f Align type qualifiers to the right (code style)
This way all the qualifiers (`const`, `volatile`, `mutable`) are grouped
together, e.g. `T const* const x` vs. `const T* const x`. Also helps reading
types right-to-left, e.g. "constant pointer to constant T" vs. "constant
pointer to T which is constant".
2017-04-20 19:53:20 +03:00
Mike Gelfand d7930984ef Adjust uncrustify config, reformat all but Mac client
There're places where manual intervention is still required as uncrustify
is not ideal (unfortunately), but at least one may rely on it to do the
right thing most of the time (e.g. when sending in a patch).

The style itself is quite different from what we had before but making it
uniform across all the codebase is the key. I also hope that it'll make the
code more readable (YMMV) and less sensitive to further changes.
2017-04-20 10:01:22 +03:00
Mike Gelfand 2248d3670f Get rid of $Id$ SVN keywords in source files 2016-09-02 23:10:15 +03:00
Jordan Lee 5fbd24fda5 fix a handful of minor compiler warnings, mostly in the unit tests, eg field width shortening or implicit signed/unsigned conversions 2016-03-29 03:04:54 +00:00
Mike Gelfand 91f8ceb20d Handle potential dirname/basename errors where needed 2016-03-13 10:41:52 +00:00
Mike Gelfand 9ecd2ad319 Improve file test modification time checks 2016-01-04 05:04:55 +00:00
Mike Gelfand abb572fe26 Better support for UNC paths in tr_sys_path_is_relative
Accept \\ and // and valid UNC path prefixes, but not \/ or /\.
2015-10-23 03:55:04 +00:00
Mike Gelfand 5f420cafda Rework Win32 basename and dirname implementation
Don't use _splitpath_s and _makepath_s as they don't support long paths
and UNC paths properly. Report error if path is not valid.
2015-10-23 03:42:11 +00:00
Mike Gelfand 650db1f46e #5802: Don't make assumptions of remote path validity in transmission-remote
Defer validity checks until path gets to the remote side, where they
actually make sense. Add simple checks for download directory path to
ensure it's not relative, since one cannot know what current working
directory of the remote process is.
2015-10-20 21:22:19 +00:00
Mike Gelfand 9a3b965ce4 Kill some warnings when compiling on Windows 2015-01-02 04:02:13 +00:00
Mike Gelfand 13cad2fb55 #5722: Rename remaining WIN32 uses to _WIN32 2014-11-30 20:08:20 +00:00
Jordan Lee 90bbbaefc3 (trunk, libT) #4160: apply mike.dld's patch: 4160-05a-file-fmt.patch 2014-09-21 17:57:45 +00:00
Jordan Lee 51a90d0da0 (trunk, libt) #4160 - the slow slog to catch trunk up to mike.dld's 4160 diff continues. This step applies 4160-04a-dir.patch, which adds tr_sys_dir_*() portability wrappers. 2014-09-21 17:52:36 +00:00
Jordan Lee c1beabfea6 (trunk, libT) #4160 'foreign character support' -- merge mike.dld's 4160-03a-file.platch, which introduces tr_sys_file_*() portability wrappers 2014-07-08 00:15:12 +00:00
Jordan Lee 60a5c793d9 (trunk, libT) mike.dld's 4160-02a-path.patch: portability wrapper around file paths. 2014-07-03 21:58:39 +00:00