diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2017-03-05 16:44:50 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2017-03-05 16:44:50 +0100 |
commit | 5dbf1809c6e3e905b94b8764e99491e608122261 (patch) | |
tree | 5e5a5360db15d86d59ec8c6e4f7eb511388c5a9a /core/script_debugger_remote.h | |
parent | 45438e9918d421b244bfd7776a30e67dc7f2d3e3 (diff) |
A Whole New World (clang-format edition)
I can show you the code
Pretty, with proper whitespace
Tell me, coder, now when did
You last write readable code?
I can open your eyes
Make you see your bad indent
Force you to respect the style
The core devs agreed upon
A whole new world
A new fantastic code format
A de facto standard
With some sugar
Enforced with clang-format
A whole new world
A dazzling style we all dreamed of
And when we read it through
It's crystal clear
That now we're in a whole new world of code
Diffstat (limited to 'core/script_debugger_remote.h')
-rw-r--r-- | core/script_debugger_remote.h | 42 |
1 files changed, 16 insertions, 26 deletions
diff --git a/core/script_debugger_remote.h b/core/script_debugger_remote.h index 4b991e2f0c..9bdf116495 100644 --- a/core/script_debugger_remote.h +++ b/core/script_debugger_remote.h @@ -29,11 +29,10 @@ #ifndef SCRIPT_DEBUGGER_REMOTE_H #define SCRIPT_DEBUGGER_REMOTE_H - -#include "script_language.h" -#include "io/stream_peer_tcp.h" #include "io/packet_peer.h" +#include "io/stream_peer_tcp.h" #include "list.h" +#include "script_language.h" class ScriptDebuggerRemote : public ScriptDebugger { @@ -43,26 +42,24 @@ class ScriptDebuggerRemote : public ScriptDebugger { Array data; }; - struct ProfileInfoSort { - bool operator()(ScriptLanguage::ProfilingInfo*A,ScriptLanguage::ProfilingInfo*B) const { + bool operator()(ScriptLanguage::ProfilingInfo *A, ScriptLanguage::ProfilingInfo *B) const { return A->total_time < B->total_time; } }; Vector<ScriptLanguage::ProfilingInfo> profile_info; - Vector<ScriptLanguage::ProfilingInfo*> profile_info_ptrs; + Vector<ScriptLanguage::ProfilingInfo *> profile_info_ptrs; - Map<StringName,int> profiler_function_signature_map; - float frame_time,idle_time,fixed_time,fixed_frame_time; + Map<StringName, int> profiler_function_signature_map; + float frame_time, idle_time, fixed_time, fixed_frame_time; bool profiling; int max_frame_functions; bool skip_profile_frame; bool reload_all_scripts; - Ref<StreamPeerTCP> tcp_client; Ref<PacketPeerStream> packet_peer_stream; @@ -84,7 +81,6 @@ class ScriptDebuggerRemote : public ScriptDebugger { String error_descr; bool warning; Array callstack; - }; List<String> output_strings; @@ -97,7 +93,7 @@ class ScriptDebuggerRemote : public ScriptDebugger { uint64_t msec_count; bool locking; //hack to avoid a deadloop - static void _print_handler(void *p_this,const String& p_string); + static void _print_handler(void *p_this, const String &p_string); PrintHandlerList phl; @@ -105,25 +101,22 @@ class ScriptDebuggerRemote : public ScriptDebugger { void _poll_events(); uint32_t poll_every; - - bool _parse_live_edit(const Array &p_command); RequestSceneTreeMessageFunc request_scene_tree; void *request_scene_tree_ud; - void _set_object_property(ObjectID p_id, const String& p_property, const Variant& p_value); + void _set_object_property(ObjectID p_id, const String &p_property, const Variant &p_value); void _send_object_id(ObjectID p_id); void _send_video_memory(); LiveEditFuncs *live_edit_funcs; ErrorHandlerList eh; - static void _err_handler(void*,const char*,const char*,int p_line,const char *, const char *,ErrorHandlerType p_type); + static void _err_handler(void *, const char *, const char *, int p_line, const char *, const char *, ErrorHandlerType p_type); void _send_profiling_data(bool p_for_frame); - struct FrameData { StringName name; @@ -132,9 +125,7 @@ class ScriptDebuggerRemote : public ScriptDebugger { Vector<FrameData> profile_frame_data; - public: - struct ResourceUsage { String path; @@ -142,33 +133,32 @@ public: String type; RID id; int vram; - bool operator<(const ResourceUsage& p_img) const { return vram==p_img.vram ? id<p_img.id : vram > p_img.vram; } + bool operator<(const ResourceUsage &p_img) const { return vram == p_img.vram ? id < p_img.id : vram > p_img.vram; } }; - typedef void (*ResourceUsageFunc)(List<ResourceUsage>*); + typedef void (*ResourceUsageFunc)(List<ResourceUsage> *); static ResourceUsageFunc resource_usage_func; - Error connect_to_host(const String& p_host,uint16_t p_port); - virtual void debug(ScriptLanguage *p_script,bool p_can_continue=true); + Error connect_to_host(const String &p_host, uint16_t p_port); + virtual void debug(ScriptLanguage *p_script, bool p_can_continue = true); virtual void idle_poll(); virtual void line_poll(); virtual bool is_remote() const { return true; } virtual void request_quit(); - virtual void send_message(const String& p_message, const Array& p_args); + virtual void send_message(const String &p_message, const Array &p_args); virtual void set_request_scene_tree_message_func(RequestSceneTreeMessageFunc p_func, void *p_udata); virtual void set_live_edit_funcs(LiveEditFuncs *p_funcs); virtual bool is_profiling() const; - virtual void add_profiling_frame_data(const StringName& p_name,const Array& p_data); + virtual void add_profiling_frame_data(const StringName &p_name, const Array &p_data); virtual void profiling_start(); virtual void profiling_end(); - virtual void profiling_set_frame_times(float p_frame_time,float p_idle_time,float p_fixed_time,float p_fixed_frame_time); - + virtual void profiling_set_frame_times(float p_frame_time, float p_idle_time, float p_fixed_time, float p_fixed_frame_time); ScriptDebuggerRemote(); ~ScriptDebuggerRemote(); |