Skip to content

Commit

Permalink
chore: Make run-infer script use docker.
Browse files Browse the repository at this point in the history
So people can run it locally more easily.
  • Loading branch information
iphydf committed Feb 3, 2022
1 parent 1d3778f commit 014cc42
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
29 changes: 22 additions & 7 deletions other/analysis/run-infer
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
#!/bin/bash
#!/bin/sh

# Infer ignores everything that's not in the "current file".
SKIP_LINES=1
# --bufferoverrun \
# --pulse \

set -e
read -r -d '' SCRIPT <<'EOF'
infer \
--report-console-limit 100 \
--jobs 8 \
--biabduction \
--loop-hoisting \
--quandary \
--racerd \
--starvation \
--uninit \
-- clang++ -fsyntax-only \
$(pkg-config --cflags libconfig libsodium opus vpx) \
/work/other/bootstrap_daemon/src/*.c \
/work/other/bootstrap_node_packets.c \
/work/toxav/*.c \
/work/toxcore/*.c \
/work/toxencryptsave/*.c
EOF

. other/analysis/gen-file.sh

infer --no-progress-bar -- clang++ -fsyntax-only amalgamation.cc "${CPPFLAGS[@]}"
docker run --rm -it -v "$PWD:/work" toxchat/infer bash -c "$SCRIPT"
5 changes: 2 additions & 3 deletions toxcore/group.c
Original file line number Diff line number Diff line change
Expand Up @@ -2375,12 +2375,11 @@ static unsigned int send_message_all_connections(const Group_Chats *g_c, const G
* return number of messages sent.
*/
static unsigned int send_lossy_all_connections(const Group_Chats *g_c, const Group_c *g, const uint8_t *data,
uint16_t length,
int receiver)
uint16_t length, int receiver)
{
unsigned int sent = 0;
unsigned int num_connected_closest = 0;
unsigned int connected_closest[DESIRED_CLOSEST];
unsigned int connected_closest[DESIRED_CLOSEST] = {0};

for (unsigned int i = 0; i < MAX_GROUP_CONNECTIONS; ++i) {
if (g->connections[i].type != GROUPCHAT_CONNECTION_ONLINE) {
Expand Down

0 comments on commit 014cc42

Please sign in to comment.