Skip to content

Commit

Permalink
chore: Clean up some warning flags; add wiki.
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Nov 18, 2024
1 parent 00c0dc1 commit 9a9328b
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 70 deletions.
6 changes: 2 additions & 4 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,8 @@ build --per_file_copt='//toxic[:/]@-Wno-documentation'
# Ignore super donators stuff. It's verbatim. We compile it, but don't care about cleanliness.
build --per_file_copt='//c-toxcore/super_donators@-Wno-comma,-Wno-extra-semi-stmt,-Wno-unreachable-code-return,-Wno-unused-result'

# Tests
# Tests (Google Test) use global constructors and destructors and some other
# slightly unclean things.
build --per_file_copt='_bench\\.(cc|cpp)$@-Wno-weak-vtables,-Wno-zero-as-null-pointer-constant'
build --per_file_copt='_(test|bench)\\.(cc|cpp)$@-Wno-global-constructors,-Wno-exit-time-destructors'
build --per_file_copt='_test\\.(cc|cpp)$@-Wno-c99-extensions'
Expand Down Expand Up @@ -409,7 +410,6 @@ build --per_file_copt='\\.pb\\.cc$@-Wno-missing-prototypes'
build --per_file_copt='\\.pb\\.cc$@-Wno-weak-vtables'

# TODO(iphydf): Fix these soon.
build --per_file_copt='//c-toxcore@-Wno-sign-compare'
build --per_file_copt='//qtox@-Wno-error=switch'
build --per_file_copt='//toxins/toxvpn@-Wno-format'
build --per_file_copt='//toxins/toxvpn@-Wno-unaligned-access'
Expand All @@ -418,13 +418,11 @@ build --per_file_copt='//toxins/toxvpn@-Wno-zero-as-null-pointer-constant'
build --per_file_copt='//toxins/toxvpn@-Wno-zero-length-array'

# TODO(iphydf): Fix these.
build --per_file_copt='//c-toxcore@-Wno-unused-but-set-variable'
build --per_file_copt='//experimental@-Wno-switch-enum'
build --per_file_copt='//experimental@-Wno-used-but-marked-unused'
build --per_file_copt='//jvm-toxcore-c@-Wno-error=switch'
build --per_file_copt='//jvm-toxcore-c@-Wno-global-constructors,-Wno-exit-time-destructors'
build --per_file_copt='//qtox@-Wno-comma'
build --per_file_copt='//qtox@-Wno-deprecated'
build --per_file_copt='//qtox@-Wno-documentation'
build --per_file_copt='//qtox@-Wno-documentation-unknown-command'
build --per_file_copt='//qtox@-Wno-double-promotion'
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@
[submodule "website"]
path = website
url = https://github.com/TokTok/website
[submodule "wiki/qtox.wiki"]
path = wiki/qtox.wiki
url = https://github.com/TokTok/qtox.wiki
[submodule "zig-toxcore-c"]
path = zig-toxcore-c
url = https://github.com/TokTok/zig-toxcore-c
2 changes: 1 addition & 1 deletion hs-github-tools
2 changes: 1 addition & 1 deletion qtox
Submodule qtox updated 91 files
+63 −1 .github/workflows/build-test-deploy.yaml
+2 −1 CMakeLists.txt
+24 −0 android/cross-compile/build.sh
+ android/keystore.jks
+4 −1 buildscripts/docker/Dockerfile.alpine
+241 −0 buildscripts/docker/Dockerfile.android_builder
+1 −0 buildscripts/docker/Dockerfile.archlinux
+1 −0 buildscripts/docker/Dockerfile.fedora
+14 −4 cmake/Dependencies.cmake
+2 −2 cmake/Installation.cmake
+6 −0 docker-compose.yml
+1 −1 osx/macfixrpath
+20 −20 simple_make.sh
+1 −0 src/chatlog/chatwidget.cpp
+2 −2 src/core/corefile.h
+41 −0 src/ipc.cpp
+2 −0 src/ipc.h
+1 −0 src/model/chatroom/friendchatroom.cpp
+0 −1 src/model/friend.h
+0 −1 src/model/ichatlog.h
+1 −0 src/model/imessagedispatcher.h
+2 −1 src/persistence/history.cpp
+1 −2 src/persistence/offlinemsgengine.h
+5 −6 src/persistence/profile.h
+2 −2 src/video/cameradevice.cpp
+0 −1 src/widget/categorywidget.h
+10 −10 src/widget/form/chatform.h
+1 −0 src/widget/form/filesform.cpp
+4 −4 src/widget/form/filesform.h
+1 −1 src/widget/form/genericchatform.cpp
+79 −13 src/widget/form/settings/generalform.cpp
+2 −3 src/widget/form/settings/generalform.h
+1 −1 src/widget/form/settingswidget.cpp
+0 −1 src/widget/friendlistlayout.h
+1 −0 src/widget/friendlistwidget.cpp
+13 −13 src/widget/friendlistwidget.h
+2 −0 src/widget/widget.cpp
+0 −1 src/widget/widget.h
+2 −0 test/model/friendmessagedispatcher_test.cpp
+1 −0 test/model/groupmessagedispatcher_test.cpp
+2 −0 test/widget/filesform_test.cpp
+4 −0 translations/ar.ts
+4 −0 translations/be.ts
+4 −0 translations/bg.ts
+4 −0 translations/bn.ts
+4 −0 translations/cs.ts
+4 −0 translations/da.ts
+4 −0 translations/de.ts
+4 −0 translations/el.ts
+4 −0 translations/eo.ts
+4 −0 translations/es.ts
+4 −0 translations/et.ts
+4 −0 translations/fa.ts
+4 −0 translations/fi.ts
+4 −0 translations/fr.ts
+4 −0 translations/gl.ts
+4 −0 translations/he.ts
+4 −0 translations/hr.ts
+4 −0 translations/hu.ts
+4 −0 translations/is.ts
+4 −0 translations/it.ts
+4 −0 translations/ja.ts
+4 −0 translations/kn.ts
+4 −0 translations/ko.ts
+4 −0 translations/lt.ts
+4 −0 translations/lv.ts
+4 −0 translations/mk.ts
+4 −0 translations/nl.ts
+4 −0 translations/nl_BE.ts
+4 −0 translations/no_nb.ts
+4 −0 translations/pl.ts
+4 −0 translations/pt.ts
+4 −0 translations/pt_BR.ts
+4 −0 translations/ro.ts
+4 −0 translations/ru.ts
+4 −0 translations/si.ts
+4 −0 translations/sk.ts
+4 −0 translations/sl.ts
+4 −0 translations/sq.ts
+4 −0 translations/sr.ts
+4 −0 translations/sr_Latn.ts
+4 −0 translations/sv.ts
+4 −0 translations/sw.ts
+4 −0 translations/ta.ts
+4 −0 translations/tr.ts
+4 −0 translations/ug.ts
+4 −0 translations/uk.ts
+4 −0 translations/ur.ts
+4 −0 translations/vi.ts
+4 −0 translations/zh_CN.ts
+4 −0 translations/zh_TW.ts
21 changes: 11 additions & 10 deletions third_party/BUILD.ffmpeg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ load("@toktok//third_party/yasm:build_defs.bzl", "asm_library")
COPTS = [
"-DPIC",
"-DZLIB_CONST",
"-DHAVE_AV_CONFIG_H",
"-Iexternal/ffmpeg/libavcodec",
"-I$(GENDIR)/third_party/ffmpeg/platform",
] + select({
Expand Down Expand Up @@ -369,7 +368,7 @@ cc_library(
"libavdevice/timefilter.c",
"libavformat/tls.c",
],
copts = COPTS,
copts = COPTS + ["-DHAVE_AV_CONFIG_H"],
deps = [
":headers",
"@toktok//third_party/ffmpeg:config",
Expand All @@ -378,7 +377,7 @@ cc_library(

objc_library(
name = "ffmpeg_osx_objc",
copts = COPTS,
copts = COPTS + ["-DHAVE_AV_CONFIG_H"],
non_arc_srcs = [
"libavdevice/avfoundation.m",
"libavfilter/vf_coreimage.m",
Expand Down Expand Up @@ -413,7 +412,7 @@ cc_library(
"libavutil/hwcontext_videotoolbox.c",
"libavutil/pixdesc.c",
],
copts = COPTS,
copts = COPTS + ["-DHAVE_AV_CONFIG_H"],
linkopts = [
"-lpthread",
"-liconv",
Expand Down Expand Up @@ -446,7 +445,7 @@ cc_library(
"libavutil/hwcontext_d3d11va.c",
"libavutil/hwcontext_dxva2.c",
],
copts = COPTS,
copts = COPTS + ["-DHAVE_AV_CONFIG_H"],
linkopts = [
"/DEFAULTLIB:Bcrypt.lib",
"/DEFAULTLIB:D3D11.lib",
Expand Down Expand Up @@ -481,7 +480,7 @@ cc_library(
"libavdevice/xcbgrab.c",
"libavformat/unix.c",
],
copts = COPTS,
copts = COPTS + ["-DHAVE_AV_CONFIG_H"],
linkopts = [
"-lpthread",
"-lm",
Expand Down Expand Up @@ -516,7 +515,7 @@ cc_library(
"libavdevice/v4l2-common.c",
"libavdevice/v4l2enc.c",
],
copts = COPTS,
copts = COPTS + ["-DHAVE_AV_CONFIG_H"],
linkopts = [
"-lpthread",
"-ldl",
Expand Down Expand Up @@ -2652,7 +2651,7 @@ cc_library(
"libavutil/imgutils.h",
"libswscale/swscale.h",
],
copts = COPTS,
copts = COPTS + ["-DHAVE_AV_CONFIG_H"],
includes = ["."],
visibility = ["//visibility:public"],
deps = [
Expand All @@ -2672,14 +2671,16 @@ cc_library(
name = "fftools",
srcs = [
"fftools/cmdutils.c",
"fftools/ffmpeg.c",
"fftools/ffmpeg_dec.c",
"fftools/ffmpeg_demux.c",
"fftools/ffmpeg_enc.c",
"fftools/ffmpeg_filter.c",
"fftools/ffmpeg_hw.c",
"fftools/ffmpeg_mux.c",
"fftools/ffmpeg_mux_init.c",
"fftools/ffmpeg_opt.c",
"fftools/ffprobe.c",
"fftools/ffmpeg_sched.c",
"fftools/ffplay_renderer.c",
"fftools/objpool.c",
"fftools/opt_common.c",
"fftools/sync_queue.c",
Expand Down
4 changes: 4 additions & 0 deletions tools/git-remotes
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ our %REPOS = (
repo 'iphydf',
repo 'qtox',
}],
'wiki/qtox.wiki' => ['qtox.wiki', {
upstream => 'toktok',
repo 'qtox',
}],
'spec' => ['spec', {
upstream => 'toktok',
repo 'iphydf',
Expand Down
118 changes: 64 additions & 54 deletions tools/git_modules_test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3,78 +3,88 @@
use strict;
use warnings FATAL => 'all';

my ($GITMODULES, $GITREMOTES, @PROJECTS) = @ARGV;
my ( $GITMODULES, $GITREMOTES, @PROJECTS ) = @ARGV;

sub parse_gitmodules {
my ($file) = @_;

my %mods;
my $cur;

open my $fh, '<', $file or die "$file: $!";
while (<$fh>) {
if (m|^\[submodule "(.*)"\]$|) {
$cur = $mods{$1} = {};
} elsif (m|^\tpath = (.*)|) {
$cur->{path} = $1;
} elsif (m|^\turl = https://github.com/TokTok/(.*)|) {
$cur->{repo} = $1;
}
}

my %repos = map { $mods{$_}{path} => $mods{$_}{repo} } keys %mods;
\%repos;
my ($file) = @_;

my %mods;
my $cur;

open my $fh, '<', $file or die "$file: $!";
while (<$fh>) {
if (m|^\[submodule "(.*)"\]$|) {
$cur = $mods{$1} = {};
}
elsif (m|^\tpath = (.*)|) {
$cur->{path} = $1;
}
elsif (m|^\turl = https://github.com/TokTok/(.*)|) {
$cur->{repo} = $1;
}
}

my %repos = map { $mods{$_}{path} => $mods{$_}{repo} } keys %mods;
\%repos;
}

sub parse_gitremotes {
package GitRemotes;
use File::Basename;

do "./$GITREMOTES";

my %repos;

sub is_subsubmodule {
my ($dir) = @_;
while ($dir ne '.' and $dir ne '/') {
$dir = dirname $dir;
return 1 if $GitRemotes::REPOS{$dir};
}
0
}

for my $path (keys %GitRemotes::REPOS) {
# Filter out submodules of submodules. They do appear in git-remotes, but
# not in .gitmodules, because they appear in the submodule's .gitmodules,
# which we're not testing.
next if is_subsubmodule $path;
$repos{$path} = $GitRemotes::REPOS{$path}[0];
}

\%repos

package GitRemotes;
use File::Basename;

do "./$GITREMOTES";

my %repos;

sub is_subsubmodule {
my ($dir) = @_;
while ( $dir ne '.' and $dir ne '/' ) {
$dir = dirname $dir;
return 1 if $GitRemotes::REPOS{$dir};
}
0;
}

for my $path ( keys %GitRemotes::REPOS ) {

# Filter out submodules of submodules. They do appear in git-remotes, but
# not in .gitmodules, because they appear in the submodule's .gitmodules,
# which we're not testing.
next if is_subsubmodule $path;
$repos{$path} = $GitRemotes::REPOS{$path}[0];
}

\%repos;
}

my $modules = parse_gitmodules $GITMODULES;
my $remotes = parse_gitremotes $GITREMOTES;
my $modules = parse_gitmodules $GITMODULES;
my $remotes = parse_gitremotes $GITREMOTES;
my %projects = map { $_ => undef } @PROJECTS;

# Check that .gitmodules doesn't have more modules than git-remotes.
for my $repo (sort keys %$modules) {
die ".gitmodules contains submodule '$repo' not listed in %REPOS in $GITREMOTES\n"
for my $repo ( sort keys %$modules ) {
die
".gitmodules contains submodule '$repo' not listed in %REPOS in $GITREMOTES\n"
unless exists $remotes->{$repo};
}

# And vice-versa.
for my $repo (sort keys %$remotes) {
die "$GITREMOTES contains repository '$repo' not listed in .gitmodules\n"
for my $repo ( sort keys %$remotes ) {
die "$GITREMOTES contains repository '$repo' not listed in .gitmodules\n"
unless exists $modules->{$repo};
}

# Check that tools/BUILD.bazel knows about all our projects.
for my $repo (sort keys %$modules) {
die ".gitmodules contains submodule '$repo' not listed in projects in tools/BUILD.bazel\n"
for my $repo ( grep { !m|^wiki/.*\.wiki$| } sort keys %$modules ) {
die
".gitmodules contains submodule '$repo' not listed in projects in tools/BUILD.bazel\n"
unless exists $projects{$repo};
}

# And it doesn't have too many.
for my $repo (sort @PROJECTS) {
die "tools/BUILD.bazel lists project '$repo' that isn't listed in .gitmodules"
for my $repo ( sort @PROJECTS ) {
die
"tools/BUILD.bazel lists project '$repo' that isn't listed in .gitmodules"
unless exists $modules->{$repo};
}
1 change: 1 addition & 0 deletions wiki/qtox.wiki
Submodule qtox.wiki added at 5b1368

0 comments on commit 9a9328b

Please sign in to comment.