1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 08:13:27 +00:00
No description
Find a file
Charles Kerr abac811dd2
fix: gcc warnings in libtransmission/ and utils/ (#843)
* fix: __attribute__(__printf__) warnings

* fix: implicit fallthrough warning

* fixup! fix: implicit fallthrough warning

* fix: disable warnings for 3rd party code

Since we want to leave upstream code as-is

* fixup! fix: disable warnings for 3rd party code

* fixup! fix: disable warnings for 3rd party code

* silence spurious alignment warning

Xrefs
Discussion: https://stackoverflow.com/a/35554349
Macro inspiration: 90ac46f710/f/src/util/util_safealign.h (_35)

* fixup! fix: disable warnings for 3rd party code

* fixup! fix: implicit fallthrough warning

* make uncrustify happy

* remove uncrustify-test.sh

that's probably off-topic for this PR

* fixup! fix: __attribute__(__printf__) warnings

* Update libtransmission/CMakeLists.txt

Co-Authored-By: ckerr <ckerr@github.com>

* fixup! silence spurious alignment warning

* use -w for DISABLE_WARNINGS in Clang

* refactor: fix libtransmission deprecation warnings

* fix: pthread_create's start_routine's return value

This was defined as `void` on non-Windows but should have been `void*`

* chore: uncrustify

* fix: add DISABLE_WARNINGS option for SunPro Studio

* fix "unused in lambda capture" warnings by clang++

* fix 'increases required alignment' warning

Caused from storing int16_t's in a char array.

* fix net.c 'increases required alignment' warning

The code passes in a `struct sockaddr_storage*` which is a padded struct
large enough for the necessary alignment. Unfortunately it was recast as
a `struct sockaddr*` which has less padding and a smaller alignment. The
warning occrred because of these differing alignments.

* make building quieter so warnings are more visible

* fixup! fix 'increases required alignment' warning

* Fix -Wcast-function-type warnings in GTK+ app code

https://gitlab.gnome.org/GNOME/gnome-terminal/issues/96 talks about both
the issue and its solution.

GCC 8's -Wcast-function-type, enabled by -Wextra, is problematic in glib
applications because it's idiomatic there to recast function signatures,
e.g. `g_slist_free(list, (GFunc)g_free, NULL);`.

Disabling the warning with pragmas causes "unrecognized pragma" warnings
on clang and older versions of gcc, and disabling the warning could miss
actual bugs. GCC defines `void (*)(void)` as a special case that matches
anything so we can silence warnings by double-casting through GCallback.

In the previous example, the warning is silenced by changing the code to
read `g_slist_free(list, (GFunc)(GCallback)g_free, NULL);`).

* fixup! fix "unused in lambda capture" warnings by clang++

* fixup! fix "unused in lambda capture" warnings by clang++

* fix two more libtransmission compiler warnings

* fix: in watchdir, use TR_ENABLE_ASSERTS not NDEBUG
2019-11-06 11:27:03 -06:00
.tx Add Mac client translations to and downsync from Transifex 2017-01-28 13:44:15 +03:00
cli Use explicit boolean conversions 2019-07-14 16:25:07 +03:00
cmake fix: gcc warnings in libtransmission/ and utils/ (#843) 2019-11-06 11:27:03 -06:00
daemon Use explicit boolean conversions 2019-07-14 16:25:07 +03:00
dist/msi Only add revision to filename for nightly builds (MSI package) 2019-06-20 04:55:30 +03:00
docker/code_style Add code style script and Dockerfile 2019-02-28 03:19:24 +03:00
extras typo 2019-03-16 22:36:18 +08:00
gtk fix: gcc warnings in libtransmission/ and utils/ (#843) 2019-11-06 11:27:03 -06:00
libtransmission fix: gcc warnings in libtransmission/ and utils/ (#843) 2019-11-06 11:27:03 -06:00
m4 Work around "error: m4_copy: won't overwrite defined macro: glib_DEFUN" on 2018-01-17 01:00:49 +03:00
macosx Sync existing translations with Transifex 2019-03-06 03:12:51 +03:00
po Actually add new languages to the build 2019-03-13 23:35:16 +03:00
qt fix: gcc warnings in libtransmission/ and utils/ (#843) 2019-11-06 11:27:03 -06:00
third-party Update curl and openssl to those in 10.10 SDK (macOS) 2019-06-22 16:43:59 +03:00
Transmission.xcodeproj Load CA certs from system store on Windows / OpenSSL 2019-06-23 11:59:53 +03:00
utils fix: gcc warnings in libtransmission/ and utils/ (#843) 2019-11-06 11:27:03 -06:00
web Fixup some formatting leftovers (JS) 2019-02-17 17:51:13 +03:00
.gitignore #5934: Generate REVISION file and use it in case of missing reliable source 2015-04-24 19:14:56 +00:00
.gitmodules Update DHT library to 0.25 2018-02-10 11:35:14 +03:00
.jsbeautifyrc Fixup some formatting leftovers (JS) 2019-02-17 17:51:13 +03:00
AUTHORS Switch to HTTPS links, adjust wiki links where possible 2018-01-16 01:12:59 +03:00
autogen.sh Refactor shell scripts with syntax and styling fixes 2019-01-16 03:22:29 +08:00
ChangeLog
CMakeLists.txt Bump version to 3.00 (nightly) 2019-07-21 15:11:49 +03:00
code_style.sh Add code style script and Dockerfile 2019-02-28 03:19:24 +03:00
configure.ac Bump version to 3.00 (nightly) 2019-07-21 15:11:49 +03:00
COPYING Updated copyright strings to 2019 2019-01-11 19:36:19 +01:00
docker-compose.yml Add code style script and Dockerfile 2019-02-28 03:19:24 +03:00
Makefile.am Adjust autotools files to use submodules 2017-01-02 02:26:02 +03:00
NEWS add Sparkle update to NEWS 2018-12-24 19:00:29 -05:00
README.md Add code style script and Dockerfile 2019-02-28 03:19:24 +03:00
transmission-gtk.spec.in Switch to HTTPS links, adjust wiki links where possible 2018-01-16 01:12:59 +03:00
uncrustify.cfg Update Uncrustify config to 0.69 2019-07-15 02:30:41 +03:00
update-version-h.sh Refactor shell scripts with syntax and styling fixes 2019-01-16 03:22:29 +08:00

About

Transmission is a fast, easy, and free BitTorrent client. It comes in several flavors:

  • A native Mac OS X GUI application
  • GTK+ and Qt GUI applications for Linux, BSD, etc.
  • A headless daemon for servers and routers
  • A web UI for remote controlling any of the above

Visit https://transmissionbt.com/ for more information.

Command line interface notes

Transmission is fully supported in transmission-remote, the preferred cli client.

Three standalone tools to examine, create, and edit .torrent files exist: transmission-show, transmission-create, and transmission-edit, respectively.

Prior to development of transmission-remote, the standalone client transmission-cli was created. Limited to a single torrent at a time, transmission-cli is deprecated and exists primarily to support older hardware dependent upon it. In almost all instances, transmission-remote should be used instead.

Different distributions may choose to package any or all of these tools in one or more separate packages.

Building

Transmission has an Xcode project file (Transmission.xcodeproj) for building in Xcode.

For a more detailed description, and dependencies, visit: https://github.com/transmission/transmission/wiki

Building a Transmission release from the command line

$ tar xf transmission-2.92.tar.xz
$ cd transmission-2.92
$ mkdir build
$ cd build
$ cmake ..
$ make
$ sudo make install

Building Transmission from the nightly builds

Download a tarball from https://build.transmissionbt.com/job/trunk-linux/ and follow the steps from the previous section.

If you're new to building programs from source code, this is typically easier than building from Git.

Building Transmission from Git (first time)

$ git clone https://github.com/transmission/transmission Transmission
$ cd Transmission
$ git submodule update --init
$ mkdir build
$ cd build
$ cmake ..
$ make
$ sudo make install

Building Transmission from Git (updating)

$ cd Transmission/build
$ make clean
$ git pull --rebase --prune
$ git submodule update
$ cmake ..
$ make
$ sudo make install

Contributing

Code Style

You would want to setup your editor to make use of uncrustify.cfg and .jsbeautifyrc configuration files located in the root of this repository.

If for some reason you are unwilling or unable to do so, there is a shell script which you could run either directly or via docker-compose:

$ ./code_style.sh
or
$ docker-compose build --pull
$ docker-compose run --rm code_style