From f770d105b88557a300f3991e1169428668cf76e5 Mon Sep 17 00:00:00 2001 From: John Breaux Date: Sun, 17 Apr 2022 18:29:32 -0500 Subject: [PATCH] Upgrade to C++ --- Makefile | 4 ++-- inc/{graph.h => graph.hpp} | 0 inc/{read_input.h => read_input.hpp} | 0 src/{graph.c => graph.cpp} | 4 ++-- src/{main.c => main.cpp} | 6 +++--- src/{read_input.c => read_input.cpp} | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) rename inc/{graph.h => graph.hpp} (100%) rename inc/{read_input.h => read_input.hpp} (100%) rename src/{graph.c => graph.cpp} (93%) rename src/{main.c => main.cpp} (76%) rename src/{read_input.c => read_input.cpp} (93%) diff --git a/Makefile b/Makefile index 4ecc2ba..3ecd532 100644 --- a/Makefile +++ b/Makefile @@ -16,12 +16,12 @@ DPATH = dep OPATH = obj # File type of source file -STYPE = c +STYPE = cpp VPATH = $(SPATH) $(IPATH) $(DPATH) $(OPATH) # compiler and compiler flags -CC = gcc +CC = g++ CFLAGS = -I$(IPATH) -pthread -lrt # list of object files diff --git a/inc/graph.h b/inc/graph.hpp similarity index 100% rename from inc/graph.h rename to inc/graph.hpp diff --git a/inc/read_input.h b/inc/read_input.hpp similarity index 100% rename from inc/read_input.h rename to inc/read_input.hpp diff --git a/src/graph.c b/src/graph.cpp similarity index 93% rename from src/graph.c rename to src/graph.cpp index 54e63a2..1ff8da7 100644 --- a/src/graph.c +++ b/src/graph.cpp @@ -1,5 +1,5 @@ -#include -#include "graph.h" +#include +#include "graph.hpp" int graph_reduce(struct adjmatrix *graph) { // TODO: Implement a function which checks if a process is blocked diff --git a/src/main.c b/src/main.cpp similarity index 76% rename from src/main.c rename to src/main.cpp index 2ededfe..25be347 100644 --- a/src/main.c +++ b/src/main.cpp @@ -3,9 +3,9 @@ +-------------+---------+-----------------------+ | Created 2022-04-16 | +-----------------------------------------------+ */ -#include // printf -#include "graph.h" // Graph reduction/Knot detection, struct adjmatrix -#include "read_input.h" //TODO: Read input in the associated C file, and provide an interface to that function here +#include // printf +#include "graph.hpp" // Graph reduction/Knot detection, struct adjmatrix +#include "read_input.hpp" //TODO: Read input in the associated C file, and provide an interface to that function here int main(int argc, char** argv) { diff --git a/src/read_input.c b/src/read_input.cpp similarity index 93% rename from src/read_input.c rename to src/read_input.cpp index 7488b89..7d0b1d8 100644 --- a/src/read_input.c +++ b/src/read_input.cpp @@ -1,7 +1,7 @@ //TODO: Include C file IO header (stdio.h? Whatever it is) -#include -#include "graph.h" // struct adjmatrix -#include "read_input.h" // read_input +#include +#include "graph.hpp" // struct adjmatrix +#include "read_input.hpp" // read_input #define MAX_LINE_LEN 1024