Shorten the long ass `unsigned long long int' to ulli.

This commit is contained in:
Nicolás A. Ortega 2016-12-10 02:20:57 +01:00
parent cb9e1648e9
commit 3c8b9922fb
No known key found for this signature in database
GPG Key ID: 614272579C2070D1
3 changed files with 8 additions and 3 deletions

View File

@ -2,13 +2,15 @@
#include <gmp.h>
#include <stdbool.h>
#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;
/**

View File

@ -5,6 +5,7 @@
#include <gmp.h>
#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;
}

2
src/types.h Normal file
View File

@ -0,0 +1,2 @@
#pragma once
typedef unsigned long long int ulli;