aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@google.com>2023-08-07 21:24:18 -0400
committerGravatar Alex Chernyakhovsky <achernya@mit.edu>2023-08-07 22:03:00 -0400
commit0b15dc94fa482ad253ab588038510af53306669d (patch)
tree9c0a57635162830def4a112af15e644bf9affe41 /src
parentf2904f95b38f7cdd15726ae6bfe0390b5ad855ce (diff)
Add a clang-format file and prepare for clang-formatting
Create .clang-format to describe the current C++ style used in Mosh. Mark one carefully-formatted array with `// clang-format off`. Also turn off clang-format in src/crypto/ocb_internal.cc, since it was imported almost wholesale from another project and is written in a style different from the rest of Mosh.
Diffstat (limited to 'src')
-rw-r--r--src/crypto/base64.cc2
-rw-r--r--src/crypto/ocb_internal.cc2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/crypto/base64.cc b/src/crypto/base64.cc
index ae38e3e..129aecb 100644
--- a/src/crypto/base64.cc
+++ b/src/crypto/base64.cc
@@ -39,6 +39,7 @@
static const char table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
static const unsigned char reverse[] = {
+ // clang-format off
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3e, 0xff, 0xff, 0xff, 0x3f,
@@ -55,6 +56,7 @@ static const unsigned char reverse[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ // clang-format on
};
/* Reverse maps from an ASCII char to a base64 sixbit value. Returns > 0x3f on failure. */
diff --git a/src/crypto/ocb_internal.cc b/src/crypto/ocb_internal.cc
index 0d4848c..b45e574 100644
--- a/src/crypto/ocb_internal.cc
+++ b/src/crypto/ocb_internal.cc
@@ -24,6 +24,8 @@
/ Comments are welcome: Ted Krovetz <ted@krovetz.net> - Dedicated to Laurel K
/------------------------------------------------------------------------- */
+// clang-format off
+
#include "src/include/config.h"
/* This module implements the ae.h interface for OpenSSL, Apple Common