Skip to content

Commit bc7d43b

Browse files
committed
clean up headers to be C++11/14 compliant. update readme
1 parent 7b885ac commit bc7d43b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+205
-179
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
cmake_minimum_required(VERSION 3.5)
22
project(fsd
3-
VERSION 2.99.0
3+
VERSION 3.99.0
44
LANGUAGES C CXX)
55

6-
set(CMAKE_CXX_STANDARD 14)
7-
86
add_executable(fsd
97
fsd/attributes.h
108
fsd/authenticate.c
@@ -49,3 +47,5 @@ add_executable(fsd
4947
fsd/user.h
5048
fsd/wprofile.cpp
5149
fsd/wprofile.h)
50+
set_property(TARGET fsd PROPERTY CXX_STANDARD 14)
51+
set_property(TARGET fsd PROPERTY CXX_STANDARD_REQUIRED ON)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# FSD
1+
# FSD 4.0
22

33
## History
44

fsd/certificate.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
#include <stdio.h>
2-
#include <stdlib.h>
3-
#include <string.h>
1+
#include <cstdio>
2+
#include <cstdlib>
3+
#include <cstring>
4+
45
#include "certificate.h"
56
#include "global.h"
67

7-
char *certlevels[]=
8+
const char *certlevels[]=
89
{
910
"SUSPENDED", "OBSPILOT", "STUDENT1", "STUDENT2", "STUDENT3",
1011
"CONTROLLER1", "CONTROLLER2", "CONTROLLER3", "INSTRUCTOR1",

fsd/certificate.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
#ifndef CERTIFICATEHH
2-
#define CERTIFICATEHH
1+
#include <ctime>
32

4-
#include <time.h>
53
#include "interface.h"
64

5+
#ifndef CERTIFICATEHH
6+
#define CERTIFICATEHH
7+
78
#define CERTPILOT 1
89
#define CERTATC 2
910

@@ -18,7 +19,7 @@ class certificate
1819
void configure(char *, int, time_t, char *);
1920
~certificate();
2021
};
21-
extern char *certlevels[];
22+
extern const char *certlevels[];
2223
int maxlevel(char *, char *, int *);
2324
certificate *getcert(char *name);
2425
extern certificate *rootcert;

fsd/client.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
#include <stdio.h>
2-
#include <stdlib.h>
1+
#include <cstdio>
2+
#include <cstdlib>
33
#ifndef WIN32
44
#include <unistd.h>
55
#endif
6-
#include <string.h>
7-
#include <math.h>
6+
#include <cstring>
7+
#include <cmath>
8+
89
#include "client.h"
910
#include "cluser.h"
1011
#include "fsd.h"
1112
#include "support.h"
1213
#include "global.h"
14+
1315
client *rootclient=NULL;
1416

1517
client::client(char *i, server *where, char *cs, int t, int reqrating,

fsd/client.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
#include <ctime>
2+
3+
#include "server.h"
4+
15
#ifndef CLIENTHH
26
#define CLIENTHH
3-
#include "server.h"
4-
#include <time.h>
57

68
#define CLIENT_PILOT 1
79
#define CLIENT_ATC 2

fsd/clinterface.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#include <stdio.h>
2-
#include <stdlib.h>
1+
#include <cstdio>
2+
#include <cstdlib>
33
#ifndef WIN32
44
#include <unistd.h>
5-
#include <sys/time.h>
65
#endif
7-
#include <time.h>
8-
#include <string.h>
6+
#include <ctime>
7+
#include <cstring>
8+
99
#include "interface.h"
1010
#include "clinterface.h"
1111
#include "global.h"

fsd/clinterface.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
#ifndef CLINTERFACEHH
2-
#define CLINTERFACEHH
1+
#include <ctime>
32

4-
#include <time.h>
53
#include "interface.h"
64
#include "user.h"
75
#include "client.h"
86
#include "wprofile.h"
7+
8+
#ifndef CLINTERFACEHH
9+
#define CLINTERFACEHH
10+
911
class clinterface:public tcpinterface
1012
{
1113
time_t prevwinddelta;

fsd/cluser.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
#include <stdio.h>
2-
#include <stdlib.h>
1+
#include <cstdio>
2+
#include <cstdlib>
33
#ifndef WIN32
44
#include <unistd.h>
55
#endif
6-
#include <ctype.h>
7-
#include <string.h>
6+
#include <cctype>
7+
#include <cstring>
8+
89
#include "global.h"
910
#include "cluser.h"
1011
#include "support.h"
@@ -15,7 +16,7 @@
1516
#include "fsdpaths.h"
1617

1718
/* The client communication command names */
18-
char *clcmdnames[]=
19+
const char *clcmdnames[]=
1920
{
2021
"#AA",
2122
"#DA",
@@ -48,7 +49,7 @@ char *clcmdnames[]=
4849
NULL
4950
};
5051

51-
char *errstr[]=
52+
const char *errstr[]=
5253
{
5354
"No error",
5455
"Callsign in use",

fsd/cluser.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
#ifndef CLUSERHH
2-
#define CLUSERHH
31
#include "interface.h"
42
#include "clinterface.h"
53
#include "user.h"
64
#include "client.h"
75

6+
#ifndef CLUSERHH
7+
#define CLUSERHH
8+
89
class cluser : public absuser
910
{
1011
clinterface *parent;

0 commit comments

Comments
 (0)