Clean up indentation in a few places

This commit is contained in:
dongresource 2021-12-16 03:34:15 +01:00
parent b3c844650b
commit c6ffcd4804
5 changed files with 49 additions and 49 deletions

View File

@ -5,8 +5,8 @@
#include "core/Core.hpp" #include "core/Core.hpp"
namespace Buddies { namespace Buddies {
void init(); void init();
// Buddy list // Buddy list
void refreshBuddyList(CNSocket* sock); void refreshBuddyList(CNSocket* sock);
} }

View File

@ -8,7 +8,7 @@
#include <list> #include <list>
namespace Groups { namespace Groups {
void init(); void init();
void sendToGroup(Player* plr, void* buf, uint32_t type, size_t size); void sendToGroup(Player* plr, void* buf, uint32_t type, size_t size);
void groupTickInfo(Player* plr); void groupTickInfo(Player* plr);

View File

@ -9,7 +9,7 @@ struct EPInfo {
}; };
struct EPRace { struct EPRace {
std::set<int> collectedRings; std::set<int> collectedRings;
int mode, ticketSlot; int mode, ticketSlot;
time_t startTime; time_t startTime;
}; };

View File

@ -11,17 +11,17 @@ const float CN_EP_RANK_5 = 0.29f;
// methods of finding players for GM commands // methods of finding players for GM commands
enum eCN_GM_TargetSearchBy { enum eCN_GM_TargetSearchBy {
eCN_GM_TargetSearchBy__PC_ID, // player id eCN_GM_TargetSearchBy__PC_ID, // player id
eCN_GM_TargetSearchBy__PC_Name, // firstname, lastname eCN_GM_TargetSearchBy__PC_Name, // firstname, lastname
eCN_GM_TargetSearchBy__PC_UID // account id eCN_GM_TargetSearchBy__PC_UID // account id
}; };
enum eCN_GM_TeleportType { enum eCN_GM_TeleportType {
eCN_GM_TeleportMapType__XYZ, eCN_GM_TeleportMapType__XYZ,
eCN_GM_TeleportMapType__MapXYZ, eCN_GM_TeleportMapType__MapXYZ,
eCN_GM_TeleportMapType__MyLocation, eCN_GM_TeleportMapType__MyLocation,
eCN_GM_TeleportMapType__SomeoneLocation, eCN_GM_TeleportMapType__SomeoneLocation,
eCN_GM_TeleportMapType__Unstick eCN_GM_TeleportMapType__Unstick
}; };
// nano powers // nano powers
@ -925,10 +925,10 @@ enum {
* Each is the last packet - the upper bits + 1 * Each is the last packet - the upper bits + 1
*/ */
enum { enum {
N_CL2LS = 0xf, N_CL2LS = 0xf,
N_CL2FE = 0xa5, N_CL2FE = 0xa5,
N_FE2CL = 0x12f, N_FE2CL = 0x12f,
N_LS2CL = 0x1a, N_LS2CL = 0x1a,
N_PACKETS = N_CL2LS + N_CL2FE + N_FE2CL + N_LS2CL N_PACKETS = N_CL2LS + N_CL2FE + N_FE2CL + N_LS2CL
}; };

View File

@ -72,40 +72,40 @@ static inline int seccomp(unsigned int operation, unsigned int flags, void *args
#endif #endif
#define ALLOW_SYSCALL_ARG(_nr, _arg_nr, _arg_val) \ #define ALLOW_SYSCALL_ARG(_nr, _arg_nr, _arg_val) \
BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, (__NR_##_nr), 0, 6), \ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, (__NR_##_nr), 0, 6), \
/* load and test syscall argument, low word */ \ /* load and test syscall argument, low word */ \
BPF_STMT(BPF_LD+BPF_W+BPF_ABS, \ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, \
offsetof(struct seccomp_data, args[(_arg_nr)]) + ARG_LO_OFFSET), \ offsetof(struct seccomp_data, args[(_arg_nr)]) + ARG_LO_OFFSET), \
BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, \ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, \
((_arg_val) & 0xFFFFFFFF), 0, 3), \ ((_arg_val) & 0xFFFFFFFF), 0, 3), \
/* load and test syscall argument, high word */ \ /* load and test syscall argument, high word */ \
BPF_STMT(BPF_LD+BPF_W+BPF_ABS, \ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, \
offsetof(struct seccomp_data, args[(_arg_nr)]) + ARG_HI_OFFSET), \ offsetof(struct seccomp_data, args[(_arg_nr)]) + ARG_HI_OFFSET), \
BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, \ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, \
(((uint32_t)((uint64_t)(_arg_val) >> 32)) & 0xFFFFFFFF), 0, 1), \ (((uint32_t)((uint64_t)(_arg_val) >> 32)) & 0xFFFFFFFF), 0, 1), \
BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ALLOW), \ BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ALLOW), \
/* reload syscall number; all rules expect it in accumulator */ \ /* reload syscall number; all rules expect it in accumulator */ \
BPF_STMT(BPF_LD+BPF_W+BPF_ABS, \ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, \
offsetof(struct seccomp_data, nr)) offsetof(struct seccomp_data, nr))
/* Allow if syscall argument contains only values in mask */ /* Allow if syscall argument contains only values in mask */
#define ALLOW_SYSCALL_ARG_MASK(_nr, _arg_nr, _arg_mask) \ #define ALLOW_SYSCALL_ARG_MASK(_nr, _arg_nr, _arg_mask) \
BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, (__NR_##_nr), 0, 8), \ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, (__NR_##_nr), 0, 8), \
/* load, mask and test syscall argument, low word */ \ /* load, mask and test syscall argument, low word */ \
BPF_STMT(BPF_LD+BPF_W+BPF_ABS, \ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, \
offsetof(struct seccomp_data, args[(_arg_nr)]) + ARG_LO_OFFSET), \ offsetof(struct seccomp_data, args[(_arg_nr)]) + ARG_LO_OFFSET), \
BPF_STMT(BPF_ALU+BPF_AND+BPF_K, ~((_arg_mask) & 0xFFFFFFFF)), \ BPF_STMT(BPF_ALU+BPF_AND+BPF_K, ~((_arg_mask) & 0xFFFFFFFF)), \
BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0, 0, 4), \ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0, 0, 4), \
/* load, mask and test syscall argument, high word */ \ /* load, mask and test syscall argument, high word */ \
BPF_STMT(BPF_LD+BPF_W+BPF_ABS, \ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, \
offsetof(struct seccomp_data, args[(_arg_nr)]) + ARG_HI_OFFSET), \ offsetof(struct seccomp_data, args[(_arg_nr)]) + ARG_HI_OFFSET), \
BPF_STMT(BPF_ALU+BPF_AND+BPF_K, \ BPF_STMT(BPF_ALU+BPF_AND+BPF_K, \
~(((uint32_t)((uint64_t)(_arg_mask) >> 32)) & 0xFFFFFFFF)), \ ~(((uint32_t)((uint64_t)(_arg_mask) >> 32)) & 0xFFFFFFFF)), \
BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0, 0, 1), \ BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0, 0, 1), \
BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ALLOW), \ BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ALLOW), \
/* reload syscall number; all rules expect it in accumulator */ \ /* reload syscall number; all rules expect it in accumulator */ \
BPF_STMT(BPF_LD+BPF_W+BPF_ABS, \ BPF_STMT(BPF_LD+BPF_W+BPF_ABS, \
offsetof(struct seccomp_data, nr)) offsetof(struct seccomp_data, nr))
/* /*
* The main supported configuration is Linux on x86_64 with either glibc or * The main supported configuration is Linux on x86_64 with either glibc or