From 02a3e906f21e379a36190fae72af8e228a1c32d1 Mon Sep 17 00:00:00 2001 From: Warwick Date: Sat, 26 Aug 2023 20:26:24 +0100 Subject: [PATCH] Added formatting tools --- CMakeLists.txt | 4 ++-- src/client/command_cli.c | 1 - src/server/main.c | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aeb78eb..704e9c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) project(urchin VERSION 0 DESCRIPTION "Simple Mud Experiment in C" @@ -7,7 +7,7 @@ project(urchin set(CMAKE_C_STANDARD 99) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -set(CMAKE_C_CLANG_TIDY) +set(CMAKE_C_CLANG_TIDY clang-tidy -checks=-*,readability-*) include(CheckIncludeFile) add_subdirectory(${CMAKE_SOURCE_DIR}/urchin-util) diff --git a/src/client/command_cli.c b/src/client/command_cli.c index 5e00367..ace8a11 100644 --- a/src/client/command_cli.c +++ b/src/client/command_cli.c @@ -10,7 +10,6 @@ Command *cmd__create() { } void cmd__add_move(Command *command, move_direction direction) { -// command->has_move_direction = 1; command->move_direction = direction; } diff --git a/src/server/main.c b/src/server/main.c index c5032bb..958c65b 100644 --- a/src/server/main.c +++ b/src/server/main.c @@ -1,6 +1,8 @@ // Sorry in advance for all the comments. This project is also a way for me to // learn C. +#include "command.h" +#include "world.h" #include #include #include //sockaddr_in @@ -11,8 +13,6 @@ #include // sockaddr #include #include -#include "world.h" -#include "command.h" int main(int argc, char *argv[]) { // Set up containers for file descriptor id's @@ -31,7 +31,7 @@ int main(int argc, char *argv[]) { // touched until it's used // Create world - Room* world = wrld__create(); + Room *world = wrld__create(); Player player; player.current_location = &world[0]; @@ -44,7 +44,7 @@ int main(int argc, char *argv[]) { // Require login as first request msg__recv_login(&cli_sockfd); - //HACK: test recieve of movement command + // HACK: test recieve of movement command err__log(player.current_location->name); cmd__process_cmd(&player, msg__recv_command(&cli_sockfd)); err__log(player.current_location->name);