Skip to content

Commit 811fefd

Browse files
committed
Added .clang-format in src/
1 parent b214b76 commit 811fefd

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

src/.clang-format

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Defines the Chromium style for automatic reformatting.
2+
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
3+
BasedOnStyle: Chromium
4+
5+
# clang-format doesn't seem to do a good job of this for longer comments.
6+
ReflowComments: 'false'
7+
8+
# We have lots of these. Though we need to put them all in curly braces,
9+
# clang-format can't do that.
10+
AllowShortIfStatementsOnASingleLine: 'true'
11+
12+
# Put escaped newlines into the rightmost column.
13+
AlignEscapedNewlinesLeft: false

src/symbols.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
#include <stddef.h>
2121

2222
// BoringSSL headers
23-
#include <openssl/crypto.h>
2423
#include <openssl/aead.h>
2524
#include <openssl/bn.h>
2625
#include <openssl/bytestring.h>
2726
#include <openssl/cipher.h>
27+
#include <openssl/crypto.h>
2828
#include <openssl/digest.h>
2929
#include <openssl/ec.h>
3030
#include <openssl/ec_key.h>
@@ -40,6 +40,6 @@
4040

4141
// Symbol lookup table defined in `symbols.generated.h`, with indexes matching
4242
// the enum values in `lib/src/boringssl/lookup/symbols.generated.dart`.
43-
extern void *_webcrypto_symbol_table[];
43+
extern void* _webcrypto_symbol_table[];
4444

45-
#endif // WEBCRYPTO_SYMBOLS_H
45+
#endif // WEBCRYPTO_SYMBOLS_H

src/webcrypto.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,15 @@
1616

1717
#include <stdint.h>
1818

19+
#include "include/dart_api_dl.h"
1920
#include "symbols.h"
2021

2122
// Macro for annotating all functions to be exported
22-
#define WEBCRYPTO_EXPORT \
23-
__attribute__((visibility("default"))) \
24-
__attribute__((used))
23+
#define WEBCRYPTO_EXPORT \
24+
__attribute__((visibility("default"))) __attribute__((used))
2525

2626
// Function to lookup BoringSSL symbols based on index in the Sym enum.
2727
// See src/symbols.yaml for details.
28-
WEBCRYPTO_EXPORT void *webcrypto_lookup_symbol(int32_t index)
29-
{
28+
WEBCRYPTO_EXPORT void* webcrypto_lookup_symbol(int32_t index) {
3029
return _webcrypto_symbol_table[index];
3130
}

0 commit comments

Comments
 (0)