Small cleanup.

This commit is contained in:
Nicolás A. Ortega 2016-12-30 17:51:48 +01:00
parent 3246870b75
commit 3e902efd18
No known key found for this signature in database
GPG Key ID: 614272579C2070D1
3 changed files with 2 additions and 4 deletions

View File

@ -1,6 +1,5 @@
#include "list.h" #include "list.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h>
/** /**
* This is the number of elements by which the list expands. * This is the number of elements by which the list expands.

View File

@ -7,7 +7,6 @@
*/ */
#pragma once #pragma once
#include <gmp.h> #include <gmp.h>
#include <stdbool.h>
/** /**
* @brief An infinitely expanding list type. * @brief An infinitely expanding list type.

View File

@ -172,7 +172,7 @@ int main(int argc, char *argv[]) {
for(size_t i = 0; mpz_cmp(primes.list[i], halfNum) < 0; ++i) { for(size_t i = 0; mpz_cmp(primes.list[i], halfNum) < 0; ++i) {
// If `num' is divisible by a prime then go to the next number // If `num' is divisible by a prime then go to the next number
if(mpz_divisible_p(num, primes.list[i]) != 0) if(mpz_divisible_p(num, primes.list[i]) != 0)
goto nextPrime; goto nextNum;
} }
// `num' is a prime so we add it to the list and print it // `num' is a prime so we add it to the list and print it
@ -186,7 +186,7 @@ int main(int argc, char *argv[]) {
printf("\n"); printf("\n");
} }
nextPrime: nextNum:
// Add 2 (skip even numbers since they're all divisible by 2) // Add 2 (skip even numbers since they're all divisible by 2)
mpz_add_ui(num, num, 2); mpz_add_ui(num, num, 2);
} while(run); } while(run);