Converting from int to int32_t and some cases bool.
This commit is contained in:
12 files changed
+51
-48
No files matched your search
+1
-1
@@ -12,6 +12,6 @@
|
||||
* @param print_mode The mode for printing the results (1 for full, 2 for minimal)
|
||||
* @return 1 if a solution is found, 0 otherwise
|
||||
*/
|
||||
int run_bfs(int128_t* sum, int128_t a0, int128_t b0, int128_t c0, int print_mode);
|
||||
bool run_bfs(int128_t* sum, int128_t a0, int128_t b0, int128_t c0, int print_mode);
|
||||
|
||||
#endif /* BFS_H */
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
* @param c The third integer
|
||||
* @return A hash value for the three integers
|
||||
*/
|
||||
unsigned int hash_three128(uint128_t a, uint128_t b, uint128_t c);
|
||||
uint32_t hash_three128(uint128_t a, uint128_t b, uint128_t c);
|
||||
|
||||
/**
|
||||
* @brief Sorts a triplet of 128-bit integers in ascending order
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ int128_t power(int128_t b, int128_t ex);
|
||||
* @param n1 The first integer
|
||||
* @param print_mode The mode for printing the results
|
||||
*/
|
||||
void generate_factor_pairs(int128_t* sum, int prime_index, int* exponents,
|
||||
void generate_factor_pairs(int128_t* sum, int32_t prime_index, int32_t* exponents,
|
||||
int128_t* values, int128_t n1, int print_mode);
|
||||
|
||||
/**
|
||||
|
||||
+3
-8
@@ -14,7 +14,7 @@ typedef struct Node {
|
||||
* @brief Initializes the node pool with a specified maximum number of nodes
|
||||
* @param max_nodes The maximum number of nodes the pool can hold
|
||||
*/
|
||||
void node_pool_init(int max_nodes);
|
||||
void node_pool_init(int32_t max_nodes);
|
||||
|
||||
/**
|
||||
* @brief Allocates a node from the pool
|
||||
@@ -36,7 +36,7 @@ void node_pool_destroy();
|
||||
* @brief Returns the current usage of the node pool
|
||||
* @return The number of nodes currently allocated from the pool
|
||||
*/
|
||||
int node_pool_usage();
|
||||
int32_t node_pool_usage();
|
||||
|
||||
/**
|
||||
* @brief Tries to push child nodes based on the current node's move
|
||||
@@ -44,11 +44,6 @@ int node_pool_usage();
|
||||
*/
|
||||
void try_push_children(Node* curr);
|
||||
|
||||
typedef struct VisitedEntry {
|
||||
int128_t a, b, c;
|
||||
struct VisitedEntry* next;
|
||||
} VisitedEntry;
|
||||
|
||||
/**
|
||||
* @brief Marks a triplet as visited and checks if it's new
|
||||
* @param a The first integer of the triplet
|
||||
@@ -56,7 +51,7 @@ typedef struct VisitedEntry {
|
||||
* @param c The third integer of the triplet
|
||||
* @return 1 if the triplet is new and marked, 0 if it was already visited
|
||||
*/
|
||||
int visit_and_mark(int128_t a, int128_t b, int128_t c);
|
||||
bool visit_and_mark(int128_t a, int128_t b, int128_t c);
|
||||
|
||||
/**
|
||||
* @brief Clears the hash table
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
* @brief Initializes the queue with a maximum number of elements
|
||||
* @param max_elements The maximum number of elements the queue can hold
|
||||
*/
|
||||
void queue_init(int max_elements);
|
||||
void queue_init(int32_t max_elements);
|
||||
|
||||
/**
|
||||
* @brief Pushes a node into the queue
|
||||
@@ -26,7 +26,7 @@ Node* queue_pop();
|
||||
* @brief Returns the current size of the queue
|
||||
* @return The current size of the queue
|
||||
*/
|
||||
int queue_size();
|
||||
int32_t queue_size();
|
||||
|
||||
/**
|
||||
* @brief Clears the queue without freeing memory
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#define UTILS_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
__extension__ typedef __int128 int128_t;
|
||||
__extension__ typedef unsigned __int128 uint128_t;
|
||||
|
||||
Reference in new issue
Block a user