Skip to content

Commit

Permalink
Apply formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
fwsGonzo committed Sep 14, 2024
1 parent 2e02623 commit a660ba1
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 23 deletions.
1 change: 0 additions & 1 deletion src/docker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
static constexpr bool VERBOSE_CMD = true;
using namespace godot;


static bool ContainerIsAlreadyRunning(String container_name) {
godot::OS *OS = godot::OS::get_singleton();
PackedStringArray arguments = { "container", "inspect", "-f", "{{.State.Running}}", container_name };
Expand Down
13 changes: 6 additions & 7 deletions src/elf/script_instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,12 @@ GDExtensionMethodInfo create_method_info(const MethodInfo &method_info) {
return GDExtensionMethodInfo{
.name = stringname_alloc(method_info.name),
.return_value = GDExtensionPropertyInfo{
.type = GDEXTENSION_VARIANT_TYPE_OBJECT,
.name = stringname_alloc(method_info.return_val.name),
.class_name = stringname_alloc(method_info.return_val.class_name),
.hint = method_info.return_val.hint,
.hint_string = stringname_alloc(method_info.return_val.hint_string),
.usage = method_info.return_val.usage
},
.type = GDEXTENSION_VARIANT_TYPE_OBJECT,
.name = stringname_alloc(method_info.return_val.name),
.class_name = stringname_alloc(method_info.return_val.class_name),
.hint = method_info.return_val.hint,
.hint_string = stringname_alloc(method_info.return_val.hint_string),
.usage = method_info.return_val.usage },
.flags = method_info.flags,
.id = method_info.id,
.argument_count = (uint32_t)method_info.arguments.size(),
Expand Down
14 changes: 7 additions & 7 deletions src/guest_datatypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ struct GDNativeVariant {
uint8_t padding[7];
union {
struct {
double flt;
uint64_t flt_padding1;
double flt;
uint64_t flt_padding1;
};
struct {
uint64_t value;
uint64_t i64_padding;
uint64_t value;
uint64_t i64_padding;
};
struct {
real_t vec2_flt[2];
real_t vec2_flt[2];
};
struct {
int32_t ivec2_int[2];
int32_t ivec2_int[2];
};
struct {
uint64_t object_id;
uint64_t object_id;
GodotObject *object_ptr;
};
};
Expand Down
2 changes: 1 addition & 1 deletion src/rust/script_rust.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class RustScript : public ScriptExtension {
DockerContainerStart();
if (docker_container_version == 0)
docker_container_version =
Docker::ContainerVersion(docker_container_name, { "/usr/project/build.sh", "--version" });
Docker::ContainerVersion(docker_container_name, { "/usr/project/build.sh", "--version" });
return docker_container_version;
}
static bool DockerContainerExecute(const PackedStringArray &p_arguments, Array &output) {
Expand Down
4 changes: 2 additions & 2 deletions src/sandbox.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include "sandbox.h"

#include "guest_datatypes.h"
#include "sandbox_project_settings.h"
#include <godot_cpp/classes/engine.hpp>
#include <godot_cpp/classes/file_access.hpp>
#include <godot_cpp/classes/os.hpp>
#include <godot_cpp/core/class_db.hpp>
#include <godot_cpp/variant/utility_functions.hpp>
#include "sandbox_project_settings.h"

using namespace godot;

Expand Down Expand Up @@ -206,7 +206,7 @@ Variant Sandbox::vmcall_fn(const StringName &function, const Variant **args, GDE
void Sandbox::setup_arguments_native(gaddr_t arrayDataPtr, GuestVariant *v, const Variant **args, int argc) {
// In this mode we will try to use registers when possible
// The stack is already set up from setup_arguments(), so we just need to set up the registers
auto& machine = this->machine();
machine_t &machine = this->machine();
int index = 11;
int flindex = 10;

Expand Down
2 changes: 1 addition & 1 deletion src/sandbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class Sandbox : public Node {
// State stack, with the permanent (initial) state at index 0.
// That means eg. static Variant values are held stored in the state at index 0,
// so that they can be accessed by future VM calls, and not lost when a call ends.
std::array<CurrentState, MAX_LEVEL+1> m_states;
std::array<CurrentState, MAX_LEVEL + 1> m_states;

// Properties
mutable std::vector<SandboxProperty> m_properties;
Expand Down
3 changes: 1 addition & 2 deletions src/sandbox_exception.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "sandbox.h"

#include <charconv>
#include "cpp/script_cpp.h"
#include <charconv>

static constexpr bool VERBOSE_EXCEPTIONS = false;

Expand Down Expand Up @@ -83,4 +83,3 @@ void Sandbox::print_backtrace(const gaddr_t addr) {
"-> [-] 0x", to_hex(origin.address), " + 0x", to_hex(origin.offset),
": ", name);
}

3 changes: 1 addition & 2 deletions tests/tests/test_basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ extern "C" Variant test_sub_dictionary(Dictionary dict) {
return Dictionary(dict)["1"];
}


extern "C" Variant test_object(Object arg) {
return arg;
}
Expand All @@ -62,7 +61,7 @@ static bool timer_got_called = false;
extern "C" Variant test_timers() {
long val1 = 11;
float val2 = 22.0f;
return Timer::native_periodic(0.01, [=] (Node timer) -> Variant {
return Timer::native_periodic(0.01, [=](Node timer) -> Variant {
print("Timer with values: ", val1, val2);
timer.queue_free();
timer_got_called = true;
Expand Down

0 comments on commit a660ba1

Please sign in to comment.