From 3c8b9922fbbe562970e433ed3be3be299c87fcf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20A=2E=20Ortega?= Date: Sat, 10 Dec 2016 02:20:57 +0100 Subject: [PATCH] Shorten the long ass `unsigned long long int' to ulli. --- src/list.h | 6 ++++-- src/main.c | 3 ++- src/types.h | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 src/types.h diff --git a/src/list.h b/src/list.h index 5e45018..b0bead8 100644 --- a/src/list.h +++ b/src/list.h @@ -2,13 +2,15 @@ #include #include +#include "types.h" + /** * @brief An infinitely expanding list type. */ typedef struct { mpz_t *list; //!< The list of elements - unsigned long long int size; //!< How many elements are in the list - unsigned long long int end; //!< The last element of the list (in use) + ulli size; //!< How many elements are in the list + ulli end; //!< The last element of the list (in use) } List; /** diff --git a/src/main.c b/src/main.c index 44a5555..ed056d0 100644 --- a/src/main.c +++ b/src/main.c @@ -5,6 +5,7 @@ #include #include "list.h" +#include "types.h" #include "optimizers.h" static bool run; @@ -37,7 +38,7 @@ int main(void) { do { // Loop through found primes - for(unsigned long long int i = 0; i < primes.size; ++i) { + for(ulli i = 0; i < primes.size; ++i) { // If `num' is divisible by a prime then go to the next number if(mpz_divisible_p(num, primes.list[i]) != 0) goto nextPrime; } diff --git a/src/types.h b/src/types.h new file mode 100644 index 0000000..9de6f13 --- /dev/null +++ b/src/types.h @@ -0,0 +1,2 @@ +#pragma once +typedef unsigned long long int ulli;