add comments + errpoitner

This commit is contained in:
Théophyl Hoguet committed 2022-01-15 22:19:36 +01:00
1 parent bd2ce3c07b
commit fafb1550fe
2 files changed
+26

No files matched your search

+10
View File
@@ -1,5 +1,15 @@
#include <stdio.h>
#include <stdlib.h>
int max(int a, int b) {
if (a > b)
return a;
return b;
}
void checkPointer(void* p) {
if (!p) {
fprintf(stderr, "Error on given pointer.\n");
exit(EXIT_FAILURE);
}
}
+16
View File
@@ -3,13 +3,29 @@
#include "history.h"
struct game_s {
// tab of tab of square (eg: tab_cell[i][j])
square** tab_cell;
bool wrapping;
uint height; // i in general
uint width; // j in general
// case of history
history hist;
};
/**
* @brief return the max between a and b
*
* @param a int to test
* @param b int to test
* @return the max between a and b
*/
int max(int a, int b);
/**
* @brief check if the pointer is NULL fprinf and exit else nothing
*
* @param p any pointer
*/
void checkPointer(void* p);
#endif