Skip to content

Commit da776e9

Browse files
committed
nits: clang-format-17 checks passing
1 parent e3f5a14 commit da776e9

File tree

4 files changed

+22
-9
lines changed

4 files changed

+22
-9
lines changed

.clang-format

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ DerivePointerAlignment: false
1515
BreakBeforeBraces: Custom
1616
BraceWrapping:
1717
AfterClass: true
18+
AfterEnum: true
19+
AfterExternBlock: true
20+
AfterFunction: true
21+
AfterStruct: true
22+
AfterUnion: true
1823
SplitEmptyFunction: false
1924
SplitEmptyRecord: false
2025
---

func/cpp/py_func.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
extern "C" {
1+
extern "C"
2+
{
23
#include "pyinit.h"
34
}
45

@@ -20,7 +21,8 @@ extern "C" {
2021
* Returns the relevant Python entry function. We need to invoke different
2122
* functions depending on which Faasm function index we're dealing with.
2223
*/
23-
const char* getPythonFunctionName() {
24+
const char* getPythonFunctionName()
25+
{
2426
char* entryFunc = faasmGetPythonEntry();
2527

2628
if (strlen(entryFunc) == 0) {
@@ -34,7 +36,8 @@ const char* getPythonFunctionName() {
3436
* Returns the working dir we need to be in to import the Python module
3537
* for the required function.
3638
*/
37-
const char* getPythonWorkingDir(const char* user, const char* funcName) {
39+
const char* getPythonWorkingDir(const char* user, const char* funcName)
40+
{
3841
auto workingDir = new char[60];
3942

4043
#ifdef __wasm__
@@ -50,7 +53,8 @@ const char* getPythonWorkingDir(const char* user, const char* funcName) {
5053
* Returns the name of the python module to execute. If executing in wasm this
5154
* will be different to when executing natively.
5255
*/
53-
const char* getPythonModuleName(const char* funcName) {
56+
const char* getPythonModuleName(const char* funcName)
57+
{
5458
#ifdef __wasm__
5559
return "function";
5660
#else
@@ -61,7 +65,8 @@ const char* getPythonModuleName(const char* funcName) {
6165
/**
6266
* Initialise CPython using a Faasm zygote to avoid doing so repeatedly
6367
*/
64-
FAASM_ZYGOTE() {
68+
FAASM_ZYGOTE()
69+
{
6570
Py_InitializeEx(0);
6671

6772
// 21/12/2022 - Numpy support is broken
@@ -90,7 +95,8 @@ FAASM_ZYGOTE() {
9095
return 0;
9196
}
9297

93-
int main(int argc, char* argv[]) {
98+
int main(int argc, char* argv[])
99+
{
94100
// With this line uncommented, this file can be run as a normal executable
95101
// for testing setEmulatedMessageFromJson(R"({"user": "python", "function":
96102
// "py_func", "py_user": "python", "py_func": "lang_test", "py_entry":

func/cpp/pyinit.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@
7474
fprintf(devNull, "%p", trunc##sfx); \
7575
fprintf(devNull, "%p", rint##sfx);
7676

77-
void setUpPyNumpy() {
77+
void setUpPyNumpy()
78+
{
7879
FILE* devNull = fopen("/dev/null", "w");
7980

8081
// Maths

func/cpp/pyinit.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
#define FAASM_PYTHON_H
33

44
#ifdef __cplusplus
5-
extern "C" {
5+
extern "C"
6+
{
67
#endif
78

8-
void setUpPyNumpy();
9+
void setUpPyNumpy();
910

1011
#ifdef __cplusplus
1112
}

0 commit comments

Comments
 (0)