[K/N] Fix indents
^KT-61259
This commit is contained in:
committed by
Space Team
parent
dc2ea15dee
commit
089b7f31b5
@@ -9,11 +9,11 @@
|
|||||||
// FILE: auxiliaryCppSources.h
|
// FILE: auxiliaryCppSources.h
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char* name();
|
const char* name();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ extern "C" {
|
|||||||
|
|
||||||
static std::string _name = "OK";
|
static std::string _name = "OK";
|
||||||
|
|
||||||
const char* name() {
|
extern "C" const char* name() {
|
||||||
return _name.c_str();
|
return _name.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+49
-49
@@ -9,29 +9,29 @@
|
|||||||
// FILE: incompleteTypes.h
|
// FILE: incompleteTypes.h
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Forward declaration.
|
// Forward declaration.
|
||||||
struct S;
|
struct S;
|
||||||
extern struct S s;
|
extern struct S s;
|
||||||
|
|
||||||
const char* getContent(struct S* s);
|
const char* getContent(struct S* s);
|
||||||
void setContent(struct S* s, const char* name);
|
void setContent(struct S* s, const char* name);
|
||||||
|
|
||||||
union U;
|
union U;
|
||||||
extern union U u;
|
extern union U u;
|
||||||
|
|
||||||
double getDouble(union U* u);
|
double getDouble(union U* u);
|
||||||
void setDouble(union U* u, double value);
|
void setDouble(union U* u, double value);
|
||||||
|
|
||||||
// Global array of unknown size.
|
// Global array of unknown size.
|
||||||
extern char array[];
|
extern char array[];
|
||||||
|
|
||||||
|
|
||||||
int arrayLength();
|
int arrayLength();
|
||||||
void setArrayValue(char* array, char value);
|
void setArrayValue(char* array, char value);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -41,52 +41,52 @@ extern "C" {
|
|||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
struct S {
|
struct S {
|
||||||
std::string name;
|
std::string name;
|
||||||
};
|
};
|
||||||
|
|
||||||
S s = {
|
S s = {
|
||||||
.name = "initial"
|
.name = "initial"
|
||||||
};
|
};
|
||||||
|
|
||||||
void setContent(struct S* s, const char* name) {
|
void setContent(struct S* s, const char* name) {
|
||||||
// Note that copy here is intentional: we use it as a workaround
|
// Note that copy here is intentional: we use it as a workaround
|
||||||
// for short lifetime of copy of the passed Kotlin string.
|
// for short lifetime of copy of the passed Kotlin string.
|
||||||
s->name = name;
|
s->name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* getContent(struct S* s) {
|
const char* getContent(struct S* s) {
|
||||||
return s->name.c_str();
|
return s->name.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
union U {
|
union U {
|
||||||
float f;
|
float f;
|
||||||
double d;
|
double d;
|
||||||
};
|
};
|
||||||
|
|
||||||
void setDouble(union U* u, double value) {
|
void setDouble(union U* u, double value) {
|
||||||
u->d = value;
|
u->d = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
double getDouble(union U* u) {
|
double getDouble(union U* u) {
|
||||||
return u->d;
|
return u->d;
|
||||||
}
|
}
|
||||||
|
|
||||||
union U u = {
|
union U u = {
|
||||||
.d = 0.0
|
.d = 0.0
|
||||||
};
|
};
|
||||||
|
|
||||||
char array[5] = { 0, 0, 0, 0, 0 };
|
char array[5] = { 0, 0, 0, 0, 0 };
|
||||||
|
|
||||||
void setArrayValue(char* array, char value) {
|
void setArrayValue(char* array, char value) {
|
||||||
for (int i = 0; i < 5; ++i) {
|
for (int i = 0; i < 5; ++i) {
|
||||||
array[i] = value;
|
array[i] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int arrayLength() {
|
int arrayLength() {
|
||||||
return sizeof(array) / sizeof(char);
|
return sizeof(array) / sizeof(char);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -7,11 +7,11 @@ void test_RunInNewThread(void (*)());
|
|||||||
// FILE: leakMemoryWithRunningThreadUnchecked.h
|
// FILE: leakMemoryWithRunningThreadUnchecked.h
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void test_RunInNewThread(void (*)());
|
void test_RunInNewThread(void (*)());
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user