Skip to content

Commit

Permalink
refactor: require C99 and remove platform.h
Browse files Browse the repository at this point in the history
  • Loading branch information
szhorvat committed Nov 16, 2024
1 parent 651adf2 commit db3de6d
Show file tree
Hide file tree
Showing 12 changed files with 5 additions and 114 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
1 change: 0 additions & 1 deletion src/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion src/gss.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <string.h>
#include "plfit_error.h"
#include "gss.h"
#include "platform.h"

/**
* \def PHI
Expand Down
1 change: 0 additions & 1 deletion src/hzeta.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

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

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

#ifdef _MSC_VER
#define inline __inline
Expand Down
1 change: 0 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
Expand Down
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
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion src/rbinom.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
#include <math.h>
#include <stdlib.h>
#include "plfit_sampling.h"
#include "platform.h"

#define repeat for(;;)

Expand Down
1 change: 0 additions & 1 deletion src/sampling.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit db3de6d

Please sign in to comment.