Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: require C99 and remove platform.h #49

Merged
merged 4 commits into from
Nov 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
refactor: require C99 and remove platform.h
szhorvat committed Nov 16, 2024
commit db3de6d282e6b1a69f0982114c8165973467e896
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -21,6 +21,10 @@ project(
)
enable_testing()

# Set C standard version
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED True)

# Expose the BUILD_SHARED_LIBS option in the ccmake UI
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)

2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ else()
set(PKGCONFIG_LIBS_PRIVATE "-lm")
endif()

set(PLFIT_CORE_SRCS error.c gss.c kolmogorov.c lbfgs.c mt.c platform.c plfit.c options.c rbinom.c sampling.c stats.c hzeta.c)
set(PLFIT_CORE_SRCS error.c gss.c kolmogorov.c lbfgs.c mt.c plfit.c options.c rbinom.c sampling.c stats.c hzeta.c)

add_library(plfit ${PLFIT_CORE_SRCS})
target_include_directories(plfit PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
1 change: 0 additions & 1 deletion src/error.c
Original file line number Diff line number Diff line change
@@ -20,7 +20,6 @@
#include <stdio.h>
#include <stdlib.h>
#include "plfit_error.h"
#include "platform.h"

static char *plfit_i_error_strings[] = {
"No error",
1 change: 0 additions & 1 deletion src/gss.c
Original file line number Diff line number Diff line change
@@ -22,7 +22,6 @@
#include <string.h>
#include "plfit_error.h"
#include "gss.h"
#include "platform.h"

/**
* \def PHI
1 change: 0 additions & 1 deletion src/hzeta.c
Original file line number Diff line number Diff line change
@@ -50,7 +50,6 @@
#include <stdio.h>
#include "hzeta.h"
#include "plfit_error.h"
#include "platform.h" /* because of NAN */

/* imported from gsl_machine.h */

1 change: 0 additions & 1 deletion src/lbfgs.c
Original file line number Diff line number Diff line change
@@ -73,7 +73,6 @@ licence.
#include <math.h>

#include "lbfgs.h"
#include "platform.h"

#ifdef _MSC_VER
#define inline __inline
1 change: 0 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
@@ -25,7 +25,6 @@
#include <string.h>
#include <time.h>
#include "getopt.h"
#include "platform.h"
#include "plfit.h"

/* exit status code for incorrect input data as defined in sysexits.h (8.1) */
36 changes: 0 additions & 36 deletions src/platform.c

This file was deleted.

69 changes: 0 additions & 69 deletions src/platform.h

This file was deleted.

1 change: 0 additions & 1 deletion src/plfit.c
Original file line number Diff line number Diff line change
@@ -27,7 +27,6 @@
#include "plfit_error.h"
#include "gss.h"
#include "lbfgs.h"
#include "platform.h"
#include "plfit.h"
#include "kolmogorov.h"
#include "plfit_sampling.h"
1 change: 0 additions & 1 deletion src/rbinom.c
Original file line number Diff line number Diff line change
@@ -44,7 +44,6 @@
#include <math.h>
#include <stdlib.h>
#include "plfit_sampling.h"
#include "platform.h"

#define repeat for(;;)

1 change: 0 additions & 1 deletion src/sampling.c
Original file line number Diff line number Diff line change
@@ -22,7 +22,6 @@

#include "plfit_error.h"
#include "plfit_sampling.h"
#include "platform.h"

inline double plfit_runif(double lo, double hi, plfit_mt_rng_t* rng) {
if (rng == 0) {