Skip to content

Commit

Permalink
Switch to fully-qualified #include
Browse files Browse the repository at this point in the history
Previously, mosh used extensive -I flags and all of the mosh-local
makes it really hard to tell what the proper dependency graph is, so
instead remove the -I arguments in favvor of $(top_srcdir) and qualify
the paths wherever they are used.
  • Loading branch information
achernya committed Jul 30, 2023
1 parent c4aed05 commit 39f6781
Show file tree
Hide file tree
Showing 75 changed files with 177 additions and 177 deletions.
2 changes: 1 addition & 1 deletion src/crypto/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AM_CPPFLAGS = -I$(srcdir)/../util $(CRYPTO_CFLAGS)
AM_CPPFLAGS = -I$(top_srcdir)/ $(CRYPTO_CFLAGS)
AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MISC_CXXFLAGS) $(CODE_COVERAGE_CXXFLAGS)

noinst_LIBRARIES = libmoshcrypto.a
Expand Down
4 changes: 2 additions & 2 deletions src/crypto/base64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#include <string.h>
#include <stdlib.h>

#include "fatal_assert.h"
#include "base64.h"
#include "src/util/fatal_assert.h"
#include "src/crypto/base64.h"

static const char table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

Expand Down
2 changes: 1 addition & 1 deletion src/crypto/byteorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#ifndef BYTEORDER_HPP
#define BYTEORDER_HPP

#include "config.h"
#include "src/include/config.h"

#if HAVE_DECL_BE64TOH || HAVE_DECL_BETOH64

Expand Down
10 changes: 5 additions & 5 deletions src/crypto/crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
#include <sys/resource.h>
#include <fstream>

#include "byteorder.h"
#include "crypto.h"
#include "base64.h"
#include "fatal_assert.h"
#include "prng.h"
#include "src/crypto/byteorder.h"
#include "src/crypto/crypto.h"
#include "src/crypto/base64.h"
#include "src/util/fatal_assert.h"
#include "src/crypto/prng.h"

using namespace Crypto;

Expand Down
2 changes: 1 addition & 1 deletion src/crypto/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#ifndef CRYPTO_HPP
#define CRYPTO_HPP

#include "ae.h"
#include "src/crypto/ae.h"
#include <string>
#include <string.h>
#include <stdint.h>
Expand Down
8 changes: 4 additions & 4 deletions src/crypto/ocb_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/ Comments are welcome: Ted Krovetz <ted@krovetz.net> - Dedicated to Laurel K
/------------------------------------------------------------------------- */

#include "config.h"
#include "src/include/config.h"

/* This module implements the ae.h interface for OpenSSL, Apple Common
/ Crypto, and Nettle. */
Expand Down Expand Up @@ -84,9 +84,9 @@
/* Includes and compiler specific definitions */
/* ----------------------------------------------------------------------- */

#include "ae.h"
#include "crypto.h"
#include "fatal_assert.h"
#include "src/crypto/ae.h"
#include "src/crypto/crypto.h"
#include "src/util/fatal_assert.h"
#include <stdlib.h>
#include <string.h>
#if defined(HAVE_STRINGS_H)
Expand Down
4 changes: 2 additions & 2 deletions src/crypto/ocb_openssl.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "config.h"
#include "ae.h"
#include "src/include/config.h"
#include "src/crypto/ae.h"

#include <cstring>
#include <openssl/crypto.h>
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/prng.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include <stdint.h>
#include <fstream>

#include "crypto.h"
#include "src/crypto/crypto.h"

/* Read random bytes from /dev/urandom.
Expand Down
2 changes: 1 addition & 1 deletion src/examples/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MISC_CXXFLAGS)
AM_CXXFLAGS = -I$(top_srcdir)/ $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MISC_CXXFLAGS)
AM_LDFLAGS = $(HARDEN_LDFLAGS)

if BUILD_EXAMPLES
Expand Down
14 changes: 7 additions & 7 deletions src/examples/benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
also delete it here.
*/

#include "config.h"
#include "src/include/config.h"

#include <errno.h>
#include <locale.h>
Expand All @@ -52,12 +52,12 @@
#include <util.h>
#endif

#include "swrite.h"
#include "completeterminal.h"
#include "user.h"
#include "terminaloverlay.h"
#include "locale_utils.h"
#include "fatal_assert.h"
#include "src/util/swrite.h"
#include "src/statesync/completeterminal.h"
#include "src/statesync/user.h"
#include "src/frontend/terminaloverlay.h"
#include "src/util/locale_utils.h"
#include "src/util/fatal_assert.h"

const int ITERATIONS = 100000;

Expand Down
2 changes: 1 addition & 1 deletion src/examples/decrypt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <iostream>
#include <sstream>

#include "crypto.h"
#include "src/crypto/crypto.h"

using namespace Crypto;

Expand Down
2 changes: 1 addition & 1 deletion src/examples/encrypt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <iostream>
#include <sstream>

#include "crypto.h"
#include "src/crypto/crypto.h"

using namespace Crypto;

Expand Down
12 changes: 6 additions & 6 deletions src/examples/ntester.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
#include <termios.h>
#include <unistd.h>

#include "user.h"
#include "fatal_assert.h"
#include "pty_compat.h"
#include "networktransport-impl.h"
#include "select.h"
#include "shared.h"
#include "src/statesync/user.h"
#include "src/util/fatal_assert.h"
#include "src/util/pty_compat.h"
#include "src/network/networktransport-impl.h"
#include "src/util/select.h"
#include "src/util/shared.h"

using namespace Network;

Expand Down
14 changes: 7 additions & 7 deletions src/examples/parse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
also delete it here.
*/

#include "config.h"
#include "src/include/config.h"

#include <unistd.h>
#include <stdio.h>
Expand All @@ -53,12 +53,12 @@
#include <libutil.h>
#endif

#include "parser.h"
#include "swrite.h"
#include "locale_utils.h"
#include "fatal_assert.h"
#include "pty_compat.h"
#include "select.h"
#include "src/terminal/parser.h"
#include "src/util/swrite.h"
#include "src/util/locale_utils.h"
#include "src/util/fatal_assert.h"
#include "src/util/pty_compat.h"
#include "src/util/select.h"

const size_t buf_size = 1024;

Expand Down
16 changes: 8 additions & 8 deletions src/examples/termemu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
also delete it here.
*/

#include "config.h"
#include "src/include/config.h"

#include <unistd.h>
#include <stdio.h>
Expand Down Expand Up @@ -60,13 +60,13 @@
#include <libutil.h>
#endif

#include "parser.h"
#include "completeterminal.h"
#include "swrite.h"
#include "fatal_assert.h"
#include "pty_compat.h"
#include "locale_utils.h"
#include "select.h"
#include "src/terminal/parser.h"
#include "src/statesync/completeterminal.h"
#include "src/util/swrite.h"
#include "src/util/fatal_assert.h"
#include "src/util/pty_compat.h"
#include "src/util/locale_utils.h"
#include "src/util/select.h"

const size_t buf_size = 16384;

Expand Down
2 changes: 1 addition & 1 deletion src/frontend/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AM_CPPFLAGS = -I$(srcdir)/../statesync -I$(srcdir)/../terminal -I$(srcdir)/../network -I$(srcdir)/../crypto -I../protobufs -I$(srcdir)/../util $(TINFO_CFLAGS) $(protobuf_CFLAGS) $(CRYPTO_CFLAGS)
AM_CPPFLAGS = -I$(top_srcdir)/ $(TINFO_CFLAGS) $(protobuf_CFLAGS) $(CRYPTO_CFLAGS)
AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) $(HARDEN_CFLAGS) $(MISC_CXXFLAGS) $(CODE_COVERAGE_CXXFLAGS)
AM_LDFLAGS = $(HARDEN_LDFLAGS) $(CODE_COVERAGE_LIBS)
LDADD = ../crypto/libmoshcrypto.a ../network/libmoshnetwork.a ../statesync/libmoshstatesync.a ../terminal/libmoshterminal.a ../util/libmoshutil.a ../protobufs/libmoshprotos.a -lm $(TINFO_LIBS) $(protobuf_LIBS) $(CRYPTO_LIBS)
Expand Down
10 changes: 5 additions & 5 deletions src/frontend/mosh-client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@
also delete it here.
*/

#include "config.h"
#include "version.h"
#include "src/include/config.h"
#include "src/include/version.h"

#include <stdlib.h>
#include <unistd.h>

#include "stmclient.h"
#include "crypto.h"
#include "locale_utils.h"
#include "fatal_assert.h"
#include "src/crypto/crypto.h"
#include "src/util/locale_utils.h"
#include "src/util/fatal_assert.h"

/* These need to be included last because of conflicting defines. */
/*
Expand Down
24 changes: 12 additions & 12 deletions src/frontend/mosh-server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
also delete it here.
*/

#include "config.h"
#include "version.h"
#include "src/include/config.h"
#include "src/include/version.h"

#include <err.h>
#include <errno.h>
Expand Down Expand Up @@ -79,21 +79,21 @@
#include <libutil.h>
#endif

#include "completeterminal.h"
#include "swrite.h"
#include "user.h"
#include "fatal_assert.h"
#include "locale_utils.h"
#include "pty_compat.h"
#include "select.h"
#include "timestamp.h"
#include "fatal_assert.h"
#include "src/statesync/completeterminal.h"
#include "src/util/swrite.h"
#include "src/statesync/user.h"
#include "src/util/fatal_assert.h"
#include "src/util/locale_utils.h"
#include "src/util/pty_compat.h"
#include "src/util/select.h"
#include "src/util/timestamp.h"
#include "src/util/fatal_assert.h"

#ifndef _PATH_BSHELL
#define _PATH_BSHELL "/bin/sh"
#endif

#include "networktransport-impl.h"
#include "src/network/networktransport-impl.h"

typedef Network::Transport< Terminal::Complete, Network::UserStream > ServerConnection;

Expand Down
22 changes: 11 additions & 11 deletions src/frontend/stmclient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
also delete it here.
*/

#include "config.h"
#include "src/include/config.h"

#include <err.h>
#include <errno.h>
Expand All @@ -52,16 +52,16 @@
#endif

#include "stmclient.h"
#include "swrite.h"
#include "completeterminal.h"
#include "user.h"
#include "fatal_assert.h"
#include "locale_utils.h"
#include "pty_compat.h"
#include "select.h"
#include "timestamp.h"

#include "networktransport-impl.h"
#include "src/util/swrite.h"
#include "src/statesync/completeterminal.h"
#include "src/statesync/user.h"
#include "src/util/fatal_assert.h"
#include "src/util/locale_utils.h"
#include "src/util/pty_compat.h"
#include "src/util/select.h"
#include "src/util/timestamp.h"

#include "src/network/networktransport-impl.h"

using std::wstring;

Expand Down
10 changes: 5 additions & 5 deletions src/frontend/stmclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
#include <termios.h>
#include <string>

#include "completeterminal.h"
#include "networktransport.h"
#include "user.h"
#include "shared.h"
#include "terminaloverlay.h"
#include "src/statesync/completeterminal.h"
#include "src/network/networktransport.h"
#include "src/statesync/user.h"
#include "src/util/shared.h"
#include "src/frontend/terminaloverlay.h"

class STMClient {
private:
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/terminaloverlay.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <typeinfo>
#include <limits.h>

#include "terminaloverlay.h"
#include "src/frontend/terminaloverlay.h"

using namespace Overlay;

Expand Down
8 changes: 4 additions & 4 deletions src/frontend/terminaloverlay.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
#ifndef TERMINAL_OVERLAY_HPP
#define TERMINAL_OVERLAY_HPP

#include "terminalframebuffer.h"
#include "network.h"
#include "transportsender.h"
#include "parser.h"
#include "src/terminal/terminalframebuffer.h"
#include "src/network/network.h"
#include "src/network/transportsender.h"
#include "src/terminal/parser.h"

#include <vector>
#include <limits.h>
Expand Down
4 changes: 2 additions & 2 deletions src/fuzz/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ if ENABLE_FUZZING
noinst_PROGRAMS = terminal_parser_fuzzer terminal_fuzzer
endif

terminal_parser_fuzzer_CPPFLAGS = -I$(srcdir)/../terminal -I$(srcdir)/../util
terminal_parser_fuzzer_CPPFLAGS = -I$(top_srcdir)/
terminal_parser_fuzzer_LDADD = ../terminal/libmoshterminal.a ../util/libmoshutil.a
terminal_parser_fuzzer_SOURCES = terminal_parser_fuzzer.cc

terminal_fuzzer_CPPFLAGS = -I$(srcdir)/../terminal -I$(srcdir)/../util -I$(srcdir)/../statesync -I../protobufs
terminal_fuzzer_CPPFLAGS = -I$(top_srcdir)/
terminal_fuzzer_LDADD = ../terminal/libmoshterminal.a ../util/libmoshutil.a ../statesync/libmoshstatesync.a ../protobufs/libmoshprotos.a $(TINFO_LIBS) $(protobuf_LIBS)
terminal_fuzzer_SOURCES = terminal_fuzzer.cc
4 changes: 2 additions & 2 deletions src/fuzz/terminal_fuzzer.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <cstddef>
#include <cstdint>

#include "parser.h"
#include "completeterminal.h"
#include "src/terminal/parser.h"
#include "src/statesync/completeterminal.h"

extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
Terminal::Display display(false);
Expand Down
Loading

0 comments on commit 39f6781

Please sign in to comment.