tweak: formatting tweaks

This commit is contained in:
NunoSempere 2023-11-18 21:07:12 +00:00
parent 0de4132080
commit 61851a321a
5 changed files with 30 additions and 2 deletions

Binary file not shown.

View File

@ -31,7 +31,7 @@ int compare_doubles(const void* p, const void* q)
double x = *(const double*)p; double x = *(const double*)p;
double y = *(const double*)q; double y = *(const double*)q;
/* Avoid return x - y, which can cause undefined behaviour /* Avoid returning x - y, which can cause undefined behaviour
because of signed integer overflow. */ because of signed integer overflow. */
if (x < y) if (x < y)
return -1; // Return -1 if you want ascending, 1 if you want descending order. return -1; // Return -1 if you want ascending, 1 if you want descending order.

View File

@ -4,7 +4,7 @@ MAKEFLAGS += --no-print-directory
STYLE_BLUEPRINT=webkit STYLE_BLUEPRINT=webkit
FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT) FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
all: build-examples:
cd examples/01_one_sample && make && echo cd examples/01_one_sample && make && echo
cd examples/02_many_samples_time_to_botec && make && echo cd examples/02_many_samples_time_to_botec && make && echo
cd examples/03_gcc_nested_function && make && echo cd examples/03_gcc_nested_function && make && echo
@ -12,6 +12,33 @@ all:
cd examples/05_sample_from_cdf_beta && make && echo cd examples/05_sample_from_cdf_beta && make && echo
cd examples/06_gamma_beta && make && echo cd examples/06_gamma_beta && make && echo
cd examples/07_ci_beta && make && echo cd examples/07_ci_beta && make && echo
cd examples/08_nuclear_war && make && echo
cd examples/09_burn_10kg_fat && make && echo
cd examples/10_nuclear_recovery && make && echo
cd examples/11_algebra && make && echo
cd examples/12_algebra_and_conversion && make && echo
cd examples/13_ergonomic_algebra && make && echo
cd examples/14_twitter_thread_example && make && echo
cd examples/15_plotting-scratchpad && make && echo
cd examples/16_100_lognormal_samples && make && echo
format-examples:
cd examples/01_one_sample && make format && echo
cd examples/02_many_samples_time_to_botec && make format && echo
cd examples/03_gcc_nested_function && make format && echo
cd examples/04_sample_from_cdf_simple && make format && echo
cd examples/05_sample_from_cdf_beta && make format && echo
cd examples/06_gamma_beta && make format && echo
cd examples/07_ci_beta && make format && echo
cd examples/08_nuclear_war && make format && echo
cd examples/09_burn_10kg_fat && make format && echo
cd examples/10_nuclear_recovery && make format && echo
cd examples/11_algebra && make format && echo
cd examples/12_algebra_and_conversion && make format && echo
cd examples/13_ergonomic_algebra && make format && echo
cd examples/14_twitter_thread_example && make format && echo
cd examples/15_plotting-scratchpad && make format && echo
cd examples/16_100_lognormal_samples && make format && echo
format: squiggle.c squiggle.h format: squiggle.c squiggle.h
$(FORMATTER) squiggle.c $(FORMATTER) squiggle.c
@ -19,3 +46,4 @@ format: squiggle.c squiggle.h
lint: lint:
clang-tidy squiggle.c -- -lm clang-tidy squiggle.c -- -lm
clang-tidy extra.c -- -lm