Skip to content

Commit

Permalink
Merge pull request #38850 from akien-mga/style-clang-format-unnecessa…
Browse files Browse the repository at this point in the history
…ry-semicolons

Style: Fix unnecessary semicolons that confused clang-format
  • Loading branch information
akien-mga authored May 19, 2020
2 parents 74b5d68 + ca3192d commit dee8f8d
Show file tree
Hide file tree
Showing 25 changed files with 64 additions and 159 deletions.
5 changes: 2 additions & 3 deletions core/os/os.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,9 @@ uint64_t OS::get_system_time_msecs() const {
return 0;
}

void OS::debug_break(){

void OS::debug_break() {
// something
};
}

void OS::_set_logger(CompositeLogger *p_logger) {
if (_logger) {
Expand Down
32 changes: 16 additions & 16 deletions core/safe_refcount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,27 @@
/* taken from boost */ \
while (true) { \
m_cpp_type tmp = static_cast<m_cpp_type const volatile &>(*(m_pw)); \
if (tmp == 0) \
if (tmp == 0) { \
return 0; /* if zero, can't add to it anymore */ \
if (m_win_cmpxchg((m_win_type volatile *)(m_pw), tmp + 1, tmp) == tmp) \
} \
if (m_win_cmpxchg((m_win_type volatile *)(m_pw), tmp + 1, tmp) == tmp) { \
return tmp + 1; \
} \
}

#define ATOMIC_EXCHANGE_IF_GREATER_BODY(m_pw, m_val, m_win_type, m_win_cmpxchg, m_cpp_type) \
while (true) { \
m_cpp_type tmp = static_cast<m_cpp_type const volatile &>(*(m_pw)); \
if (tmp >= m_val) \
if (tmp >= m_val) { \
return tmp; /* already greater, or equal */ \
if (m_win_cmpxchg((m_win_type volatile *)(m_pw), m_val, tmp) == tmp) \
} \
if (m_win_cmpxchg((m_win_type volatile *)(m_pw), m_val, tmp) == tmp) { \
return m_val; \
} \
}

_ALWAYS_INLINE_ uint32_t _atomic_conditional_increment_impl(volatile uint32_t *pw){

ATOMIC_CONDITIONAL_INCREMENT_BODY(pw, LONG, InterlockedCompareExchange, uint32_t)
_ALWAYS_INLINE_ uint32_t _atomic_conditional_increment_impl(volatile uint32_t *pw) {
ATOMIC_CONDITIONAL_INCREMENT_BODY(pw, LONG, InterlockedCompareExchange, uint32_t);
}

_ALWAYS_INLINE_ uint32_t _atomic_decrement_impl(volatile uint32_t *pw) {
Expand All @@ -78,14 +81,12 @@ _ALWAYS_INLINE_ uint32_t _atomic_add_impl(volatile uint32_t *pw, volatile uint32
return InterlockedAdd((LONG volatile *)pw, val);
}

_ALWAYS_INLINE_ uint32_t _atomic_exchange_if_greater_impl(volatile uint32_t *pw, volatile uint32_t val){

ATOMIC_EXCHANGE_IF_GREATER_BODY(pw, val, LONG, InterlockedCompareExchange, uint32_t)
_ALWAYS_INLINE_ uint32_t _atomic_exchange_if_greater_impl(volatile uint32_t *pw, volatile uint32_t val) {
ATOMIC_EXCHANGE_IF_GREATER_BODY(pw, val, LONG, InterlockedCompareExchange, uint32_t);
}

_ALWAYS_INLINE_ uint64_t _atomic_conditional_increment_impl(volatile uint64_t *pw){

ATOMIC_CONDITIONAL_INCREMENT_BODY(pw, LONGLONG, InterlockedCompareExchange64, uint64_t)
_ALWAYS_INLINE_ uint64_t _atomic_conditional_increment_impl(volatile uint64_t *pw) {
ATOMIC_CONDITIONAL_INCREMENT_BODY(pw, LONGLONG, InterlockedCompareExchange64, uint64_t);
}

_ALWAYS_INLINE_ uint64_t _atomic_decrement_impl(volatile uint64_t *pw) {
Expand All @@ -104,9 +105,8 @@ _ALWAYS_INLINE_ uint64_t _atomic_add_impl(volatile uint64_t *pw, volatile uint64
return InterlockedAdd64((LONGLONG volatile *)pw, val);
}

_ALWAYS_INLINE_ uint64_t _atomic_exchange_if_greater_impl(volatile uint64_t *pw, volatile uint64_t val){

ATOMIC_EXCHANGE_IF_GREATER_BODY(pw, val, LONGLONG, InterlockedCompareExchange64, uint64_t)
_ALWAYS_INLINE_ uint64_t _atomic_exchange_if_greater_impl(volatile uint64_t *pw, volatile uint64_t val) {
ATOMIC_EXCHANGE_IF_GREATER_BODY(pw, val, LONGLONG, InterlockedCompareExchange64, uint64_t);
}

// The actual advertised functions; they'll call the right implementation
Expand Down
5 changes: 0 additions & 5 deletions modules/bullet/rigid_body_bullet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,11 +445,6 @@ void RigidBodyBullet::assert_no_constraints() {
if (btBody->getNumConstraintRefs()) {
WARN_PRINT("A body with a joints is destroyed. Please check the implementation in order to destroy the joint before the body.");
}
/*for(int i = btBody->getNumConstraintRefs()-1; 0<=i; --i){
btTypedConstraint* btConst = btBody->getConstraintRef(i);
JointBullet* joint = static_cast<JointBullet*>( btConst->getUserConstraintPtr() );
space->removeConstraint(joint);
}*/
}

void RigidBodyBullet::set_activation_state(bool p_active) {
Expand Down
16 changes: 6 additions & 10 deletions modules/camera/camera_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ class CameraFeedWindows : public CameraFeed {
void deactivate_feed();
};

CameraFeedWindows::CameraFeedWindows(){
CameraFeedWindows::CameraFeedWindows() {
///@TODO implement this, should store information about our available camera
};
}

CameraFeedWindows::~CameraFeedWindows() {
// make sure we stop recording if we are!
Expand All @@ -75,24 +75,20 @@ bool CameraFeedWindows::activate_feed() {
///@TODO we should probably have a callback method here that is being called by the
// camera API which provides frames and call back into the CameraServer to update our texture

void CameraFeedWindows::deactivate_feed(){
void CameraFeedWindows::deactivate_feed() {
///@TODO this should deactivate our camera and stop the process of capturing frames
};
}

//////////////////////////////////////////////////////////////////////////
// CameraWindows - Subclass for our camera server on windows

void CameraWindows::add_active_cameras(){
void CameraWindows::add_active_cameras() {
///@TODO scan through any active cameras and create CameraFeedWindows objects for them
};
}

CameraWindows::CameraWindows() {
// Find cameras active right now
add_active_cameras();

// need to add something that will react to devices being connected/removed...
};

CameraWindows::~CameraWindows(){

};
2 changes: 1 addition & 1 deletion modules/camera/camera_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CameraWindows : public CameraServer {

public:
CameraWindows();
~CameraWindows();
~CameraWindows() {}
};

#endif /* CAMERAWIN_H */
1 change: 0 additions & 1 deletion modules/gdnavigation/nav_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ Vector<Vector3> NavMap::get_path(Vector3 p_origin, Vector3 p_destination, bool p
left = p->poly->points[prev].pos;
right = p->poly->points[prev_n].pos;

//if (CLOCK_TANGENT(apex_point,left,(left+right)*0.5).dot(up) < 0){
if (p->poly->clockwise) {
SWAP(left, right);
}
Expand Down
6 changes: 0 additions & 6 deletions modules/mobile_vr/mobile_vr_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,12 +448,6 @@ void MobileVRInterface::process() {
};
};

void MobileVRInterface::notification(int p_what){
_THREAD_SAFE_METHOD_

// nothing to do here, I guess we could pauze our sensors...
}

MobileVRInterface::MobileVRInterface() {
initialized = false;

Expand Down
2 changes: 1 addition & 1 deletion modules/mobile_vr/mobile_vr_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class MobileVRInterface : public XRInterface {
virtual void commit_for_eye(XRInterface::Eyes p_eye, RID p_render_target, const Rect2 &p_screen_rect);

virtual void process();
virtual void notification(int p_what);
virtual void notification(int p_what) {}

MobileVRInterface();
~MobileVRInterface();
Expand Down
11 changes: 4 additions & 7 deletions modules/theora/video_stream_theora.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,8 @@ bool VideoStreamPlaybackTheora::is_paused() const {
return paused;
};

void VideoStreamPlaybackTheora::set_loop(bool p_enable){

};
void VideoStreamPlaybackTheora::set_loop(bool p_enable) {
}

bool VideoStreamPlaybackTheora::has_loop() const {
return false;
Expand All @@ -605,10 +604,8 @@ float VideoStreamPlaybackTheora::get_playback_position() const {
return get_time();
};

void VideoStreamPlaybackTheora::seek(float p_time){

// no
};
void VideoStreamPlaybackTheora::seek(float p_time) {
}

void VideoStreamPlaybackTheora::set_mix_callback(AudioMixCallback p_callback, void *p_userdata) {
mix_callback = p_callback;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void purchase(final String sku, final String transactionId) {
PaymentsCache pc = new PaymentsCache(context);
Boolean isBlocked = pc.getConsumableFlag("block", sku);
/*
if(isBlocked){
if(isBlocked) {
Log.d("XXX", "Is awaiting payment confirmation");
error("Awaiting payment confirmation");
return;
Expand Down
8 changes: 0 additions & 8 deletions platform/uwp/thread_uwp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,3 @@ void ThreadUWP::make_default() {
get_thread_id_func = get_thread_id_func_uwp;
wait_to_finish_func = wait_to_finish_func_uwp;
};

ThreadUWP::ThreadUWP(){

};

ThreadUWP::~ThreadUWP(){

};
8 changes: 4 additions & 4 deletions platform/uwp/thread_uwp.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ class ThreadUWP : public Thread {
static ID get_thread_id_func_uwp();
static void wait_to_finish_func_uwp(Thread *p_thread);

ThreadUWP();
ThreadUWP() {}

public:
virtual ID get_id() const;

static void make_default();

~ThreadUWP();
~ThreadUWP() {}
};

#endif
#endif // UWP_ENABLED

#endif
#endif // THREAD_UWP_H
9 changes: 0 additions & 9 deletions scene/3d/proximity_group_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,5 @@ void ProximityGroup3D::_bind_methods() {
};

ProximityGroup3D::ProximityGroup3D() {
group_version = 0;
dispatch_mode = MODE_PROXY;

cell_size = 1.0;
grid_radius = Vector3(1, 1, 1);
set_notify_transform(true);
};

ProximityGroup3D::~ProximityGroup3D(){

};
10 changes: 5 additions & 5 deletions scene/3d/proximity_group_3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ class ProximityGroup3D : public Node3D {

void _notification(int p_what);

DispatchMode dispatch_mode;
DispatchMode dispatch_mode = MODE_PROXY;

Map<StringName, uint32_t> groups;
String group_name;

float cell_size;
Vector3 grid_radius;
uint32_t group_version;
float cell_size = 1.0;
Vector3 grid_radius = Vector3(1, 1, 1);
uint32_t group_version = 0;

void add_groups(int *p_cell, String p_base, int p_depth);
void _new_group(StringName p_name);
Expand All @@ -78,7 +78,7 @@ class ProximityGroup3D : public Node3D {
void broadcast(String p_name, Variant p_params);

ProximityGroup3D();
~ProximityGroup3D();
~ProximityGroup3D() {}
};

VARIANT_ENUM_CAST(ProximityGroup3D::DispatchMode);
Expand Down
36 changes: 1 addition & 35 deletions scene/3d/xr_nodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
/*************************************************************************/

#include "xr_nodes.h"

#include "core/input/input.h"
#include "servers/xr/xr_interface.h"
#include "servers/xr_server.h"
Expand Down Expand Up @@ -168,14 +169,6 @@ Vector<Plane> XRCamera3D::get_frustum() const {
return cm.get_projection_planes(get_camera_transform());
};

XRCamera3D::XRCamera3D(){
// nothing to do here yet for now..
};

XRCamera3D::~XRCamera3D(){
// nothing to do here yet for now..
};

////////////////////////////////////////////////////////////////////////////////////////////////////

void XRController3D::_notification(int p_what) {
Expand Down Expand Up @@ -382,16 +375,6 @@ String XRController3D::get_configuration_warning() const {
return String();
};

XRController3D::XRController3D() {
controller_id = 1;
is_active = true;
button_states = 0;
};

XRController3D::~XRController3D(){
// nothing to do here yet for now..
};

////////////////////////////////////////////////////////////////////////////////////////////////////

void XRAnchor3D::_notification(int p_what) {
Expand Down Expand Up @@ -522,15 +505,6 @@ Ref<Mesh> XRAnchor3D::get_mesh() const {
return mesh;
}

XRAnchor3D::XRAnchor3D() {
anchor_id = 1;
is_active = true;
};

XRAnchor3D::~XRAnchor3D(){
// nothing to do here yet for now..
};

////////////////////////////////////////////////////////////////////////////////////////////////////

String XROrigin3D::get_configuration_warning() const {
Expand Down Expand Up @@ -615,11 +589,3 @@ void XROrigin3D::_notification(int p_what) {
}
}
};

XROrigin3D::XROrigin3D() {
tracked_camera = nullptr;
};

XROrigin3D::~XROrigin3D(){
// nothing to do here yet for now..
};
Loading

0 comments on commit dee8f8d

Please sign in to comment.