Skip to content

Commit

Permalink
fix up warnings in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Jun 24, 2024
1 parent 1a8ab2e commit 29220ec
Show file tree
Hide file tree
Showing 20 changed files with 61 additions and 29 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up extra compilers (Linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: make icc pcc

- name: Use Python 3.7
uses: actions/setup-python@v5
with:
Expand Down
4 changes: 3 additions & 1 deletion c/p0000_template.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ critque.
This paragraph should be replaced by the problem description, excluding images.
*/
#pragma once
#ifndef EULER_P0000
#define EULER_P0000
#include <stdio.h>

unsigned long long p0000() {
Expand All @@ -21,3 +22,4 @@ int main(int argc, char const *argv[]) {
return 0;
}
#endif
#endif
4 changes: 3 additions & 1 deletion c/p0001.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.
*/
#pragma once
#ifndef EULER_P0001
#define EULER_P0001
#include <stdio.h>
#include "include/iterator.h"

Expand Down Expand Up @@ -40,3 +41,4 @@ int main(int argc, char const *argv[]) {
return 0;
}
#endif
#endif
4 changes: 3 additions & 1 deletion c/p0002.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ By considering the terms in the Fibonacci sequence whose values do not exceed
four million, find the sum of the even-valued terms.
*/

#pragma once
#ifndef EULER_P0002
#define EULER_P0002
#include <stdio.h>
#include "include/fibonacci.h"

Expand All @@ -36,3 +37,4 @@ int main(int argc, char const *argv[]) {
return 0;
}
#endif
#endif
5 changes: 3 additions & 2 deletions c/p0003.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
*/

#pragma once
#ifndef EULER_P0003
#define EULER_P0003
#include <stdio.h>
#include "include/primes.h"

Expand All @@ -32,3 +32,4 @@ int main(int argc, char const *argv[]) {
return 0;
}
#endif
#endif
6 changes: 4 additions & 2 deletions c/p0004.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ the product of two 2-digit numbers is 9009 = 91 × 99.
Find the largest palindrome made from the product of two 3-digit numbers.
*/
#pragma once
#ifndef EULER_P0004
#define EULER_P0004
#include <stdio.h>

#include "include/digits.h"

unsigned int p0004() {
Expand Down Expand Up @@ -41,7 +41,9 @@ unsigned int p0004() {

#ifndef UNITY_END
int main(int argc, char const *argv[]) {
unsigned int answer = p0004();
printf("%u", answer);
return 0;
}
#endif
#endif
5 changes: 3 additions & 2 deletions c/p0005.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ number infrastructure a lot easier to set up.
What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
*/

#pragma once
#ifndef EULER_P0005
#define EULER_P0005
#include <stdio.h>
#include "include/macros.h"
#include "include/primes.h"
Expand Down Expand Up @@ -47,3 +47,4 @@ int main(int argc, char const *argv[]) {
return 0;
}
#endif
#endif
4 changes: 3 additions & 1 deletion c/p0006.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ numbers and the square of the sum is 3025 − 385 = 2640.
Find the difference between the sum of the squares of the first one hundred
natural numbers and the square of the sum.
*/
#pragma once
#ifndef EULER_P0006
#define EULER_P0006
#include <stdio.h>

unsigned long long p0006() {
Expand All @@ -37,3 +38,4 @@ int main(int argc, char const *argv[]) {
return 0;
}
#endif
#endif
4 changes: 3 additions & 1 deletion c/p0007.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that
What is the 10 001st prime number?
*/
#pragma once
#ifndef EULER_P0007
#define EULER_P0007
#include <stdio.h>
#include "include/primes.h"

Expand All @@ -32,3 +33,4 @@ int main(int argc, char const *argv[]) {
return 0;
}
#endif
#endif
4 changes: 3 additions & 1 deletion c/p0008.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ The four adjacent digits in the 1000-digit number that have the greatest product
Find the thirteen adjacent digits in the 1000-digit number that have the greatest product. What is the value of this product?
*/
#pragma once
#ifndef EULER_P0008
#define EULER_P0008
#include <stdio.h>
#include "include/macros.h"

Expand Down Expand Up @@ -78,3 +79,4 @@ int main(int argc, char const *argv[]) {
return 0;
}
#endif
#endif
4 changes: 3 additions & 1 deletion c/p0009.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ For example, 32 + 42 = 9 + 16 = 25 = 52.
There exists exactly one Pythagorean triplet for which a + b + c = 1000.
Find the product abc.
*/
#pragma once
#ifndef EULER_P0009
#define EULER_P0009
#include <stdio.h>

unsigned long long p0009() {
Expand All @@ -37,3 +38,4 @@ int main(int argc, char const *argv[]) {
return 0;
}
#endif
#endif
4 changes: 3 additions & 1 deletion c/p0010.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
Find the sum of all the primes below two million.
*/
#pragma once
#ifndef EULER_P0010
#define EULER_P0010
#include <stdio.h>
#include "include/primes.h"

Expand All @@ -30,3 +31,4 @@ int main(int argc, char const *argv[]) {
return 0;
}
#endif
#endif
6 changes: 4 additions & 2 deletions c/p0011.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ The product of these numbers is 26 × 63 × 78 × 14 = 1788696.
What is the greatest product of four adjacent numbers in the same direction (up, down, left, right, or diagonally) in
the 20×20 grid?
*/
#pragma once
#ifndef EULER_P0011
#define EULER_P0011
#include <stdio.h>
#include "include/macros.h"

Expand Down Expand Up @@ -87,7 +88,8 @@ unsigned long long p0011() {
#ifndef UNITY_END
int main(int argc, char const *argv[]) {
unsigned long long answer = p0011();
printf("%lu", answer);
printf("%llu", answer);
return 0;
}
#endif
#endif
4 changes: 3 additions & 1 deletion c/p0012.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ We can see that 28 is the first triangle number to have over five divisors.
What is the value of the first triangle number to have over five hundred
divisors?
*/
#pragma once
#ifndef EULER_P0012
#define EULER_P0012
#include <stdio.h>
#include "include/factors.h"

Expand Down Expand Up @@ -70,3 +71,4 @@ int main(int argc, char const *argv[]) {
return 0;
}
#endif
#endif
6 changes: 4 additions & 2 deletions c/p0013.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ Work out the first ten digits of the sum of the following one-hundred 50-digit n
20849603980134001723930671666823555245252804609722
53503534226472524250874054075591789781264330331690
*/
#pragma once
#ifndef EULER_P0013
#define EULER_P0013
#include <stdio.h>
#include "include/bcd.h"

Expand Down Expand Up @@ -235,8 +236,9 @@ unsigned long long p0013() {

#ifndef UNITY_END
int main(int argc, char const *argv[]) {
BCD_int answer = p0013();
unsigned long long answer = p0013();
printf("%llu\n", answer);
return 0;
}
#endif
#endif
4 changes: 3 additions & 1 deletion c/p0014.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Which starting number, under one million, produces the longest chain?
NOTE: Once the chain starts the terms are allowed to go above one million.
*/
#pragma once
#ifndef EULER_P0014
#define EULER_P0014
#include <stdio.h>
#include "include/macros.h"

Expand Down Expand Up @@ -64,3 +65,4 @@ int main(int argc, char const *argv[]) {
return 0;
}
#endif
#endif
6 changes: 4 additions & 2 deletions c/p0015.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ routes to the bottom right corner.
How many such routes are there through a 20×20 grid?
*/
#pragma once
#ifndef EULER_P0015
#define EULER_P0015
#include <stdio.h>
#include "include/math.h"

Expand All @@ -26,8 +27,9 @@ unsigned long long p0015() {

#ifndef UNITY_END
int main(int argc, char const *argv[]) {
unsigned long long p0015();
unsigned long long answer = p0015();
printf("%llu", answer);
return 0;
}
#endif
#endif
4 changes: 3 additions & 1 deletion c/p0016.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ to do it than this, if I could manage arbitrary-precision multiplication more ef
What is the sum of the digits of the number 21000?
*/
#pragma once
#ifndef EULER_P0016
#define EULER_P0016
#include <stdio.h>
#include "include/bcd.h"

Expand All @@ -31,3 +32,4 @@ int main(int argc, char const *argv[]) {
return 0;
}
#endif
#endif
4 changes: 3 additions & 1 deletion c/p0034.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ their digits.
Note: as 1! = 1 and 2! = 2 are not sums they are not included.
*/
#pragma once
#ifndef EULER_P0034
#define EULER_P0034
#include <stdio.h>
#include "include/digits.h"
#include "include/math.h"
Expand Down Expand Up @@ -39,3 +40,4 @@ int main(int argc, char const *argv[]) {
return 0;
}
#endif
#endif
4 changes: 3 additions & 1 deletion c/p0076.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ It is possible to write five as a sum in exactly six different ways:
How many different ways can one hundred be written as a sum of at least two
positive integers?
*/
#pragma once
#ifndef EULER_P0076
#define EULER_P0076
#include <stdio.h>
#include "include/macros.h"

Expand Down Expand Up @@ -76,3 +77,4 @@ int main(int argc, char const *argv[]) {
return 0;
}
#endif
#endif

0 comments on commit 29220ec

Please sign in to comment.